File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
panel/src/components/Forms Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 511511 "lock.unsaved.users" : " Unsaved accounts" ,
512512 "lock.isLocked" : " Unsaved changes by {email}" ,
513513 "lock.unlock" : " Unlock" ,
514+ "lock.unlock.confirm" : " You will take over the changes from <strong>{{ email }}</strong>. They will then be unable to edit the content." ,
514515 "lock.unlock.submit" : " Unlock and overwrite unsaved changes by <strong>{email}</strong>" ,
515516 "lock.isUnlocked" : " Was unlocked by another user" ,
516517
Original file line number Diff line number Diff line change 4646 {{ $t("form.preview") }}
4747 </k-dropdown-item >
4848 </template >
49+ <template v-if =" isLocked && isUnlockable " >
50+ <hr />
51+ <k-dropdown-item icon =" lock" @click =" unlock" >
52+ {{ $t("lock.unlock") }}
53+ </k-dropdown-item >
54+ </template >
4955 </k-dropdown-content >
5056 </div >
5157</template >
@@ -56,6 +62,7 @@ export const props = {
5662 editor: String ,
5763 hasDiff: Boolean ,
5864 isLocked: Boolean ,
65+ isUnlockable: Boolean ,
5966 modified: [String , Date ],
6067 /**
6168 * Preview URL for changes
@@ -136,6 +143,28 @@ export default {
136143 }
137144 }
138145 });
146+ },
147+ unlock () {
148+ this .$panel .dialog .open ({
149+ component: " k-text-dialog" ,
150+ props: {
151+ size: " small" ,
152+ submitButton: {
153+ icon: " lock" ,
154+ theme: " negative" ,
155+ text: this .$t (" lock.unlock" )
156+ },
157+ text: this .$t (" lock.unlock.confirm" , {
158+ email: this .editor
159+ })
160+ },
161+ on: {
162+ submit : () => {
163+ this .$panel .dialog .close ();
164+ this .$emit (" unlock" );
165+ }
166+ }
167+ });
139168 }
140169 }
141170};
You can’t perform that action at this time.
0 commit comments