Skip to content

Commit

Permalink
wc - Manage event onClear in grid settings, #TASK-4846
Browse files Browse the repository at this point in the history
Signed-off-by: gpveronica <[email protected]>
  • Loading branch information
gpveronica committed Oct 22, 2024
1 parent 646ce87 commit f1c4e35
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/webcomponents/commons/catalog-browser-grid-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ export default class CatalogBrowserGridConfig extends LitElement {
LitUtils.dispatchCustomEvent(this, "configChange", this.config);
}

onClear() {
this.onConfigObserver();
this.requestUpdate();
}

async onSubmit() {
try {
// Update user configuration
Expand Down Expand Up @@ -168,6 +173,7 @@ export default class CatalogBrowserGridConfig extends LitElement {
.data="${this.config}"
.config="${this.getConfigForm()}"
@fieldChange="${e => this.onFieldChange(e)}"
@clear="${e=>this.onClear(e)}"
@submit="${e => this.onSubmit(e)}">
</data-form>
`;
Expand All @@ -187,7 +193,8 @@ export default class CatalogBrowserGridConfig extends LitElement {
titleAlign: "left",
titleWidth: 4,
defaultLayout: "vertical",
buttonsVisible: true
buttonsVisible: true,
buttonClearText: "Discard",
},
sections: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ export default class VariantInterpreterGridConfig extends LitElement {
LitUtils.dispatchCustomEvent(this, "configChange", this.config);
}

onClear() {
this.onConfigObserver();
this.requestUpdate();
}

async onSubmit() {
// const newGridConfig = {...this.config};
//
Expand Down Expand Up @@ -192,6 +197,7 @@ export default class VariantInterpreterGridConfig extends LitElement {
.data="${this.config}"
.config="${this.getConfigForm()}"
@fieldChange="${e => this.onFieldChange(e)}"
@clear="${e=>this.onClear(e)}"
@submit="${e => this.onSubmit(e)}">
</data-form>
`;
Expand Down Expand Up @@ -221,7 +227,8 @@ export default class VariantInterpreterGridConfig extends LitElement {
titleAlign: "left",
titleWidth: 4,
defaultLayout: "vertical",
buttonsVisible: true
buttonsVisible: true,
buttonClearText: "Discard",
},
sections: [
{
Expand Down

0 comments on commit f1c4e35

Please sign in to comment.