Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 9x 9x 9x 9x 9x 9x 9x 9x 1x 9x 9x 9x 9x | 'use strict';
define(
[
'underscore',
'oro/translator',
'pim/controller/front',
'pim/form-builder',
'pim/fetcher-registry',
'pim/user-context',
'pim/dialog',
'pim/page-title',
'pim/i18n'
],
function (_, __, BaseController, FormBuilder, FetcherRegistry, UserContext, Dialog, PageTitle, i18n) {
return BaseController.extend({
/**
* {@inheritdoc}
*/
renderForm: function (route) {
return FetcherRegistry.getFetcher('association-type').fetch(route.params.code, {cached: false})
.then((associationType) => {
Iif (!this.active) {
return;
}
var label = _.escape(
i18n.getLabel(
associationType.labels,
UserContext.get('catalogLocale'),
associationType.code
)
);
PageTitle.set({'association type.label': _.escape(label) });
return FormBuilder.build(associationType.meta.form)
.then((form) => {
this.on('pim:controller:can-leave', function (event) {
form.trigger('pim_enrich:form:can-leave', event);
});
form.setData(associationType);
form.trigger('pim_enrich:form:entity:post_fetch', associationType);
form.setElement(this.$el).render();
return form;
});
});
}
});
}
);
|