Skip to content

Commit

Permalink
feat(pluginform): cancel of plugin edit redirects to plugin select
Browse files Browse the repository at this point in the history
  • Loading branch information
TT1228 committed Jan 10, 2025
1 parent fab32d5 commit 3b51ed9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pages/plugins/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
:disable-scope-selection="disableScopeSelection"
@error:fetch-schema="onFetchSchemaError"
@update="onSave"
@cancel="onFormCancel"
/>
</template>

Expand Down Expand Up @@ -77,13 +78,22 @@ const cancelRoute = computed(() => {
const config = reactive({
...toRefs(useFormGeneralConfig()),
cancelRoute,
entityId: computed(() => entityScope.value?.id ?? ''),
entityType: computed(() => entityScope.value?.typeLiteral),
disableConsumerGroupScope: true,
isNewOtelSchema: true,
})
// return to previous page on cancel
const onFormCancel = (): void => {
if (history.state?.back) {
router.back()
return
} else {
router.push(cancelRoute.value)
}
}
const onFetchSchemaError = (err: AxiosError) => {
if (err.response?.status === 404) {
router.replace({ name: 'not-found' })
Expand Down

0 comments on commit 3b51ed9

Please sign in to comment.