From 585c2a4b39b487c4a763ace4c7d593993c5972ff Mon Sep 17 00:00:00 2001 From: Jonas Rittershofer Date: Sun, 21 Aug 2022 22:58:36 +0200 Subject: [PATCH] Move to NcEmptyContent Signed-off-by: Jonas Rittershofer --- css/icons.scss | 55 ------------------- img/clone.svg | 1 - img/drag-handle.svg | 1 - img/share.svg | 1 - src/Forms.vue | 37 ++++++++----- src/components/EmptyContent.vue | 78 --------------------------- src/components/Questions/Question.vue | 27 +++++++--- src/components/Results/Submission.vue | 7 ++- src/views/Create.vue | 27 ++++++---- src/views/Results.vue | 49 ++++++++++++----- src/views/Submit.vue | 35 ++++++++---- 11 files changed, 127 insertions(+), 191 deletions(-) delete mode 100644 css/icons.scss delete mode 100644 img/clone.svg delete mode 100644 img/drag-handle.svg delete mode 100644 img/share.svg delete mode 100644 src/components/EmptyContent.vue diff --git a/css/icons.scss b/css/icons.scss deleted file mode 100644 index 0db61f282..000000000 --- a/css/icons.scss +++ /dev/null @@ -1,55 +0,0 @@ - -/** - * @copyright Copyright (c) 2020 John Molakvoæ - * - * @author John Molakvoæ - * - * @license AGPL-3.0-or-later - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -// Icon definitions -@include icon-black-white('forms', 'forms', 3); -@include icon-black-white('clone', 'forms', 1); -@include icon-black-white('drag-handle', 'forms', 1); - -.icon-yes { - @include icon-color('checkmark', 'actions', $color-success, 1, true); -} - -.icon-share-primary { - @include icon-color('share', 'actions', $color-primary-text, 1, true); -} - -.icon-comment-yes { - @include icon-color('comment', 'actions', $color-success, 1, true); -} - -.icon-comment-no { - @include icon-color('comment', 'actions', $color-error, 1, true); -} - -.icon-no { - @include icon-color('close', 'actions', $color-error, 1, true); -} - -.icon-maybe { - @include icon-color('maybe-vote-variant', 'forms', $color-warning); -} - -.icon-add-primary { - background-image: url(icon-color-path('add', 'actions', $color-primary-text, 1, true)); -} diff --git a/img/clone.svg b/img/clone.svg deleted file mode 100644 index 469fd1beb..000000000 --- a/img/clone.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/img/drag-handle.svg b/img/drag-handle.svg deleted file mode 100644 index 1d5d56933..000000000 --- a/img/drag-handle.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/img/share.svg b/img/share.svg deleted file mode 100644 index dec6a3817..000000000 --- a/img/share.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Forms.vue b/src/Forms.vue index 7e272181d..602977f07 100644 --- a/src/Forms.vue +++ b/src/Forms.vue @@ -55,27 +55,36 @@ - - {{ t('forms', 'Loading forms …') }} - - - {{ t('forms', 'No forms created yet') }} + + + + + + - + - - {{ t('forms', 'Select a form or create a new one') }} - {{ t('forms', 'Please select a form') }} + + - + @@ -105,12 +114,14 @@ import NcAppNavigationCaption from '@nextcloud/vue/dist/Components/NcAppNavigati import NcAppNavigationNew from '@nextcloud/vue/dist/Components/NcAppNavigationNew' import NcButton from '@nextcloud/vue/dist/Components/NcButton' import NcContent from '@nextcloud/vue/dist/Components/NcContent' +import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent' +import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon' import isMobile from '@nextcloud/vue/dist/Mixins/isMobile' import IconPlus from 'vue-material-design-icons/Plus' +import FormsIcon from './components/Icons/FormsIcon.vue' import AppNavigationForm from './components/AppNavigationForm.vue' -import EmptyContent from './components/EmptyContent.vue' import PermissionTypes from './mixins/PermissionTypes.js' import OcsResponse2Data from './utils/OcsResponse2Data.js' import logger from './utils/Logger.js' @@ -120,7 +131,7 @@ export default { components: { AppNavigationForm, - EmptyContent, + FormsIcon, IconPlus, NcAppContent, NcAppNavigation, @@ -128,6 +139,8 @@ export default { NcAppNavigationNew, NcButton, NcContent, + NcEmptyContent, + NcLoadingIcon, }, mixins: [isMobile, PermissionTypes], diff --git a/src/components/EmptyContent.vue b/src/components/EmptyContent.vue deleted file mode 100644 index 48dd13692..000000000 --- a/src/components/EmptyContent.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - diff --git a/src/components/Questions/Question.vue b/src/components/Questions/Question.vue index 4321322ae..079eabbe1 100644 --- a/src/components/Questions/Question.vue +++ b/src/components/Questions/Question.vue @@ -29,9 +29,11 @@
+ :aria-label="t('forms', 'Drag to reorder the questions')"> + +
@@ -49,15 +51,20 @@

+ class="question__header__title__warning" + tabindex="0"> + +
{{ t('forms', 'Required') }} - + + {{ t('forms', 'Delete question') }} @@ -89,6 +96,10 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions' import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton' import NcActionCheckbox from '@nextcloud/vue/dist/Components/NcActionCheckbox' +import IconAlertCircleOutline from 'vue-material-design-icons/AlertCircleOutline' +import IconDelete from 'vue-material-design-icons/Delete' +import IconDragHorizontalVariant from 'vue-material-design-icons/DragHorizontalVariant' + export default { name: 'Question', @@ -97,6 +108,9 @@ export default { }, components: { + IconAlertCircleOutline, + IconDelete, + IconDragHorizontalVariant, NcActions, NcActionButton, NcActionCheckbox, @@ -308,7 +322,8 @@ export default { } &__warning { - padding: 22px; + margin: auto 4px auto 12px; + color: var(--color-error); } &__menu.action-item { diff --git a/src/components/Results/Submission.vue b/src/components/Results/Submission.vue index 83ad21146..df4ee4ee7 100644 --- a/src/components/Results/Submission.vue +++ b/src/components/Results/Submission.vue @@ -25,7 +25,10 @@

{{ submission.userDisplayName }}

- + + {{ t('forms', 'Delete this response') }} @@ -45,6 +48,7 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions' import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton' import moment from '@nextcloud/moment' +import IconDelete from 'vue-material-design-icons/Delete' import Answer from './Answer.vue' @@ -53,6 +57,7 @@ export default { components: { Answer, + IconDelete, NcActions, NcActionButton, }, diff --git a/src/views/Create.vue b/src/views/Create.vue index 3a150cf51..5d8a57669 100644 --- a/src/views/Create.vue +++ b/src/views/Create.vue @@ -24,9 +24,11 @@