Skip to content
Snippets Groups Projects

Add UI components for Beyond Identity check exclusions by Projects

Merged Jacques Erasmus requested to merge 454372-beyond-identity-exclusions-ui into master
All threads resolved!
8 files
+ 108
59
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -21,10 +21,7 @@ export default {
data() {
return {
isLoading: false,
selectedItems: [
{ name: 'Project 3', id: 3, type: 'project' },
{ name: 'Project 4', id: 4, type: 'project' },
],
exclusions: [],
};
},
computed: {
@@ -33,10 +30,18 @@ export default {
},
},
methods: {
handleSelectExclusion(exclusion) {
this.exclusions.push({ ...exclusion });
},
handleRemoveExclusion(id) {
const exclusionIndex = this.exclusions.findIndex((exclusion) => exclusion.id === id);
this.exclusions.splice(exclusionIndex, 1);
},
async handleAddExclusions() {
this.isLoading = true;
// TODO: await addExclusions();
this.$emit('add', this.selectedItems);
this.$emit('add', this.exclusions);
this.exclusions = [];
this.isLoading = false;
},
},
@@ -58,7 +63,13 @@ export default {
</template>
<template #default>
<list-selector type="projects" class="gl-m-5 gl-p-0!" :selected-items="selectedItems" />
<list-selector
type="projects"
class="gl-m-5 gl-p-0!"
:selected-items="exclusions"
@select="handleSelectExclusion"
@delete="handleRemoveExclusion"
/>
<gl-button
class="gl-ml-5"
Loading