From 9a91aaf47ce7f9c92d7763b1f26e86b22a121817 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 12 Jan 2023 15:58:59 +0100 Subject: [PATCH] Apply prettier to whole project --- client/.babelrc | 17 +- client/.eslintrc.js | 114 +- client/.postcssrc.js | 12 +- client/build/build.js | 68 +- client/build/check-versions.js | 51 +- client/build/utils.js | 21 +- client/build/webpack.base.conf.js | 15 +- client/build/webpack.dev.conf.js | 13 +- client/build/webpack.prod.conf.js | 19 +- client/config/dev.env.js | 8 +- client/config/index.js | 13 +- client/config/prod-dha.env.js | 12 +- client/config/prod-dhf.env.js | 12 +- client/config/prod-my-kv.env.js | 12 +- client/config/prod.env.js | 17 +- client/cypress.e2e.ts | 29 +- client/cypress.frontend.ts | 29 +- client/index.html | 72 +- client/jest.config.js | 30 +- client/mock.js | 21 +- client/src/@types/graphql.d.ts | 4 +- client/src/@types/index.ts | 6 +- client/src/App.vue | 174 +- client/src/components/AddContentButton.vue | 152 +- client/src/components/AddContentElement.vue | 49 +- client/src/components/AddWidget.vue | 109 +- .../components/AssignmentWithSubmissions.vue | 210 +- client/src/components/BackLink.vue | 106 +- client/src/components/Chapter.vue | 344 +- client/src/components/ColorChooser.vue | 124 +- client/src/components/ContentBlock.vue | 631 ++- client/src/components/FullscreenImage.vue | 45 +- .../src/components/FullscreenInfographic.vue | 53 +- client/src/components/FullscreenVideo.vue | 48 +- client/src/components/HeaderBar.vue | 177 +- client/src/components/HelpfulTooltip.vue | 99 +- client/src/components/LoadingButton.vue | 74 +- client/src/components/LogoutWidget.vue | 48 +- client/src/components/MobileHeader.vue | 78 +- client/src/components/Modal.vue | 285 +- client/src/components/ModalInput.vue | 43 +- client/src/components/MoreOptionsWidget.vue | 86 +- client/src/components/Radiobutton.vue | 42 +- client/src/components/ReadOnlyBanner.vue | 140 +- client/src/components/ScrollUp.vue | 105 +- client/src/components/SectionBlock.vue | 127 +- client/src/components/StudentSubmission.vue | 117 +- .../components/StudentSubmissionDocument.vue | 50 +- client/src/components/UserMetaWidget.vue | 63 +- client/src/components/UserWidget.vue | 107 +- .../book-navigation/ContentNavigation.vue | 271 +- .../book-navigation/NavigationSidebar.vue | 163 +- .../book-navigation/SubNavigationItem.vue | 64 +- .../book-navigation/TopicNavigation.vue | 70 +- .../content-block-form/AddContentLink.vue | 56 +- .../content-block-form/ContentBlockForm.vue | 567 ++- .../content-block-form/ContentElement.vue | 598 +-- .../ContentElementActions.vue | 138 +- .../content-block-form/ContentFormSection.vue | 130 +- .../content-block-form/ContentsForm.vue | 240 +- .../EditContentBlockWizard.vue | 112 +- .../NewContentBlockWizard.vue | 82 +- .../components/content-block-form/helpers.js | 49 +- .../content-blocks/CmsDocumentBlock.vue | 87 +- .../content-blocks/ContentComponent.vue | 177 +- .../components/content-blocks/ContentList.vue | 27 +- .../content-blocks/ContentListBlock.vue | 57 +- .../content-blocks/DocumentBlock.vue | 110 +- .../content-blocks/GeniallyBlock.vue | 76 +- .../components/content-blocks/ImageBlock.vue | 38 +- .../content-blocks/ImageUrlBlock.vue | 36 +- .../content-blocks/InfogramBlock.vue | 114 +- .../components/content-blocks/Instruction.vue | 72 +- .../content-blocks/InstrumentWidget.vue | 36 +- .../components/content-blocks/LinkBlock.vue | 79 +- .../content-blocks/ModuleRoomSlug.vue | 19 +- .../content-blocks/SectionTitleBlock.vue | 23 +- .../components/content-blocks/Solution.vue | 141 +- .../content-blocks/SubtitleBlock.vue | 38 +- .../components/content-blocks/SurveyBlock.vue | 24 +- client/src/components/content-blocks/Task.vue | 25 +- .../components/content-blocks/TextBlock.vue | 48 +- .../content-blocks/ThinglinkBlock.vue | 76 +- .../components/content-blocks/VideoBlock.vue | 67 +- .../content-blocks/assignment/Assignment.vue | 427 +- .../assignment/FinalSubmission.vue | 165 +- .../content-blocks/assignment/SpellCheck.vue | 94 +- .../assignment/SubmissionForm.vue | 190 +- .../assignment/SubmissionInput.vue | 90 +- .../content-forms/AssignmentForm.vue | 66 +- .../content-forms/ChooserElement.vue | 104 +- .../ContentBlockElementChooserWidget.vue | 337 +- .../components/content-forms/DocumentForm.vue | 191 +- .../components/content-forms/ImageForm.vue | 221 +- .../src/components/content-forms/LinkForm.vue | 28 +- .../components/content-forms/SubtitleForm.vue | 50 +- .../src/components/content-forms/TextForm.vue | 46 +- .../content-forms/TextFormWithHelpText.vue | 69 +- .../src/components/content-forms/TipTap.vue | 238 +- .../components/content-forms/VideoForm.vue | 124 +- client/src/components/icons/AddIcon.vue | 6 +- client/src/components/icons/AddNoteIcon.vue | 16 +- client/src/components/icons/AddPointer.vue | 6 +- .../src/components/icons/ArrowThinBottom.vue | 5 +- client/src/components/icons/ArrowThinDown.vue | 6 +- client/src/components/icons/ArrowThinTop.vue | 8 +- client/src/components/icons/ArrowThinUp.vue | 9 +- client/src/components/icons/ArrowUp.vue | 7 +- client/src/components/icons/BookmarkIcon.vue | 38 +- client/src/components/icons/BulbIcon.vue | 18 +- client/src/components/icons/Cards.vue | 6 +- client/src/components/icons/ChevronDown.vue | 5 +- client/src/components/icons/ChevronLeft.vue | 12 +- client/src/components/icons/ChevronRight.vue | 6 +- client/src/components/icons/ChevronUp.vue | 5 +- client/src/components/icons/CircleIcon.vue | 11 +- client/src/components/icons/ClosedEyeIcon.vue | 6 +- client/src/components/icons/CrossIcon.vue | 16 +- client/src/components/icons/DefaultAvatar.vue | 80 +- client/src/components/icons/DocumentIcon.vue | 12 +- .../icons/DocumentWithLinesIcon.vue | 15 +- client/src/components/icons/EhbLogo.vue | 187 +- client/src/components/icons/Ellipses.vue | 23 +- client/src/components/icons/EyeIcon.vue | 6 +- client/src/components/icons/Group.vue | 6 +- client/src/components/icons/Hamburger.vue | 8 +- client/src/components/icons/HepLogo.vue | 33 +- .../src/components/icons/HepLogoNoClaim.vue | 20 +- client/src/components/icons/ImageIcon.vue | 7 +- client/src/components/icons/InfoIcon.vue | 12 +- client/src/components/icons/LinkIcon.vue | 7 +- client/src/components/icons/LoadingIcon.vue | 7 +- client/src/components/icons/Logo.vue | 21 +- client/src/components/icons/NoteIcon.vue | 16 +- client/src/components/icons/PenIcon.vue | 5 +- client/src/components/icons/Play.vue | 10 +- client/src/components/icons/PlusIcon.vue | 5 +- client/src/components/icons/ShareIcon.vue | 6 +- .../src/components/icons/SpeechBubbleIcon.vue | 9 +- client/src/components/icons/TextIcon.vue | 7 +- client/src/components/icons/Tick.vue | 6 +- .../src/components/icons/TickCircleIcon.vue | 5 +- client/src/components/icons/TitleIcon.vue | 8 +- client/src/components/icons/TrashIcon.vue | 5 +- client/src/components/icons/UserIcon.vue | 6 +- client/src/components/icons/VideoIcon.vue | 7 +- .../illustrations/ContentsIllustration.vue | 106 +- .../illustrations/HelloIllustration.vue | 41 +- .../illustrations/HelloMyDHAIllustration.vue | 6 +- .../illustrations/HelloMyDHFIllustration.vue | 6 +- .../illustrations/HelloMyKVIllustration.vue | 6 +- .../illustrations/PortfolioIllustration.vue | 118 +- .../illustrations/RoomsIllustration.vue | 140 +- .../components/instruments/FilterEntry.vue | 274 +- .../components/instruments/FilterGroup.vue | 112 +- .../instruments/InstrumentEntry.vue | 123 +- .../instruments/InstrumentFilter.vue | 48 +- client/src/components/modals/Confirm.vue | 97 +- client/src/components/modals/index.js | 16 +- client/src/components/modules/Module.vue | 206 +- .../components/modules/ModuleNavigation.vue | 325 +- .../modules/ModuleSubNavigation.vue | 155 +- .../src/components/modules/ModuleTeaser.vue | 125 +- .../components/modules/SnapshotCreated.vue | 133 +- .../src/components/modules/SnapshotHeader.vue | 246 +- .../components/modules/SnapshotListItem.vue | 384 +- .../src/components/modules/SnapshotMenu.vue | 167 +- .../components/modules/SnapshotTeamMenu.vue | 56 +- client/src/components/news/NewsTeaser.vue | 23 +- client/src/components/news/NewsTeaserOld.vue | 77 +- client/src/components/news/NewsTeasers.vue | 63 +- .../src/components/notes/BookmarkActions.vue | 113 +- .../src/components/notes/EditNoteWizard.vue | 70 +- client/src/components/notes/NewNoteWizard.vue | 98 +- client/src/components/notes/NoteForm.vue | 53 +- .../objective-groups/NewObjectiveWizard.vue | 114 +- .../components/objective-groups/Objective.vue | 174 +- .../objective-groups/ObjectiveForm.vue | 39 +- .../objective-groups/ObjectiveGroup.vue | 107 +- .../objective-groups/ObjectiveGroups.vue | 95 +- client/src/components/page-form/PageForm.vue | 92 +- .../components/page-form/PageFormInput.vue | 84 +- .../components/portfolio/AddProjectEntry.vue | 63 +- .../portfolio/CreateProjectButton.vue | 30 +- .../src/components/portfolio/EditProject.vue | 42 +- .../portfolio/EditProjectEntryWizard.vue | 80 +- .../portfolio/NewProjectEntryWizard.vue | 107 +- .../src/components/portfolio/OwnerWidget.vue | 59 +- .../portfolio/PortfolioOnboarding.vue | 70 +- .../components/portfolio/ProjectActions.vue | 110 +- .../src/components/portfolio/ProjectEntry.vue | 222 +- .../components/portfolio/ProjectEntryForm.vue | 161 +- .../src/components/portfolio/ProjectForm.vue | 86 +- .../src/components/portfolio/ProjectList.vue | 32 +- .../components/portfolio/ProjectListItem.vue | 107 +- .../components/portfolio/ProjectWidget.vue | 157 +- client/src/components/portfolio/ShareLink.vue | 46 +- .../src/components/profile/ActivityEntry.vue | 87 +- .../src/components/profile/ActivityFilter.vue | 59 +- client/src/components/profile/Avatar.vue | 222 +- .../components/profile/AvatarUploadForm.vue | 40 +- .../components/profile/ContentBookmark.vue | 66 +- .../components/profile/DeactivatePerson.vue | 142 +- .../src/components/profile/EditGroupName.vue | 32 +- .../src/components/profile/EditNameWizard.vue | 64 +- .../components/profile/EditTeamNameWizard.vue | 108 +- client/src/components/profile/GroupList.vue | 246 +- .../components/profile/InstrumentActivity.vue | 152 +- client/src/components/profile/JoinForm.vue | 89 +- .../src/components/profile/ModuleActivity.vue | 185 +- client/src/components/profile/Profile.vue | 127 +- .../src/components/profile/ProfileSidebar.vue | 237 +- .../src/components/profile/ProfileWidget.vue | 76 +- client/src/components/profile/ShowCode.vue | 58 +- client/src/components/rooms/AddRoom.vue | 12 +- .../components/rooms/AddRoomEntryButton.vue | 90 +- .../src/components/rooms/ChangeVisibility.vue | 110 +- client/src/components/rooms/Comment.vue | 89 +- client/src/components/rooms/CommentInput.vue | 68 +- client/src/components/rooms/EditRoom.vue | 39 +- .../src/components/rooms/EntryCountWidget.vue | 75 +- client/src/components/rooms/MoreActions.vue | 78 +- client/src/components/rooms/RoomActions.vue | 217 +- client/src/components/rooms/RoomEntry.vue | 212 +- .../src/components/rooms/RoomEntryActions.vue | 185 +- client/src/components/rooms/RoomForm.vue | 144 +- .../src/components/rooms/RoomGroupWidget.vue | 42 +- .../components/rooms/RoomVisibilityWidget.vue | 54 +- client/src/components/rooms/RoomWidget.vue | 164 +- .../src/components/rooms/RoomsOnboarding.vue | 78 +- .../room-entries/EditRoomEntryWizard.vue | 76 +- .../school-class/ClassSelectionWidget.vue | 177 +- .../components/school-class/CurrentClass.vue | 31 +- .../school-class/EditClassNameWizard.vue | 119 +- .../snapshots/EditSnapshotTitleWizard.vue | 51 +- .../components/toggle-menu/ToggleEditing.vue | 88 +- .../toggle-menu/ToggleSolutionsForModule.vue | 121 +- client/src/components/ui/BaseInput.vue | 53 +- .../components/ui/ButtonWithIconAndText.vue | 101 +- client/src/components/ui/Checkbox.vue | 42 +- client/src/components/ui/EmojiBar.vue | 45 +- client/src/components/ui/InputWithLabel.vue | 52 +- client/src/components/ui/PopoverLink.vue | 86 +- client/src/components/ui/Toggle.vue | 152 +- client/src/components/ui/WidgetFooter.vue | 34 +- client/src/components/ui/WidgetPopover.vue | 40 +- .../components/ui/file-upload/FileUpload.vue | 37 +- .../ui/file-upload/SimpleFileUpload.vue | 95 +- .../SimpleFileUploadHiddenInput.vue | 25 +- .../ui/file-upload/SimpleFileUploadIcon.vue | 20 +- .../SimpleFileUploadIconAndText.vue | 13 +- .../file-upload/SimpleFileUploadWithIcon.vue | 68 +- .../src/components/ui/form-element-icons.js | 28 +- .../components/validation/ValidatedInput.vue | 130 +- client/src/components/videos/SrfEmbed.vue | 26 +- client/src/components/videos/VimeoEmbed.vue | 26 +- client/src/components/videos/YoutubeEmbed.vue | 26 +- .../visibility/VisibilityAction.vue | 120 +- client/src/consts/types.js | 8 +- client/src/directives/auto-grow.js | 4 +- client/src/directives/click-outside.js | 4 +- client/src/filters/date-filter.js | 4 +- client/src/graphql/cache-operations.js | 6 +- client/src/graphql/cache.js | 77 +- client/src/graphql/client.js | 45 +- .../src/graphql/gql/fragments/moduleParts.gql | 4 +- .../gql/local/mutations/helloEmail.gql | 2 +- .../graphql/gql/local/mutations/scrollTo.gql | 2 +- .../local/mutations/setInstrumentFilter.gql | 2 +- .../gql/local/mutations/toggleSidebar.gql | 2 +- .../graphql/gql/mutations/addContentBlock.gql | 1 - .../graphql/gql/mutations/addObjective.gql | 3 +- .../src/graphql/gql/mutations/addProject.gql | 4 +- .../src/graphql/gql/mutations/createClass.gql | 4 +- .../src/graphql/gql/mutations/createTeam.gql | 4 +- .../graphql/gql/mutations/deleteProject.gql | 1 - .../graphql/gql/mutations/redeemCoupon.gql | 2 +- .../graphql/gql/mutations/rooms/addRoom.gql | 4 +- .../gql/mutations/rooms/addRoomEntry.gql | 4 +- .../gql/mutations/rooms/updateRoom.gql | 4 +- .../gql/mutations/rooms/updateRoomEntry.gql | 2 +- .../gql/mutations/snapshots/delete.gql | 14 +- .../gql/mutations/snapshots/update.gql | 4 +- .../src/graphql/gql/mutations/spellCheck.gql | 1 - .../graphql/gql/mutations/updateAnswer.gql | 13 +- .../mutations/updateAssignmentMutation.gql | 2 +- .../updateAssignmentMutationWithSuccess.gql | 2 +- .../gql/mutations/updateChapterVisibility.gql | 1 - .../graphql/gql/mutations/updateFeedback.gql | 4 +- .../gql/mutations/updateFeedbackWithText.gql | 4 +- .../updateObjectiveGroupVisibility.gql | 1 - .../gql/mutations/updateObjectiveProgress.gql | 2 +- .../mutations/updateObjectiveVisibility.gql | 1 - .../graphql/gql/mutations/updateProject.gql | 2 +- .../gql/mutations/updateProjectEntry.gql | 2 +- .../graphql/gql/public-client/betaLogin.gql | 1 - .../graphql/gql/queries/allTopicsQuery.gql | 16 +- .../graphql/gql/queries/instrumentQuery.gql | 2 +- .../gql/queries/instrumentQueryById.gql | 2 +- .../graphql/gql/queries/modules/details.gql | 2 +- .../src/graphql/gql/queries/projectQuery.gql | 2 +- client/src/graphql/gql/queries/topicQuery.gql | 2 +- client/src/graphql/immutable-operations.ts | 35 +- client/src/graphql/queries.js | 4 +- client/src/graphql/resolvers.js | 24 +- client/src/graphql/typedefs.js | 2 +- client/src/helpers/add-team.js | 2 +- client/src/helpers/app-flavor.constants.ts | 11 +- client/src/helpers/app-flavor.ts | 6 +- client/src/helpers/date-format.js | 2 +- client/src/helpers/instrumentType.js | 6 +- client/src/helpers/new-note-mutation.js | 128 +- client/src/helpers/sorting.js | 2 +- client/src/helpers/survey-solutions.js | 6 +- client/src/helpers/teaser.js | 2 +- client/src/helpers/text.js | 19 +- client/src/helpers/types.ts | 2 +- .../update-content-bookmark-mutation.js | 48 +- client/src/helpers/uploadcare.js | 14 +- client/src/helpers/urls.js | 4 +- client/src/helpers/visibility.js | 47 +- client/src/layouts/BlankLayout.vue | 8 +- client/src/layouts/DefaultFooter.vue | 215 +- client/src/layouts/DefaultLayout.vue | 88 +- client/src/layouts/FullScreenLayout.vue | 61 +- client/src/layouts/PublicLayout.vue | 102 +- client/src/layouts/SimpleFooter.vue | 56 +- client/src/layouts/SimpleLayout.vue | 155 +- client/src/layouts/SplitLayout.vue | 276 +- client/src/main.js | 51 +- client/src/mixins/add-school-class.js | 19 +- client/src/mixins/edit-module.js | 4 +- client/src/mixins/logout.js | 26 +- client/src/mixins/me.js | 10 +- client/src/mixins/news.js | 6 +- client/src/mixins/open-sidebar.js | 9 +- client/src/mixins/room.js | 13 +- client/src/mixins/selected-class.js | 28 +- client/src/mixins/sidebar.js | 14 +- .../src/mixins/update-project-share-state.js | 23 +- client/src/mixins/update-selected-class.js | 81 +- client/src/pages/activity.vue | 97 +- client/src/pages/article.vue | 213 +- client/src/pages/beta-login.vue | 129 +- client/src/pages/createClass.vue | 95 +- client/src/pages/createContentBlock.vue | 137 +- client/src/pages/editContentBlock.vue | 150 +- client/src/pages/hello.vue | 266 +- client/src/pages/index.vue | 50 +- client/src/pages/instrument.vue | 124 +- client/src/pages/instrumentOverview.vue | 156 +- client/src/pages/joinClass.vue | 100 +- client/src/pages/license-activation.vue | 175 +- client/src/pages/login-error.vue | 55 +- client/src/pages/me/createTeam.vue | 88 +- client/src/pages/me/joinTeam.vue | 88 +- client/src/pages/me/myTeam.vue | 132 +- client/src/pages/me/showSchoolClassCode.vue | 19 +- client/src/pages/me/showTeamCode.vue | 19 +- client/src/pages/module/module-base.vue | 74 +- client/src/pages/module/module.vue | 405 +- client/src/pages/module/moduleRoom.vue | 97 +- client/src/pages/module/moduleSettings.vue | 41 +- client/src/pages/module/moduleVisibility.vue | 167 +- client/src/pages/myClass.vue | 202 +- client/src/pages/news.vue | 34 +- client/src/pages/oldClasses.vue | 79 +- client/src/pages/onboarding.vue | 296 +- client/src/pages/onboarding/start.vue | 20 +- client/src/pages/onboarding/step1.vue | 15 +- client/src/pages/onboarding/step2.vue | 12 +- client/src/pages/onboarding/step3.vue | 16 +- client/src/pages/p404.vue | 19 +- client/src/pages/portfolio/editProject.vue | 55 +- client/src/pages/portfolio/newProject.vue | 79 +- client/src/pages/portfolio/portfolio.vue | 143 +- client/src/pages/portfolio/project.vue | 337 +- client/src/pages/profile.vue | 22 +- client/src/pages/rooms/editRoom.vue | 69 +- client/src/pages/rooms/editRoomEntry.vue | 145 +- client/src/pages/rooms/newRoom.vue | 81 +- client/src/pages/rooms/newRoomEntry.vue | 135 +- client/src/pages/rooms/room.vue | 119 +- client/src/pages/rooms/rooms.vue | 184 +- client/src/pages/snapshot/snapshot.vue | 99 +- client/src/pages/snapshot/snapshots.vue | 122 +- client/src/pages/start.vue | 400 +- client/src/pages/studentSubmission.vue | 424 +- client/src/pages/styleguide.vue | 99 +- client/src/pages/submissions.vue | 95 +- client/src/pages/survey.vue | 423 +- client/src/pages/test.vue | 86 +- client/src/pages/topic-page.vue | 318 +- client/src/plugins/edges.js | 4 +- client/src/plugins/flavor.js | 2 +- client/src/plugins/modal.ts | 35 +- client/src/router/auth.routes.js | 20 +- client/src/router/guards.ts | 2 +- client/src/router/index.js | 38 +- client/src/router/me.routes.js | 53 +- client/src/router/module.routes.js | 18 +- client/src/router/onboarding.routes.js | 10 +- client/src/router/portfolio.routes.js | 16 +- client/src/router/room.routes.js | 32 +- client/src/router/router.d.ts | 1 - client/src/shims-vue.d.ts | 2 +- client/src/store/index.js | 88 +- client/src/styles/_accessability.scss | 1 - client/src/styles/_buttons.scss | 6 +- client/src/styles/_default-layout.scss | 9 +- client/src/styles/_forms.scss | 2 - client/src/styles/_functions.scss | 2 +- client/src/styles/_mixins.scss | 10 +- client/src/styles/_nested-content-lists.scss | 3 +- client/src/styles/_objective-group.scss | 1 - client/src/styles/_password_forms.scss | 1 - client/src/styles/_reset.scss | 119 +- client/src/styles/_room.scss | 8 +- client/src/styles/_simple-list.scss | 4 +- client/src/styles/_student-submission.scss | 2 +- client/src/styles/_survey.scss | 15 +- client/src/styles/_typography.scss | 25 +- client/src/styles/_uploadcare_overwrite.scss | 2 +- client/src/styles/_variables.scss | 40 +- client/src/styles/_visibility.scss | 1 - client/src/styles/_widget-popover.scss | 8 +- client/src/styles/main.scss | 52 +- client/src/styles/survey.defaultV2.css | 3436 ++++++++++++++++- client/src/styles/survey.modern.css | 392 +- client/src/styles/survey.reset.css | 20 +- client/src/styles/themes/_my-dha.scss | 36 +- client/src/styles/themes/_my-dhf.scss | 36 +- client/src/styles/themes/_my-kv.scss | 36 +- client/src/styles/themes/_whitelabel.scss | 36 +- client/src/survey.config.js | 298 +- client/tests/unit/.eslintrc.js | 6 +- client/tests/unit/checkbox.spec.js | 14 +- .../tests/unit/class-selection-widget.spec.js | 111 +- client/tests/unit/comment-input.spec.js | 6 +- client/tests/unit/module-navigation.spec.js | 23 +- client/tests/unit/text-form.spec.js | 8 +- client/tests/unit/toggle.spec.js | 7 +- client/tsconfig.json | 4 +- 443 files changed, 19003 insertions(+), 17334 deletions(-) diff --git a/client/.babelrc b/client/.babelrc index 46e6f10b..3d4e3855 100644 --- a/client/.babelrc +++ b/client/.babelrc @@ -1,14 +1,15 @@ { "presets": [ "@babel/preset-typescript", - ["@babel/preset-env", { - "useBuiltIns": false, - "targets": { - "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] + [ + "@babel/preset-env", + { + "useBuiltIns": false, + "targets": { + "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] + } } - }] + ] ], - "plugins": [ - "@babel/plugin-transform-runtime" - ] + "plugins": ["@babel/plugin-transform-runtime"] } diff --git a/client/.eslintrc.js b/client/.eslintrc.js index 285fb91b..5f0f3142 100644 --- a/client/.eslintrc.js +++ b/client/.eslintrc.js @@ -10,7 +10,7 @@ module.exports = { browser: true, }, globals: { - process: "readonly" + process: 'readonly', }, extends: [ // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention @@ -21,69 +21,77 @@ module.exports = { 'plugin:@typescript-eslint/eslint-recommended', ], // required to lint *.vue files - plugins: [ - 'vue', - '@typescript-eslint' + plugins: ['vue', '@typescript-eslint'], + overrides: [ + { + files: ['*.ts', '*.tsx'], + rules: { + 'no-unused-vars': 'off', + }, + }, ], - overrides: [{ - files: ['*.ts','*.tsx'], - rules: { - 'no-unused-vars': 'off' - } - }], // add your custom rules here rules: { // allow async-await 'generator-star-spacing': 'off', // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'indent': 'off', - 'semi': ['error', 'always'], + indent: 'off', + semi: ['error', 'always'], 'space-before-function-paren': 'off', 'comma-dangle': 'off', // vue rules 'vue/require-prop-types': 'off', //todo: should we do this? 'vue/require-default-prop': 'off', //todo: should we do this? - 'vue/attributes-order': ['error', { - 'order': [ - 'OTHER_ATTR', - 'DEFINITION', - 'LIST_RENDERING', - 'CONDITIONALS', - 'RENDER_MODIFIERS', - 'GLOBAL', - 'UNIQUE', - 'TWO_WAY_BINDING', - 'OTHER_DIRECTIVES', - 'EVENTS', - 'CONTENT' - ] - }], - "vue/multi-word-component-names": ["off", { - "ignores": [] - }], - 'vue/order-in-components': ['error', { - 'order': [ - 'el', - 'name', - 'parent', - 'functional', - ['delimiters', 'comments'], - ['props', 'propsData'], - 'mixins', - ['components', 'directives', 'filters'], - 'data', - 'extends', - 'inheritAttrs', - 'model', - 'computed', - 'watch', - 'LIFECYCLE_HOOKS', - 'methods', - ['template', 'render'], - 'renderError' - ] - }] - } + 'vue/attributes-order': [ + 'error', + { + order: [ + 'OTHER_ATTR', + 'DEFINITION', + 'LIST_RENDERING', + 'CONDITIONALS', + 'RENDER_MODIFIERS', + 'GLOBAL', + 'UNIQUE', + 'TWO_WAY_BINDING', + 'OTHER_DIRECTIVES', + 'EVENTS', + 'CONTENT', + ], + }, + ], + 'vue/multi-word-component-names': [ + 'off', + { + ignores: [], + }, + ], + 'vue/order-in-components': [ + 'error', + { + order: [ + 'el', + 'name', + 'parent', + 'functional', + ['delimiters', 'comments'], + ['props', 'propsData'], + 'mixins', + ['components', 'directives', 'filters'], + 'data', + 'extends', + 'inheritAttrs', + 'model', + 'computed', + 'watch', + 'LIFECYCLE_HOOKS', + 'methods', + ['template', 'render'], + 'renderError', + ], + }, + ], + }, }; diff --git a/client/.postcssrc.js b/client/.postcssrc.js index eee3e92d..39ebf318 100644 --- a/client/.postcssrc.js +++ b/client/.postcssrc.js @@ -1,10 +1,10 @@ // https://github.com/michael-ciniawsky/postcss-load-config module.exports = { - "plugins": { - "postcss-import": {}, - "postcss-url": {}, + plugins: { + 'postcss-import': {}, + 'postcss-url': {}, // to edit target browsers: use "browserslist" field in package.json - "autoprefixer": {} - } -} + autoprefixer: {}, + }, +}; diff --git a/client/build/build.js b/client/build/build.js index 0d5f51ef..78ba7f23 100644 --- a/client/build/build.js +++ b/client/build/build.js @@ -1,41 +1,45 @@ -'use strict' -require('./check-versions')() +'use strict'; +require('./check-versions')(); -process.env.NODE_ENV = 'production' +process.env.NODE_ENV = 'production'; -const ora = require('ora') -const rm = require('rimraf') -const path = require('path') -const chalk = require('chalk') -const webpack = require('webpack') -const config = require('../config') -const webpackConfig = require('./webpack.prod.conf') +const ora = require('ora'); +const rm = require('rimraf'); +const path = require('path'); +const chalk = require('chalk'); +const webpack = require('webpack'); +const config = require('../config'); +const webpackConfig = require('./webpack.prod.conf'); -const spinner = ora('building for production...') -spinner.start() +const spinner = ora('building for production...'); +spinner.start(); -rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { - if (err) throw err +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), (err) => { + if (err) throw err; webpack(webpackConfig, (err, stats) => { - spinner.succeed() - if (err) throw err - process.stdout.write(stats.toString({ - colors: true, - modules: false, - children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. - chunks: false, - chunkModules: false - }) + '\n\n') + spinner.succeed(); + if (err) throw err; + process.stdout.write( + stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false, + }) + '\n\n' + ); if (stats.hasErrors()) { - console.log(chalk.red(' Build failed with errors.\n')) - process.exit(1) + console.log(chalk.red(' Build failed with errors.\n')); + process.exit(1); } - console.log(chalk.cyan(' Build complete.\n')) - console.log(chalk.yellow( - ' Tip: built files are meant to be served over an HTTP server.\n' + - ' Opening index.html over file:// won\'t work.\n' - )) - }) -}) + console.log(chalk.cyan(' Build complete.\n')); + console.log( + chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + " Opening index.html over file:// won't work.\n" + ) + ); + }); +}); diff --git a/client/build/check-versions.js b/client/build/check-versions.js index 3ef972a0..3999006d 100644 --- a/client/build/check-versions.js +++ b/client/build/check-versions.js @@ -1,54 +1,53 @@ -'use strict' -const chalk = require('chalk') -const semver = require('semver') -const packageConfig = require('../package.json') -const shell = require('shelljs') +'use strict'; +const chalk = require('chalk'); +const semver = require('semver'); +const packageConfig = require('../package.json'); +const shell = require('shelljs'); -function exec (cmd) { - return require('child_process').execSync(cmd).toString().trim() +function exec(cmd) { + return require('child_process').execSync(cmd).toString().trim(); } const versionRequirements = [ { name: 'node', currentVersion: semver.clean(process.version), - versionRequirement: packageConfig.engines.node - } -] + versionRequirement: packageConfig.engines.node, + }, +]; if (shell.which('npm')) { versionRequirements.push({ name: 'npm', currentVersion: exec('npm --version'), - versionRequirement: packageConfig.engines.npm - }) + versionRequirement: packageConfig.engines.npm, + }); } module.exports = function () { - const warnings = [] + const warnings = []; for (let i = 0; i < versionRequirements.length; i++) { - const mod = versionRequirements[i] + const mod = versionRequirements[i]; if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { - warnings.push(mod.name + ': ' + - chalk.red(mod.currentVersion) + ' should be ' + - chalk.green(mod.versionRequirement) - ) + warnings.push( + mod.name + ': ' + chalk.red(mod.currentVersion) + ' should be ' + chalk.green(mod.versionRequirement) + ); } } if (warnings.length) { - console.log('') - console.log(chalk.yellow('To use this template, you must update following to modules:')) - console.log() + console.log(''); + console.log(chalk.yellow('To use this template, you must update following to modules:')); + console.log(); for (let i = 0; i < warnings.length; i++) { - const warning = warnings[i] - console.log(' ' + warning) + const warning = warnings[i]; + console.log(' ' + warning); } - console.log() - process.exit(1) + console.log(); + process.exit(1); } -} +}; diff --git a/client/build/utils.js b/client/build/utils.js index 20c511b6..80059123 100644 --- a/client/build/utils.js +++ b/client/build/utils.js @@ -1,20 +1,17 @@ -'use strict' -const path = require('path') -const config = require('../config') -const packageConfig = require('../package.json') +'use strict'; +const path = require('path'); +const config = require('../config'); +const packageConfig = require('../package.json'); const isDev = process.env.NODE_ENV !== 'production'; const assetsPath = (_path) => { - const assetsSubDirectory = isDev - ? config.dev.assetsSubDirectory - : config.build.assetsSubDirectory - - return path.posix.join(assetsSubDirectory, _path) -} + const assetsSubDirectory = isDev ? config.dev.assetsSubDirectory : config.build.assetsSubDirectory; + return path.posix.join(assetsSubDirectory, _path); +}; module.exports = { isDev, - assetsPath -} + assetsPath, +}; diff --git a/client/build/webpack.base.conf.js b/client/build/webpack.base.conf.js index 3190e8b7..6ef67bcb 100644 --- a/client/build/webpack.base.conf.js +++ b/client/build/webpack.base.conf.js @@ -3,10 +3,10 @@ const path = require('path'); const config = require('../config'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const {VueLoaderPlugin} = require('vue-loader'); +const { VueLoaderPlugin } = require('vue-loader'); const ESLintPlugin = require('eslint-webpack-plugin'); -const {isDev, assetsPath} = require('./utils'); +const { isDev, assetsPath } = require('./utils'); function resolve(dir) { return path.join(__dirname, '..', dir); @@ -15,7 +15,7 @@ function resolve(dir) { const eslintOptions = { formatter: require('eslint-formatter-friendly'), emitWarning: !config.dev.showEslintErrorsInOverlay, - extensions: ['js', 'ts', 'vue'] + extensions: ['js', 'ts', 'vue'], }; //todo: mini-css-extract-plugin? upgrade to webpack 4, then use this @@ -29,9 +29,7 @@ module.exports = { output: { path: config.build.assetsRoot, filename: '[name].js', - publicPath: isDev - ? config.dev.assetsPublicPath - : config.build.assetsPublicPath, + publicPath: isDev ? config.dev.assetsPublicPath : config.build.assetsPublicPath, }, optimization: { splitChunks: { @@ -131,10 +129,7 @@ module.exports = { // styleRule(true), // sass rule ], }, - plugins: [ - new VueLoaderPlugin(), - new ESLintPlugin(eslintOptions), - ], + plugins: [new VueLoaderPlugin(), new ESLintPlugin(eslintOptions)], // node: { // // prevent webpack from injecting useless setImmediate polyfill because Vue diff --git a/client/build/webpack.dev.conf.js b/client/build/webpack.dev.conf.js index eeb59ea6..657069ce 100755 --- a/client/build/webpack.dev.conf.js +++ b/client/build/webpack.dev.conf.js @@ -8,7 +8,7 @@ const CopyPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const portfinder = require('portfinder'); -const {merge} = require('webpack-merge'); +const { merge } = require('webpack-merge'); const HOST = process.env.HOST; const PORT = process.env.PORT && Number(process.env.PORT); @@ -21,15 +21,12 @@ const devWebpackConfig = merge(baseWebpackConfig, { devServer: { client: { logging: 'warn', - overlay: config.dev.errorOverlay ? {errors: true, warnings: false} : false, + overlay: config.dev.errorOverlay ? { errors: true, warnings: false } : false, progress: true, - }, historyApiFallback: { - rewrites: [ - {from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html')}, - ], + rewrites: [{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }], }, hot: true, compress: true, @@ -66,8 +63,8 @@ const devWebpackConfig = merge(baseWebpackConfig, { ], }), new BundleAnalyzerPlugin({ - analyzerMode: 'disabled' // do nothing by default, but be able to generate stats with --profile - }) + analyzerMode: 'disabled', // do nothing by default, but be able to generate stats with --profile + }), ], }); diff --git a/client/build/webpack.prod.conf.js b/client/build/webpack.prod.conf.js index 7a3096b9..c516f4a7 100644 --- a/client/build/webpack.prod.conf.js +++ b/client/build/webpack.prod.conf.js @@ -3,11 +3,11 @@ const path = require('path'); const utils = require('./utils'); const webpack = require('webpack'); const config = require('../config'); -const {merge} = require('webpack-merge'); +const { merge } = require('webpack-merge'); const baseWebpackConfig = require('./webpack.base.conf'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); +const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const env = require('../config/prod.env'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); @@ -21,9 +21,7 @@ const webpackConfig = merge(baseWebpackConfig, { chunkFilename: utils.assetsPath('js/[id].[chunkhash].js'), }, optimization: { - minimizer: [ - new CssMinimizerPlugin() - ] + minimizer: [new CssMinimizerPlugin()], }, plugins: [ // http://vuejs.github.io/vue-loader/en/workflow/production.html @@ -44,7 +42,8 @@ const webpackConfig = merge(baseWebpackConfig, { filename: config.build.index, template: 'index.html', ...require('../config/prod.env'), - minify: { // defaults from https://github.com/jantimon/html-webpack-plugin#minification + minify: { + // defaults from https://github.com/jantimon/html-webpack-plugin#minification collapseWhitespace: true, keepClosingSlash: true, removeComments: true, @@ -112,14 +111,10 @@ if (config.build.productionGzip) { new CompressionWebpackPlugin({ asset: '[path].gz[query]', algorithm: 'gzip', - test: new RegExp( - '\\.(' + - config.build.productionGzipExtensions.join('|') + - ')$', - ), + test: new RegExp('\\.(' + config.build.productionGzipExtensions.join('|') + ')$'), threshold: 10240, minRatio: 0.8, - }), + }) ); } diff --git a/client/config/dev.env.js b/client/config/dev.env.js index e9cf97d7..92ff8787 100644 --- a/client/config/dev.env.js +++ b/client/config/dev.env.js @@ -1,8 +1,8 @@ -'use strict' -const {merge} = require('webpack-merge') -const prodEnv = require('./prod.env') +'use strict'; +const { merge } = require('webpack-merge'); +const prodEnv = require('./prod.env'); module.exports = merge(prodEnv, { NODE_ENV: '"development"', - VUE_APP_ENABLE_SPELLCHECK: 'true' + VUE_APP_ENABLE_SPELLCHECK: 'true', }); diff --git a/client/config/index.js b/client/config/index.js index 313916d2..07465239 100644 --- a/client/config/index.js +++ b/client/config/index.js @@ -1,12 +1,11 @@ -'use strict' +'use strict'; // Template version: 1.3.1 // see http://vuejs-templates.github.io/webpack for documentation. -const path = require('path') +const path = require('path'); module.exports = { dev: { - // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', @@ -41,7 +40,7 @@ module.exports = { // https://vue-loader.vuejs.org/en/options.html#cachebusting cacheBusting: true, - cssSourceMap: true + cssSourceMap: true, }, build: { @@ -71,6 +70,6 @@ module.exports = { // View the bundle analyzer report after build finishes: // `npm run build --report` // Set to `true` or `false` to always turn it on or off - bundleAnalyzerReport: process.env.npm_config_report - } -} + bundleAnalyzerReport: process.env.npm_config_report, + }, +}; diff --git a/client/config/prod-dha.env.js b/client/config/prod-dha.env.js index dca5df77..5efa78c3 100644 --- a/client/config/prod-dha.env.js +++ b/client/config/prod-dha.env.js @@ -1,9 +1,9 @@ -'use strict' +'use strict'; module.exports = { /* - * ENV variables used in JS code need to be stringyfied, as they will be replaced in the code, and JS needs quotes - * around strings - */ + * ENV variables used in JS code need to be stringyfied, as they will be replaced in the code, and JS needs quotes + * around strings + */ VUE_APP_ENABLE_SPELLCHECK: !!process.env.TASKBASE_BASEURL, /* @@ -12,6 +12,6 @@ module.exports = { // vvvv HTML PROPERTIES FROM HERE, NOT STRINGIFIED vvvv VUE_APP_FAVICON_32: 'https://skillbox-my-detailhandel-dha-prod.s3.eu-central-1.amazonaws.com/myDHA-favicon.png', VUE_APP_FAVICON_16: 'https://skillbox-my-detailhandel-dha-prod.s3.eu-central-1.amazonaws.com/myDHA-favicon.png', - VUE_APP_TITLE: 'myDHA' + VUE_APP_TITLE: 'myDHA', // ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^ -} +}; diff --git a/client/config/prod-dhf.env.js b/client/config/prod-dhf.env.js index cdcb0d9c..fa5b1fca 100644 --- a/client/config/prod-dhf.env.js +++ b/client/config/prod-dhf.env.js @@ -1,9 +1,9 @@ -'use strict' +'use strict'; module.exports = { /* - * ENV variables used in JS code need to be stringyfied, as they will be replaced in the code, and JS needs quotes - * around strings - */ + * ENV variables used in JS code need to be stringyfied, as they will be replaced in the code, and JS needs quotes + * around strings + */ VUE_APP_ENABLE_SPELLCHECK: !!process.env.TASKBASE_BASEURL, /* @@ -12,6 +12,6 @@ module.exports = { // vvvv HTML PROPERTIES FROM HERE, NOT STRINGIFIED vvvv VUE_APP_FAVICON_32: 'https://skillbox-my-detailhandel-dhf-prod.s3.eu-central-1.amazonaws.com/myDHF-favicon.png', VUE_APP_FAVICON_16: 'https://skillbox-my-detailhandel-dhf-prod.s3.eu-central-1.amazonaws.com/myDHF-favicon.png', - VUE_APP_TITLE: 'myDHF' + VUE_APP_TITLE: 'myDHF', // ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^ -} +}; diff --git a/client/config/prod-my-kv.env.js b/client/config/prod-my-kv.env.js index 7b7d560a..797a8bca 100644 --- a/client/config/prod-my-kv.env.js +++ b/client/config/prod-my-kv.env.js @@ -1,9 +1,9 @@ -'use strict' +'use strict'; module.exports = { /* - * ENV variables used in JS code need to be stringyfied, as they will be replaced in the code, and JS needs quotes - * around strings - */ + * ENV variables used in JS code need to be stringyfied, as they will be replaced in the code, and JS needs quotes + * around strings + */ VUE_APP_ENABLE_SPELLCHECK: !!process.env.TASKBASE_BASEURL, /* @@ -12,6 +12,6 @@ module.exports = { // vvvv HTML PROPERTIES FROM HERE, NOT STRINGIFIED vvvv VUE_APP_FAVICON_32: 'https://skillbox-my-kv-prod.s3-eu-west-1.amazonaws.com/mykv-favicon.png', VUE_APP_FAVICON_16: 'https://skillbox-my-kv-prod.s3-eu-west-1.amazonaws.com/mykv-favicon.png', - VUE_APP_TITLE: 'myKV' + VUE_APP_TITLE: 'myKV', // ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^ -} +}; diff --git a/client/config/prod.env.js b/client/config/prod.env.js index 7ff19464..4f4fafe0 100644 --- a/client/config/prod.env.js +++ b/client/config/prod.env.js @@ -1,5 +1,5 @@ -'use strict' -const { merge } = require('webpack-merge') +'use strict'; +const { merge } = require('webpack-merge'); const values = { NODE_ENV: '"production"', @@ -9,10 +9,10 @@ const values = { LOGOUT_REDIRECT_URL: JSON.stringify(process.env.LOGOUT_REDIRECT_URL), VUE_APP_FLAVOR: JSON.stringify(process.env.APP_FLAVOR), /* - * ENV variables used in JS code need to be stringyfied, as they will be replaced (in place) in the code, - * and JS needs quotes around strings - * see https://cli.vuejs.org/guide/mode-and-env.html#using-env-variables-in-client-side-code - */ + * ENV variables used in JS code need to be stringyfied, as they will be replaced (in place) in the code, + * and JS needs quotes around strings + * see https://cli.vuejs.org/guide/mode-and-env.html#using-env-variables-in-client-side-code + */ VUE_APP_ENABLE_SPELLCHECK: !!process.env.TASKBASE_BASEURL, /* @@ -21,9 +21,9 @@ const values = { // vvvv HTML PROPERTIES FROM HERE, NOT STRINGIFIED vvvv VUE_APP_FAVICON_32: '/static/favicon-32x32.png', VUE_APP_FAVICON_16: '/static/favicon-16x16.png', - VUE_APP_TITLE: 'mySkillbox' + VUE_APP_TITLE: 'mySkillbox', // ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^ -} +}; switch (process.env.APP_FLAVOR) { case 'my-kv': @@ -39,4 +39,3 @@ switch (process.env.APP_FLAVOR) { // we are on the skillbox APP_FLAVOR module.exports = values; } - diff --git a/client/cypress.e2e.ts b/client/cypress.e2e.ts index 8bb23982..9e9a0919 100644 --- a/client/cypress.e2e.ts +++ b/client/cypress.e2e.ts @@ -1,27 +1,24 @@ -import {defineConfig} from 'cypress'; -import {readFileSync} from "fs"; -import {resolve} from "path"; -export default defineConfig( { +import { defineConfig } from 'cypress'; +import { readFileSync } from 'fs'; +import { resolve } from 'path'; +export default defineConfig({ e2e: { - "baseUrl": "http://localhost:8000", + baseUrl: 'http://localhost:8000', specPattern: 'cypress/e2e/e2e/**/*.{spec,cy}.{js,ts}', supportFile: 'cypress/support/e2e.ts', setupNodeEvents(on, config) { on('task', { getSchema() { - return readFileSync( - resolve(__dirname, '../server/schema.graphql'), - 'utf8' - ); - } + return readFileSync(resolve(__dirname, '../server/schema.graphql'), 'utf8'); + }, }); }, }, - "videoUploadOnPasses": false, - "reporter": "junit", - "reporterOptions": { - "mochaFile": "cypress/test-reports/e2e/cypress-results-[hash].xml", - "toConsole": true + videoUploadOnPasses: false, + reporter: 'junit', + reporterOptions: { + mochaFile: 'cypress/test-reports/e2e/cypress-results-[hash].xml', + toConsole: true, }, - "projectId": "msk-ee", + projectId: 'msk-ee', }); diff --git a/client/cypress.frontend.ts b/client/cypress.frontend.ts index 29927148..48d4366e 100644 --- a/client/cypress.frontend.ts +++ b/client/cypress.frontend.ts @@ -1,34 +1,29 @@ -import {defineConfig} from 'cypress'; -import {readFileSync} from "fs"; -import {resolve} from "path"; +import { defineConfig } from 'cypress'; +import { readFileSync } from 'fs'; +import { resolve } from 'path'; export default defineConfig({ chromeWebSecurity: false, e2e: { - baseUrl: "http://localhost:8080", + baseUrl: 'http://localhost:8080', specPattern: 'cypress/e2e/frontend/**/*.{cy,spec}.{js,ts}', supportFile: 'cypress/support/e2e.ts', setupNodeEvents(on, config) { on('task', { getSchema() { - return readFileSync( - resolve(__dirname, '../server/schema.graphql'), - 'utf8' - ); - } + return readFileSync(resolve(__dirname, '../server/schema.graphql'), 'utf8'); + }, }); }, }, videoUploadOnPasses: false, - reporter: "junit", + reporter: 'junit', reporterOptions: { - mochaFile: "cypress/test-reports/frontend/cypress-results-[hash].xml", - toConsole: true + mochaFile: 'cypress/test-reports/frontend/cypress-results-[hash].xml', + toConsole: true, }, - "projectId": "msk-fe", + projectId: 'msk-fe', retries: { - runMode: 3 - } + runMode: 3, + }, }); - - diff --git a/client/index.html b/client/index.html index b29052f2..c0866fd4 100644 --- a/client/index.html +++ b/client/index.html @@ -1,43 +1,41 @@ - - - - <%= htmlWebpackPlugin.options.VUE_APP_TITLE %> + + + + <%= htmlWebpackPlugin.options.VUE_APP_TITLE %> - - - + + + - - - - - - - + + + + + + + - - - - -
-
-
-
- - + + + +
+
+
+ + diff --git a/client/jest.config.js b/client/jest.config.js index fd7e0cd0..460b060a 100644 --- a/client/jest.config.js +++ b/client/jest.config.js @@ -1,11 +1,5 @@ module.exports = { - moduleFileExtensions: [ - 'js', - 'jsx', - 'ts', - 'json', - 'vue', - ], + moduleFileExtensions: ['js', 'jsx', 'ts', 'json', 'vue'], transform: { '\\.(gql|graphql)$': 'jest-transform-graphql', '^.+\\.js$': 'babel-jest', @@ -13,27 +7,15 @@ module.exports = { '^.+\\.vue$': '@vue/vue2-jest', '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', }, - modulePaths: [ - '/src', - '/node_modules', - ], - transformIgnorePatterns: [ - '/node_modules/', - ], + modulePaths: ['/src', '/node_modules'], + transformIgnorePatterns: ['/node_modules/'], moduleNameMapper: { '^@/(.*)$': '/src/$1', '^gql/(.*)$': '/src/graphql/gql/$1', }, - snapshotSerializers: [ - '/node_modules/jest-serializer-vue', - ], + snapshotSerializers: ['/node_modules/jest-serializer-vue'], testEnvironment: 'jsdom', - testMatch: [ - '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)', - ], + testMatch: ['**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'], testURL: 'http://localhost/', - watchPlugins: [ - 'jest-watch-typeahead/filename', - 'jest-watch-typeahead/testname', - ], + watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], }; diff --git a/client/mock.js b/client/mock.js index 0769f90b..ad319f11 100644 --- a/client/mock.js +++ b/client/mock.js @@ -1,29 +1,26 @@ -const {readFileSync} = require('fs'); -const {resolve} = require('path'); -const { addMocksToSchema} = require('@graphql-tools/mock'); +const { readFileSync } = require('fs'); +const { resolve } = require('path'); +const { addMocksToSchema } = require('@graphql-tools/mock'); const { makeExecutableSchema } = require('@graphql-tools/schema'); const { graphql } = require('graphql'); -const schemaString = readFileSync( - resolve(__dirname,'../server/schema.graphql'), - 'utf8' -); +const schemaString = readFileSync(resolve(__dirname, '../server/schema.graphql'), 'utf8'); // Make a GraphQL schema with no resolvers -const schema = makeExecutableSchema({ typeDefs: schemaString }) +const schema = makeExecutableSchema({ typeDefs: schemaString }); // Create a new schema with mocks -const schemaWithMocks = addMocksToSchema({ schema }) +const schemaWithMocks = addMocksToSchema({ schema }); const query = /* GraphQL */ ` query MeQuery { me { - firstName + firstName } } -` +`; graphql({ schema: schemaWithMocks, source: query, -}).then(result => console.log('Got result', result)) +}).then((result) => console.log('Got result', result)); diff --git a/client/src/@types/graphql.d.ts b/client/src/@types/graphql.d.ts index 60950b87..90cca9ba 100644 --- a/client/src/@types/graphql.d.ts +++ b/client/src/@types/graphql.d.ts @@ -1,12 +1,12 @@ declare module '*.graphql' { - import {DocumentNode} from "graphql"; + import { DocumentNode } from 'graphql'; const Schema: DocumentNode; export = Schema; } declare module '*.gql' { - import {DocumentNode} from "graphql"; + import { DocumentNode } from 'graphql'; const content: DocumentNode; export default content; } diff --git a/client/src/@types/index.ts b/client/src/@types/index.ts index ea59eef3..74bf4dea 100644 --- a/client/src/@types/index.ts +++ b/client/src/@types/index.ts @@ -11,7 +11,7 @@ export interface ContentBlock { } export interface ActionOptions { - up?: boolean, - down?: boolean, - extended?: boolean + up?: boolean; + down?: boolean; + extended?: boolean; } diff --git a/client/src/App.vue b/client/src/App.vue index 0905d8c3..253967df 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -1,109 +1,107 @@ diff --git a/client/src/components/AddContentButton.vue b/client/src/components/AddContentButton.vue index f9ed72fc..529c2578 100644 --- a/client/src/components/AddContentButton.vue +++ b/client/src/components/AddContentButton.vue @@ -1,104 +1,98 @@ diff --git a/client/src/components/AddContentElement.vue b/client/src/components/AddContentElement.vue index 692b617c..5afa10e8 100644 --- a/client/src/components/AddContentElement.vue +++ b/client/src/components/AddContentElement.vue @@ -1,41 +1,38 @@ diff --git a/client/src/components/AddWidget.vue b/client/src/components/AddWidget.vue index f223ae46..2856a11e 100644 --- a/client/src/components/AddWidget.vue +++ b/client/src/components/AddWidget.vue @@ -11,68 +11,71 @@ diff --git a/client/src/components/AssignmentWithSubmissions.vue b/client/src/components/AssignmentWithSubmissions.vue index fe49cc74..db5e1d93 100644 --- a/client/src/components/AssignmentWithSubmissions.vue +++ b/client/src/components/AssignmentWithSubmissions.vue @@ -1,53 +1,31 @@ diff --git a/client/src/components/BackLink.vue b/client/src/components/BackLink.vue index b2d8a89e..0fb0651f 100644 --- a/client/src/components/BackLink.vue +++ b/client/src/components/BackLink.vue @@ -1,72 +1,68 @@ diff --git a/client/src/components/Chapter.vue b/client/src/components/Chapter.vue index 220f3ebc..6e9a3fb6 100644 --- a/client/src/components/Chapter.vue +++ b/client/src/components/Chapter.vue @@ -1,26 +1,12 @@