Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Upgrade fix for 3.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
amitflagbit authored and Antonio Mansilla committed May 28, 2019
1 parent 6ce0413 commit 7f47cd6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Resources/config/form_extensions/edit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ extensions:
config:
labels:
title: flagbit.confirmation.clone.product
subTitle: pim_menu.item.product_model
subTitle: pim_enrich.entity.product.label
subTitleModel: pim_menu.item.product_model
content: confirmation.clone.product
successMessage: flagbit.entity.product.info.create_successful
postProductRoute: flagbit_product_cloner_product_clone
Expand Down
29 changes: 27 additions & 2 deletions src/Resources/public/js/product/form/clone-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ define(
},

render() {


this.$el.html(this.template({
modalTitle: __(this.config.labels.title),
subTitle: __(this.config.labels.subTitle),
subTitle: __(this.getSubtitle()),
content: __(this.config.labels.content),
picture: this.config.picture,
errors: this.globalErrors
Expand All @@ -72,6 +74,28 @@ define(
});
},

getIllustrationClass() {
if (this.getProductType() == 'model') {
return 'product-model';
}
else {
return 'products';
}
},

getSubtitle() {
if (this.getProductType() == 'model') {
return this.config.labels.subTitleModel;
}
else {
return this.config.labels.subTitle;
}
},

getProductType() {
return this.getRoot().model.get('type');
},

/**
* Opens the modal then instantiates the creation form inside it.
* This function returns a rejected promise when the popin
Expand All @@ -86,7 +110,8 @@ define(
content: '',
cancelText: __('pim_common.cancel'),
okText: __('pim_common.save'),
okCloses: false
okCloses: false,
illustrationClass: this.getIllustrationClass()
});

modal.open();
Expand Down

0 comments on commit 7f47cd6

Please sign in to comment.