Skip to content

Commit ca60d32

Browse files
Add support for deleting tabs
1 parent 6987157 commit ca60d32

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

force-app/main/default/lwc/odFlowTabsConfigurationTabs/odFlowTabsConfigurationTabs.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
</lightning-helptext>
3232
</th>
3333
<th class="slds-p-around--x-small" style="width: 80px">Order</th>
34+
<th class="slds-p-around--x-small" style="width: 50px"></th>
3435
</tr>
3536
</thead>
3637
<tbody>
@@ -147,6 +148,17 @@
147148
>
148149
</lightning-input>
149150
</td>
151+
<td class="slds-align--absolute-center">
152+
<lightning-button-icon
153+
title="Delete Tab"
154+
alternative-text="Delete Tab"
155+
icon-name="utility:delete"
156+
class="slds-form-element slds-p-around--xx-small"
157+
data-value={tab.value}
158+
onclick={handleDeleteTab}
159+
>
160+
</lightning-button-icon>
161+
</td>
150162
</tr>
151163
</template>
152164
</tbody>

force-app/main/default/lwc/odFlowTabsConfigurationTabs/odFlowTabsConfigurationTabs.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,13 @@ export default class OD_FlowTabsConfigurationTabs extends LightningModal {
164164

165165
this.theTabs = this._addDataAndOrder(tabsPlusNew);
166166
}
167+
168+
handleDeleteTab(event) {
169+
const value = event.target.dataset.value;
170+
171+
const deletedIndex = this.theTabs.findIndex((tab) => tab.value === value);
172+
if (deletedIndex !== -1) {
173+
this.theTabs.splice(deletedIndex, 1);
174+
}
175+
}
167176
}

images/Tabs.png

-148 KB
Loading

0 commit comments

Comments
 (0)