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!
20 files
+ 811
120
Compare changes
  • Side-by-side
  • Inline
Files
20
@@ -19,7 +19,10 @@ export default {
},
},
data() {
return { isLoading: false };
return {
isLoading: false,
exclusions: [],
};
},
computed: {
getDrawerHeaderHeight() {
@@ -27,9 +30,17 @@ 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.exclusions);
this.exclusions = [];
this.isLoading = false;
},
},
@@ -47,16 +58,23 @@ export default {
v-on="$listeners"
>
<template #title>
<h2 class="gl-font-size-h2 gl-mt-0">{{ $options.i18n.addExclusions }}</h2>
<h2 class="gl-font-size-h2 gl-mt-0" data-testid="title">{{ $options.i18n.addExclusions }}</h2>
</template>
<template #default>
<list-selector type="projects" class="gl-m-5 gl-p-0!" />
<list-selector
type="projects"
class="gl-m-5 gl-p-0!"
:selected-items="exclusions"
@select="handleSelectExclusion"
@delete="handleRemoveExclusion"
/>
<gl-button
class="gl-ml-5"
variant="confirm"
:loading="isLoading"
data-testid="add-button"
@click="handleAddExclusions"
>
{{ $options.i18n.addExclusions }}
Loading