Skip to content

Commit

Permalink
Rename isUnsaved prop to hasChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Nov 19, 2024
1 parent 19a2a55 commit 8d61337
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions panel/lab/components/formcontrols/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/>

<k-form-controls
:is-unsaved="isUnsaved"
:has-changes="hasChanges"
:is-locked="isLocked"
editor="editor@getkirby.com"
modified="2024-10-01T17:00:00"
Expand All @@ -35,9 +35,9 @@
>
<k-input
type="toggle"
:value="isUnsaved"
text="is-unsaved"
@input="isUnsaved = $event"
:value="hasChanges"
text="has-changes"
@input="hasChanges = $event"
/>
<k-input
type="toggle"
Expand All @@ -48,9 +48,9 @@
</k-grid>
</k-lab-example>

<k-lab-example label="Unsaved">
<k-lab-example label="Changes">
<k-form-controls
:is-unsaved="true"
:has-changes="true"
editor="editor@getkirby.com"
modified="2024-10-01T17:00:00"
preview="https://getkirby.com"
Expand All @@ -75,8 +75,8 @@
export default {
data() {
return {
isLocked: false,
isUnsaved: false
hasChanges: false,
isLocked: false
};
},
methods: {
Expand Down
4 changes: 2 additions & 2 deletions panel/src/components/Forms/FormControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
export default {
props: {
editor: String,
hasChanges: Boolean,
isLocked: Boolean,
isUnsaved: Boolean,
modified: [String, Date],
/**
* Preview URL for changes
Expand All @@ -81,7 +81,7 @@ export default {
];
}
if (this.isUnsaved === true) {
if (this.hasChanges === true) {
return [
{
theme: "notice",
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Views/Files/FileView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<k-view-buttons :buttons="buttons" @action="onAction" />
<k-form-controls
:editor="editor"
:has-changes="hasChanges"
:is-locked="isLocked"
:is-unsaved="hasChanges"
:modified="modified"
@discard="onDiscard"
@submit="onSubmit"
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Views/Pages/PageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<k-view-buttons :buttons="buttons" />
<k-form-controls
:editor="editor"
:has-changes="hasChanges"
:is-locked="isLocked"
:is-unsaved="hasChanges"
:modified="modified"
:preview="permissions.preview ? api + '/preview/compare' : false"
@discard="onDiscard"
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Views/Pages/SiteView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<k-view-buttons :buttons="buttons" />
<k-form-controls
:editor="editor"
:has-changes="hasChanges"
:is-locked="isLocked"
:is-unsaved="hasChanges"
:modified="modified"
:preview="api + '/preview/compare'"
@discard="onDiscard"
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Views/PreviewView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
/>
<k-form-controls
:editor="editor"
:has-changes="hasChanges"
:is-locked="isLocked"
:is-unsaved="hasChanges"
:modified="modified"
size="sm"
@discard="onDiscard"
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Views/Users/UserView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<k-view-buttons :buttons="buttons" />
<k-form-controls
:editor="editor"
:has-changes="hasChanges"
:is-locked="isLocked"
:is-unsaved="hasChanges"
:modified="modified"
@discard="onDiscard"
@submit="onSubmit"
Expand Down

0 comments on commit 8d61337

Please sign in to comment.