Skip to content

Commit

Permalink
Merge pull request #1976 from nordic-institute/XRDDEV-2590
Browse files Browse the repository at this point in the history
fix: after successful endpoint delete hide dialog and go back to list
  • Loading branch information
ovidijusnortal authored Feb 23, 2024
2 parents df82293 + 97b1821 commit 35d91ea
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,4 @@ jobs:
path: |
src/security-server/system-test/build/allure-report/
src/security-server/system-test/build/ss-container-logs/
src/security-server/system-test/build/reports/test-automation/selenide-failures/*.png
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
outlined
data-test="delete-endpoint"
@click="showDeletePopup()"
>{{ $t('action.delete') }}
>
{{ $t('action.delete') }}
</xrd-button>
</div>
</div>
Expand All @@ -61,7 +62,7 @@
name="path"
:label="$t('endpoints.path')"
data-test="endpoint-path"
></v-text-field>
/>
</div>

<div class="helper-text pl-2">
Expand All @@ -75,14 +76,16 @@
</div>
<div class="xrd-footer-buttons-wrap">
<xrd-button outlined @click="close()"
>{{ $t('action.cancel') }}
>
{{ $t('action.cancel') }}
</xrd-button>
<xrd-button
class="save-button"
:loading="saving"
:disabled="!meta.touched || !meta.valid"
:disabled="!meta.dirty || !meta.valid"
@click="save()"
>{{ $t('action.save') }}
>
{{ $t('action.save') }}
</xrd-button>
</div>

Expand All @@ -91,6 +94,7 @@
v-if="confirmDelete"
title="endpoints.deleteTitle"
text="endpoints.deleteEndpointText"
:loading="deleting"
@cancel="confirmDelete = false"
@accept="remove(id)"
/>
Expand Down Expand Up @@ -139,6 +143,7 @@ export default defineComponent({
return {
confirmDelete: false,
saving: false,
deleting: false,
methods: [
{ title: this.$t('endpoints.all'), value: '*' },
{ title: 'GET', value: 'GET' },
Expand Down Expand Up @@ -169,15 +174,17 @@ export default defineComponent({
this.confirmDelete = true;
},
remove(id: string): void {
this.deleting = true;
this.deleteEndpoint(id)
.then(() => {
this.showSuccess(this.$t('endpoints.deleteSuccess'));
this.$router.back();
})
.catch((error) => {
this.showError(error);
this.confirmDelete = false;
});
})
.finally(() => (this.confirmDelete = false))
.finally(() => (this.deleting = false));
},
save(): void {
this.saving = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@
class="xrd-tabs"
color="primary"
slider-size="2"
slider-color="primary"
:show-arrows="true"
>
<v-tabs-slider
color="primary"
class="xrd-sub-tabs-slider"
></v-tabs-slider>
<v-tab
v-for="tab in tabs"
:key="tab.key"
Expand Down

0 comments on commit 35d91ea

Please sign in to comment.