Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lang/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "ذاكرة تخزين التطبيق",
"Application cache cleared.": "تم مسح ذاكرة تخزين التطبيق.",
"Apply": "تطبيق",
"Save All": "حفظ الكل",
"Apply Link": "تطبيق الرابط",
"Are you sure you want to delete this column?": "هل أنت متأكد أنك تريد حذف هذا العمود؟",
"Are you sure you want to delete this entry?": "هل أنت متأكد أنك تريد حذف هذا الإدخال؟",
Expand Down
1 change: 1 addition & 0 deletions lang/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Tətbiqi Program Keşi",
"Application cache cleared.": "Tətbiq Program keşi təmizləndi.",
"Apply": "Tətbiq et",
"Save All": "Hamısını yadda saxla",
"Apply Link": "Keçidi tətbiq et",
"Are you sure you want to delete this column?": "Bu sütunu silmək istədiyinizə əminsinizmi?",
"Are you sure you want to delete this entry?": "Bu girişi silmək istədiyinizə əminsinizmi?",
Expand Down
1 change: 1 addition & 0 deletions lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Mezipaměť aplikace",
"Application cache cleared.": "Mezipaměť aplikace vymazána.",
"Apply": "Použít",
"Save All": "Uložit vše",
"Apply Link": "Použít odkaz",
"Are you sure you want to delete this column?": "Opravdu chcete smazat tento sloupec?",
"Are you sure you want to delete this entry?": "Opravdu chcete smazat tento záznam?",
Expand Down
1 change: 1 addition & 0 deletions lang/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Applikationscache",
"Application cache cleared.": "Applikationscache ryddet.",
"Apply": "Anvende",
"Save All": "Gem alle",
"Apply Link": "Anvend link",
"Are you sure you want to delete this column?": "Er du sikker på, at du vil slette denne kolonne?",
"Are you sure you want to delete this entry?": "Er du sikker på, at du vil slette denne?",
Expand Down
1 change: 1 addition & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Apply": "Übernehmen",
"Apply & Close All": "Übernehmen & alle schließen",
"Apply & Save": "Übernehmen & Speichern",
"Save All": "Alle speichern",
"Apply Link": "Link übernehmen",
"Apply Query Scopes": "Query-Scopes anwenden",
"Archive": "Archiv",
Expand Down
1 change: 1 addition & 0 deletions lang/de_CH.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Apply": "Übernehmen",
"Apply & Close All": "Übernehmen & alle schliessen",
"Apply & Save": "Übernehmen & Speichern",
"Save All": "Alle speichern",
"Apply Link": "Link übernehmen",
"Apply Query Scopes": "Query-Scopes anwenden",
"Archive": "Archiv",
Expand Down
1 change: 1 addition & 0 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Caché de aplicaciones",
"Application cache cleared.": "Caché de la aplicación borrada.",
"Apply": "Aplicar",
"Save All": "Guardar todo",
"Apply Link": "Aplicar enlace",
"Are you sure you want to delete this column?": "¿Realmente deseas eliminar esta columna?",
"Are you sure you want to delete this entry?": "¿Estás seguro de que deseas eliminar esta entrada?",
Expand Down
1 change: 1 addition & 0 deletions lang/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Rakenduse vahemälu",
"Application cache cleared.": "Rakenduse vahemälu tühjendati.",
"Apply": "Rakenda",
"Save All": "Salvesta kõik",
"Apply Link": "Rakenda link",
"Are you sure you want to delete this column?": "Oled kindel, et soovid selle veeru kustutada?",
"Are you sure you want to delete this entry?": "Oled kindel, et soovid selle kirje kustutada?",
Expand Down
1 change: 1 addition & 0 deletions lang/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "کش اپلیکیشن",
"Application cache cleared.": "کش اپلیکیشن پاک شد.",
"Apply": "اعمال",
"Save All": "ذخیره همه",
"Apply Link": "اعمال پیوند",
"Are you sure you want to delete this column?": "آیا از حذف این ستون اطمینان دارید؟",
"Are you sure you want to delete this entry?": "آیا از حذف این مطلب اطمینان دارید؟",
Expand Down
1 change: 1 addition & 0 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Apply": "Appliquer",
"Apply & Close All": "Appliquer & Tout Fermer",
"Apply & Save": "Appliquer & Enregistrer",
"Save All": "Tout enregistrer",
"Apply Link": "Appliquer le lien",
"Apply Query Scopes": "Appliquer les étendues de requête",
"Archive": "Archive",
Expand Down
1 change: 1 addition & 0 deletions lang/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Alkalmazás gyorsítótár",
"Application cache cleared.": "Az alkalmazás gyorsítótára törölve.",
"Apply": "Alkalmazni",
"Save All": "Összes mentése",
"Apply Link": "Link alkalmazása",
"Are you sure you want to delete this column?": "Biztosan törli ezt az oszlopot?",
"Are you sure you want to delete this entry?": "Biztosan törli ezt a bejegyzést?",
Expand Down
1 change: 1 addition & 0 deletions lang/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Cache Aplikasi",
"Application cache cleared.": "Cache aplikasi dihapus.",
"Apply": "Menerapkan",
"Save All": "Simpan semua",
"Apply Link": "Terapkan Tautan",
"Are you sure you want to delete this column?": "Anda yakin ingin menghapus kolom ini?",
"Are you sure you want to delete this entry?": "Anda yakin ingin menghapus entri ini?",
Expand Down
1 change: 1 addition & 0 deletions lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Cache dell'applicazione",
"Application cache cleared.": "Cache dell'applicazione cancellata.",
"Apply": "Applica",
"Save All": "Salva tutto",
"Apply Link": "Applica collegamento",
"Are you sure you want to delete this column?": "Sei sicuro di voler eliminare questa colonna?",
"Are you sure you want to delete this entry?": "Sei sicuro di voler eliminare questa voce?",
Expand Down
1 change: 1 addition & 0 deletions lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "アプリケーションキャッシュ",
"Application cache cleared.": "アプリケーションキャッシュがクリアされました。",
"Apply": "適用する",
"Save All": "すべて保存",
"Apply Link": "リンクを適用する",
"Are you sure you want to delete this column?": "この列を削除してもよろしいですか?",
"Are you sure you want to delete this entry?": "このエントリを削除してもよろしいですか?",
Expand Down
1 change: 1 addition & 0 deletions lang/ms.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Cache Aplikasi",
"Application cache cleared.": "Cache aplikasi dihapus.",
"Apply": "Mohon",
"Save All": "Simpan semua",
"Apply Link": "Gunakan Pautan",
"Are you sure you want to delete this column?": "Anda pasti ingin menghapus lajur ini?",
"Are you sure you want to delete this entry?": "Anda pasti ingin menghapus entri ini?",
Expand Down
1 change: 1 addition & 0 deletions lang/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"Applied to all users by default.": "Standard preferanser for alle brukere.",
"Applied to your account.": "Preferanser for din konto.",
"Apply": "Bruk",
"Save All": "Lagre alle",
"Apply & Save": "Bruk & lagre",
"Apply Link": "Bruk lenke",
"Are you sure you want to delete this column?": "Er du sikker på at du vil slette denne kolonnen?",
Expand Down
1 change: 1 addition & 0 deletions lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Apply": "Toepassen",
"Apply & Close All": "Toepassen & alles sluiten",
"Apply & Save": "Toepassen & opslaan",
"Save All": "Alles opslaan",
"Apply Link": "Link bevestigen",
"Apply Query Scopes": "Query-scopes toepassen",
"Are you sure you want to delete this column?": "Weet je zeker dat je deze kolom wilt verwijderen?",
Expand Down
1 change: 1 addition & 0 deletions lang/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Pamięć cache aplikacji",
"Application cache cleared.": "Pamięć cache aplikacji usunięta.",
"Apply": "Stosować",
"Save All": "Zapisz wszystko",
"Apply Link": "Zastosuj link",
"Are you sure you want to delete this column?": "Czy na pewno chcesz usunąć tę kolumnę?",
"Are you sure you want to delete this entry?": "Czy na pewno chcesz usunąć ten rekord?",
Expand Down
1 change: 1 addition & 0 deletions lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Cache da aplicação",
"Application cache cleared.": "Cache da aplicação limpo",
"Apply": "Aplicar",
"Save All": "Guardar tudo",
"Apply Link": "Aplicar Link",
"Are you sure you want to delete this column?": "Tem a certeza de que deseja eliminar esta coluna?",
"Are you sure you want to delete this entry?": "Tem certeza de que deseja eliminar esta entrada?",
Expand Down
1 change: 1 addition & 0 deletions lang/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Cache da Aplicação",
"Application cache cleared.": "Cache da aplicação limpo.",
"Apply": "Aplicar",
"Save All": "Salvar tudo",
"Apply Link": "Aplicar link",
"Are you sure you want to delete this column?": "Tem certeza que deseja excluir esta coluna?",
"Are you sure you want to delete this entry?": "Tem certeza que deseja excluir esta entrada?",
Expand Down
1 change: 1 addition & 0 deletions lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"Apply": "Применить",
"Apply & Close All": "Применить и закрыть все",
"Apply & Save": "Применить и сохранить",
"Save All": "Сохранить все",
"Apply Link": "Применить ссылку",
"Apply Query Scopes": "Применить области запроса",
"Are you sure you want to delete this column?": "Хотите удалить этот столбец?",
Expand Down
1 change: 1 addition & 0 deletions lang/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Predpomnilnik aplikacije",
"Application cache cleared.": "Predpomnilnik aplikacije je bil očiščen.",
"Apply": "Prijavite se",
"Save All": "Shrani vse",
"Apply Link": "Uporabi povezavo",
"Are you sure you want to delete this column?": "Ali ste prepričani, da želite izbrisati ta stolpec?",
"Are you sure you want to delete this entry?": "Ali ste prepričani, da želite izbrisati ta vnos?",
Expand Down
1 change: 1 addition & 0 deletions lang/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Applikationscache",
"Application cache cleared.": "Applikationscachen rensades.",
"Apply": "Verkställ",
"Save All": "Spara alla",
"Apply Link": "Använd länk",
"Are you sure you want to delete this column?": "Är du säker på att du vill radera den här kolumnen?",
"Are you sure you want to delete this entry?": "Är du säker på att du vill radera det här inlägget?",
Expand Down
1 change: 1 addition & 0 deletions lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Uygulama Önbelleği",
"Application cache cleared.": "Uygulama önbelleği temizlendi.",
"Apply": "Uygula",
"Save All": "Tümünü kaydet",
"Apply Link": "Bağlantı Uygula",
"Are you sure you want to delete this column?": "Bu sütunu silmek istediğinizden emin misiniz?",
"Are you sure you want to delete this entry?": "Bu girdiyi silmek istediğinizden emin misiniz?",
Expand Down
1 change: 1 addition & 0 deletions lang/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Кеш додатків",
"Application cache cleared.": "Кеш додатків очищено.",
"Apply": "Застосувати",
"Save All": "Зберегти все",
"Apply Link": "Застосувати посилання",
"Are you sure you want to delete this column?": "Ви впевнені, що хочете видалити цей стовпець?",
"Are you sure you want to delete this entry?": "Ви впевнені, що хочете видалити цей запис?",
Expand Down
1 change: 1 addition & 0 deletions lang/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "Bộ nhớ tạm ứng dụng",
"Application cache cleared.": "Bộ nhớ tạm ứng dụng đã được bật.",
"Apply": "Áp dụng",
"Save All": "Lưu tất cả",
"Apply Link": "Áp dụng liên kết",
"Are you sure you want to delete this column?": "Bạn có chắc muốn xoá cột này không?",
"Are you sure you want to delete this entry?": "Bạn có chắc muốn xoá mục này không?",
Expand Down
1 change: 1 addition & 0 deletions lang/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "应用缓存",
"Application cache cleared.": "应用程序缓存已清除。",
"Apply": "申请",
"Save All": "全部保存",
"Apply Link": "应用链接",
"Are you sure you want to delete this column?": "您确定要删除此列吗?",
"Are you sure you want to delete this entry?": "您确定要删除此条目吗?",
Expand Down
1 change: 1 addition & 0 deletions lang/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"Application Cache": "應用程式快取",
"Application cache cleared.": "已清除應用程式快取。",
"Apply": "申请",
"Save All": "全部儲存",
"Apply Link": "套用連結",
"Are you sure you want to delete this column?": "確定要刪除此一欄位?",
"Are you sure you want to delete this entry?": "確定要刪除此一條目?",
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/blueprints/Fields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
:config="pendingCreatedField.config"
:suggestable-condition-fields="suggestableConditionFields"
:is-inside-set="isInsideSet"
:show-save-only-at-top-level="true"
@committed="fieldCreated"
@closed="close"
/>
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/blueprints/RegularField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
:overrides="field.config_overrides || []"
:suggestable-condition-fields="suggestableConditionFields"
:is-inside-set="isInsideSet"
:show-save-only-at-top-level="true"
@committed="settingsUpdated"
@closed="editorClosed"
/>
Expand Down
68 changes: 51 additions & 17 deletions resources/js/components/fields/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<StackHeader v-if="!loading" :title="__(values.display) || __(config.display) || config.handle" :icon="fieldtype.icon">
<template #actions>
<Button variant="default" @click.prevent="commit" :text="__('Apply')" />
<Button v-if="!(isNestedField)" variant="primary" @click.prevent="commitAndSave" icon="save" :text="__('Apply & Save')" />
<Button v-if="isNestedField" variant="default" @click.prevent="commitAndCloseAll" :text="__('Apply & Close All')" />
<Button v-if="isNestedField" variant="primary" @click.prevent="commitAndSaveAll" icon="save" :text="__('Save & Close All')" />
<Button v-if="!showSaveOnlyAtTopLevel" variant="default" @click.prevent="commit" :text="__('Apply')" />
<Button v-if="!(isNestedField)" variant="primary" @click.prevent="commitAndSave" icon="save" :text="showSaveOnlyAtTopLevel ? __('Save') : __('Apply & Save')" />
<Button v-if="isNestedField" variant="default" @click.prevent="commitAndSaveAll" :text="__('Save All')" v-tooltip="saveAllShortcutLabel" />
<Button v-if="isNestedField" variant="primary" @click.prevent="commitAndSaveTopStack" icon="save" :text="__('Save')" />
</template>
</StackHeader>

Expand Down Expand Up @@ -90,6 +90,10 @@ export default {
fields: Array,
suggestableConditionFields: Array,
isInsideSet: Boolean,
showSaveOnlyAtTopLevel: {
type: Boolean,
default: false,
},
},

provide() {
Expand All @@ -106,7 +110,7 @@ export default {
default: false
},
commitParentField: {
default: () => {}
default: null
}
},

Expand Down Expand Up @@ -192,18 +196,26 @@ export default {
isNestedField() {
return this.isInsideSet || this.isInsideConfigFields;
},

saveAllShortcutLabel() {
const platform = typeof navigator !== 'undefined'
? (navigator.userAgentData?.platform || navigator.platform || '')
: '';
const isMac = /Mac|iPhone|iPad|iPod/i.test(platform);
return isMac ? 'Cmd+Shift+S' : 'Ctrl+Shift+S';
},
},

created() {
this.load();

// Add keyboard shortcut for Cmd+S / Ctrl+S only when this component is focused
this.saveBinding = this.$keys.bindGlobal(['mod+s'], (e) => {
// Add keyboard shortcuts only when this component is focused.
this.saveBinding = this.$keys.bindGlobal(['mod+s', 'mod+shift+s'], (e) => {
// Only handle if this component is currently visible/focused
if (this.$el && this.$el.offsetParent !== null) {
e.preventDefault();
e.stopPropagation();
this.handleSaveShortcut();
this.handleSaveShortcut(e);
}
});
},
Expand Down Expand Up @@ -258,7 +270,7 @@ export default {
},

commit(params = {}) {
let { shouldCommitParent, shouldSaveRoot } = params;
let { shouldCommitParent, shouldSaveRoot, shouldClose = true } = params;

this.clearErrors();

Expand All @@ -277,7 +289,7 @@ export default {
if (shouldCommitParent && this.commitParentField) {
this.$nextTick(() => {
this.commitParentField(params);
this.close();
if (shouldClose) this.close();
});

return;
Expand All @@ -287,7 +299,7 @@ export default {
this.saveRootForm();
}

this.close();
if (shouldClose) this.close();
})
.catch((e) => this.handleAxiosError(e));
},
Expand All @@ -299,18 +311,31 @@ export default {
});
},

// Nested field: saves the current field and any parents.
commitAndCloseAll() {
// Nested field: saves the current field and the blueprint/fieldset.
commitAndSaveAll() {
this.commit({
shouldCommitParent: true,
shouldSaveRoot: true,
});
},

// Nested field: saves the current field and the blueprint/fieldset.
commitAndSaveAll() {
// Nested field: saves and closes only the current stack.
commitAndSaveTopStack() {
this.commit({
shouldCommitParent: true,
shouldSaveRoot: !this.isNestedField,
});
},

softSave() {
if (this.config.isNew) {
this.isNestedField ? this.commitAndSaveTopStack() : this.commitAndSave();
return;
}

this.commit({
shouldCommitParent: this.isNestedField,
shouldSaveRoot: true,
shouldClose: false,
});
},

Expand All @@ -319,7 +344,16 @@ export default {
this.$events.$emit('root-form-save');
},

handleSaveShortcut() {
handleSaveShortcut(event) {
if (event?.key?.toLowerCase() === 's' && event?.shiftKey) {
this.saveAllShortcut();
return;
}

this.softSave();
},

saveAllShortcut() {
this.isNestedField
? this.commitAndSaveAll()
: this.commitAndSave();
Expand Down
Loading