Skip to content

Commit

Permalink
fix(ui): allow save default dashboard upon creation even without change
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p committed Nov 29, 2024
1 parent b93b834 commit 4b6aef7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/dashboard/components/DashboardCreate.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<top-nav-bar :title="routeInfo.title" />
<section class="full-container">
<dashboard-editor @save="save" :initial-source="initialSource" />
<dashboard-editor allow-save-unchanged @save="save" :initial-source="initialSource" />
</section>
</template>

Expand Down
8 changes: 6 additions & 2 deletions ui/src/components/dashboard/components/DashboardEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
:icon="ContentSave"
@click="$emit('save', source)"
:type="buttonType"
:disabled="source === initialSource"
:disabled="!allowSaveUnchanged && source === initialSource"
>
{{ $t("save") }}
</el-button>
</div>
<el-row>
<el-col :span="24">
<editor
@save="source != initialSource ? $emit('save', $event) : undefined"
@save="(allowSaveUnchanged || source !== initialSource) ? $emit('save', $event) : undefined"
v-model="source"
schema-type="dashboard"
lang="yaml"
Expand Down Expand Up @@ -51,6 +51,10 @@
},
emits: ["save"],
props: {
allowSaveUnchanged: {
type: Boolean,
default: false
},
initialSource: {
type: String,
default: undefined
Expand Down

0 comments on commit 4b6aef7

Please sign in to comment.