From 11afa8140c5706c8ad105e50cef63df83db66e7a Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 14 Nov 2018 16:30:58 +0900 Subject: [Client] Improve alert component --- src/client/app/desktop/views/components/dialog.vue | 168 --------------------- .../app/desktop/views/components/drive.file.vue | 7 +- .../app/desktop/views/components/drive.folder.vue | 7 +- src/client/app/desktop/views/components/drive.vue | 14 +- src/client/app/desktop/views/components/home.vue | 7 +- .../app/desktop/views/components/settings.vue | 6 +- .../desktop/views/pages/deck/deck.user-column.vue | 4 +- .../app/desktop/views/pages/user/user.profile.vue | 2 +- 8 files changed, 16 insertions(+), 199 deletions(-) delete mode 100644 src/client/app/desktop/views/components/dialog.vue (limited to 'src/client/app/desktop/views') diff --git a/src/client/app/desktop/views/components/dialog.vue b/src/client/app/desktop/views/components/dialog.vue deleted file mode 100644 index 2664105bdc..0000000000 --- a/src/client/app/desktop/views/components/dialog.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - diff --git a/src/client/app/desktop/views/components/drive.file.vue b/src/client/app/desktop/views/components/drive.file.vue index 7840d7e748..a643064078 100644 --- a/src/client/app/desktop/views/components/drive.file.vue +++ b/src/client/app/desktop/views/components/drive.file.vue @@ -170,12 +170,9 @@ export default Vue.extend({ copyUrl() { copyToClipboard(this.file.url); - this.$dialog({ + this.$root.alert({ title: this.$t('contextmenu.copied'), - text: this.$t('contextmenu.copied-url-to-clipboard'), - actions: [{ - text: this.$t('@.ok') - }] + text: this.$t('contextmenu.copied-url-to-clipboard') }); }, diff --git a/src/client/app/desktop/views/components/drive.folder.vue b/src/client/app/desktop/views/components/drive.folder.vue index fe9bad2c28..5558f65c3e 100644 --- a/src/client/app/desktop/views/components/drive.folder.vue +++ b/src/client/app/desktop/views/components/drive.folder.vue @@ -155,12 +155,9 @@ export default Vue.extend({ }).catch(err => { switch (err) { case 'detected-circular-definition': - this.$dialog({ + this.$root.alert({ title: this.$t('unable-to-process'), - text: this.$t('circular-reference-detected'), - actions: [{ - text: this.$t('@.ok') - }] + text: this.$t('circular-reference-detected') }); break; default: diff --git a/src/client/app/desktop/views/components/drive.vue b/src/client/app/desktop/views/components/drive.vue index 08dbfd2fa9..c4e9e102d5 100644 --- a/src/client/app/desktop/views/components/drive.vue +++ b/src/client/app/desktop/views/components/drive.vue @@ -313,12 +313,9 @@ export default Vue.extend({ }).catch(err => { switch (err) { case 'detected-circular-definition': - this.$dialog({ + this.$root.alert({ title: this.$t('unable-to-process'), - text: this.$t('circular-reference-detected'), - actions: [{ - text: this.$t('@.ok') - }] + text: this.$t('circular-reference-detected') }); break; default: @@ -343,12 +340,9 @@ export default Vue.extend({ folderId: this.folder ? this.folder.id : undefined }); - this.$dialog({ + this.$root.alert({ title: this.$t('url-upload-requested'), - text: this.$t('may-take-time'), - actions: [{ - text: this.$t('@.ok') - }] + text: this.$t('may-take-time') }); }); }, diff --git a/src/client/app/desktop/views/components/home.vue b/src/client/app/desktop/views/components/home.vue index 500773ee9f..492edc67d6 100644 --- a/src/client/app/desktop/views/components/home.vue +++ b/src/client/app/desktop/views/components/home.vue @@ -186,12 +186,9 @@ export default Vue.extend({ methods: { hint() { - this.$dialog({ + this.$root.alert({ title: this.$t('@.customization-tips.title'), - text: this.$t('@.customization-tips.paragraph'), - actions: [{ - text: this.$t('@.customization-tips.gotit') - }] + text: this.$t('@.customization-tips.paragraph') }); }, diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue index d652c2def1..99e8064cea 100644 --- a/src/client/app/desktop/views/components/settings.vue +++ b/src/client/app/desktop/views/components/settings.vue @@ -549,12 +549,12 @@ export default Vue.extend({ this.checkingForUpdate = false; this.latestVersion = newer; if (newer == null) { - this.$dialog({ + this.$root.alert({ title: this.$t('no-updates'), text: this.$t('no-updates-desc') }); } else { - this.$dialog({ + this.$root.alert({ title: this.$t('update-available'), text: this.$t('update-available-desc') }); @@ -563,7 +563,7 @@ export default Vue.extend({ }, clean() { localStorage.clear(); - this.$dialog({ + this.$root.alert({ title: this.$t('cache-cleared'), text: this.$t('cache-cleared-desc') }); diff --git a/src/client/app/desktop/views/pages/deck/deck.user-column.vue b/src/client/app/desktop/views/pages/deck/deck.user-column.vue index 27da5427b9..8336828c0c 100644 --- a/src/client/app/desktop/views/pages/deck/deck.user-column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.user-column.vue @@ -87,7 +87,6 @@ import XNotes from './deck.notes.vue'; import XNote from '../../components/note.vue'; import Menu from '../../../../common/views/components/menu.vue'; import MkUserListsWindow from '../../components/user-lists-window.vue'; -import Ok from '../../../../common/views/components/ok.vue'; import { concat } from '../../../../../../prelude/array'; import * as ApexCharts from 'apexcharts'; @@ -308,7 +307,8 @@ export default Vue.extend({ listId: list.id, userId: this.user.id }); - this.$root.new(Ok); + // TODO + //this.$root.new(Ok); }); } }]; diff --git a/src/client/app/desktop/views/pages/user/user.profile.vue b/src/client/app/desktop/views/pages/user/user.profile.vue index e369d724e8..63bb60bcb3 100644 --- a/src/client/app/desktop/views/pages/user/user.profile.vue +++ b/src/client/app/desktop/views/pages/user/user.profile.vue @@ -101,7 +101,7 @@ export default Vue.extend({ listId: list.id, userId: this.user.id }); - this.$dialog({ + this.$root.alert({ title: 'Done!', text: this.$t('list-pushed').replace('{user}', this.user.name).replace('{list}', list.title) }); -- cgit v1.3.1-freya