Skip to content

Commit

Permalink
update key.html to open correct modal on button click
Browse files Browse the repository at this point in the history
  • Loading branch information
thombehrens committed Nov 14, 2024
1 parent 339db6e commit e7e455f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<c-key
bundle={bundle}
is-setup="true"
oneditbundle={handleEditBundle}
oneditindicator={handleEditIndicator}>
</c-key>
</lightning-layout-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,10 @@ export default class ConfigurationManager extends LightningElement {
this.openModal(event.detail);
}

handleEditBundle(event) {
editIndicatorBundleModal.open().then((result) => {
console.log(result);
});
}

}
3 changes: 2 additions & 1 deletion force-app/main/default/lwc/key/key.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ <h2>Bundle is not active.</h2>
<template lwc:if={isBundle}>
<lightning-button
name={bundleDetails.BundleId}
data-event-type="editbundle"
onclick={handleClick}
label="Edit Bundle"
title="Edit Bundle"
Expand Down Expand Up @@ -132,7 +133,7 @@ <h2>Item is not active. No indicators will be shown, even if they are active.</
</lightning-layout-item>
<lightning-layout-item padding="horizontal-small" size="2" class="slds-text-align_right">
<template lwc:if={isManageEnabled}>
<lightning-button name={indicatorItem.IndicatorId} onclick={handleClick} label="Edit Indicator" title="Edit Indicator" icon-name="utility:setup"></lightning-button>
<lightning-button name={indicatorItem.IndicatorId} onclick={handleClick} data-event-type="editindicator" label="Edit Indicator" title="Edit Indicator" icon-name="utility:setup"></lightning-button>
</template>
</lightning-layout-item>
</lightning-layout>
Expand Down
6 changes: 2 additions & 4 deletions force-app/main/default/lwc/key/key.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,9 @@ export default class Key extends LightningElement {
}

handleClick(event){
console.log(event.target.name);
const editindicatorEvent = new CustomEvent('editindicator', {
this.dispatchEvent(new CustomEvent(event.target.dataset.eventType, {
detail: event.target.name
});
this.dispatchEvent(editindicatorEvent);
}));
//window.open('/lightning/setup/CustomMetadata/page?address=%2F' + event.target.name,'_blank');
}

Expand Down

0 comments on commit e7e455f

Please sign in to comment.