From 151a7e54aec2f30a25075065043d6abf79b86fae Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 20 Sep 2022 16:53:26 +0200 Subject: [PATCH] Fix lint issues, update deps Signed-off-by: Thomas Citharel --- .tool-versions | 4 +- docker/tests/Dockerfile | 2 +- js/.eslintrc.js | 3 + js/package.json | 17 +- js/src/assets/oruga-tailwindcss.css | 4 +- js/src/components/Activity/activity.scss | 1 - js/src/components/Editor/Mention.ts | 5 +- js/src/components/Editor/MentionList.vue | 52 +- .../components/Event/AddressAutoComplete.vue | 149 -- js/src/components/Event/EventCard.vue | 2 +- .../components/Event/EventMetadataSidebar.vue | 2 +- .../components/Event/EventMinimalistCard.vue | 2 +- .../Event/EventParticipationCard.vue | 56 +- .../Event/FullAddressAutoComplete.vue | 16 +- js/src/components/Group/GroupMemberCard.vue | 2 +- js/src/components/LeafletMap.vue | 85 +- .../Map/Vue2LeafletLocateControl.vue | 64 - js/src/components/PictureUpload.vue | 11 +- js/src/components/Post/PostListItem.vue | 2 +- js/src/components/Report/ReportModal.vue | 17 +- js/src/components/Resource/DraggableList.vue | 16 +- js/src/components/Resource/FolderItem.vue | 25 +- js/src/components/Resource/ResourceItem.vue | 2 +- .../Settings/SettingsOnboarding.vue | 22 +- js/src/components/{Tag.vue => TagElement.vue} | 0 js/src/components/TextEditor.vue | 8 +- js/src/components/Todo/CompactTodo.vue | 20 +- .../{Observer.vue => ObserverElement.vue} | 0 js/src/components/core/CoreTag.vue | 102 -- js/src/components/core/CustomDialog.vue | 19 +- js/src/components/core/CustomSnackbar.vue | 4 +- js/src/composition/apollo/config.ts | 44 +- js/src/composition/apollo/group.ts | 2 +- js/src/composition/config.ts | 1 - js/src/graphql/config.ts | 12 + js/src/plugins/dialog.ts | 5 +- js/src/router/index.ts | 2 +- js/src/views/{About.vue => AboutView.vue} | 0 js/src/views/Account/IdentityPicker.vue | 67 +- .../views/Account/IdentityPickerWrapper.vue | 1 - js/src/views/Admin/AdminGroupProfile.vue | 2 +- js/src/views/Admin/AdminProfile.vue | 2 +- js/src/views/Admin/AdminUserProfile.vue | 124 +- js/src/views/Admin/SettingsView.vue | 8 +- js/src/views/Event/EventView.vue | 336 +++- js/src/views/Event/MyEventsView.vue | 1 - js/src/views/Event/ParticipantsView.vue | 2 +- js/src/views/Group/GroupMembers.vue | 2 +- js/src/views/Group/TimelineView.vue | 2 +- js/src/views/Posts/PostView.vue | 2 +- js/src/views/Resources/ResourceFolder.vue | 37 +- js/tests/unit/specs/components/tag.spec.ts | 2 +- js/yarn.lock | 1585 +++++++++-------- lib/graphql/resolvers/user.ex | 12 +- .../activity/_comment_activity_item.html.heex | 28 +- .../activity/_event_activity_item.html.heex | 28 +- .../activity/_group_activity_item.html.heex | 14 +- .../activity/_post_activity_item.html.heex | 14 +- .../_resource_activity_item.html.heex | 42 +- .../email/email_anonymous_activity.html.heex | 7 +- mix.lock | 14 +- 61 files changed, 1533 insertions(+), 1579 deletions(-) delete mode 100644 js/src/components/Event/AddressAutoComplete.vue delete mode 100644 js/src/components/Map/Vue2LeafletLocateControl.vue rename js/src/components/{Tag.vue => TagElement.vue} (100%) rename js/src/components/Utils/{Observer.vue => ObserverElement.vue} (100%) delete mode 100644 js/src/components/core/CoreTag.vue rename js/src/views/{About.vue => AboutView.vue} (100%) diff --git a/.tool-versions b/.tool-versions index 6d5c81162..73654c14d 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -elixir 1.13.4-otp-25 -erlang 25.0.3 +elixir 1.14.0-otp-25 +erlang 25.0.4 diff --git a/docker/tests/Dockerfile b/docker/tests/Dockerfile index 4c87c709b..6342d6847 100644 --- a/docker/tests/Dockerfile +++ b/docker/tests/Dockerfile @@ -1,7 +1,7 @@ FROM elixir:latest LABEL maintainer="Thomas Citharel " -ENV REFRESHED_AT=2022-04-06 +ENV REFRESHED_AT=2022-09-20 RUN apt-get update -yq && apt-get install -yq build-essential inotify-tools postgresql-client git curl gnupg xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 cmake exiftool python3-pip python3-setuptools RUN curl -sL https://deb.nodesource.com/setup_16.x | bash && apt-get install nodejs -yq RUN npm install -g yarn wait-on diff --git a/js/.eslintrc.js b/js/.eslintrc.js index c2b3c63fa..101b36075 100644 --- a/js/.eslintrc.js +++ b/js/.eslintrc.js @@ -53,4 +53,7 @@ module.exports = { }, ignorePatterns: ["src/typings/*.d.ts", "vue.config.js"], + globals: { + GeolocationPositionError: true, + }, }; diff --git a/js/package.json b/js/package.json index 8a0add4a1..42c3de362 100644 --- a/js/package.json +++ b/js/package.json @@ -45,6 +45,7 @@ "@tiptap/extension-strike": "^2.0.0-beta.26", "@tiptap/extension-text": "^2.0.0-beta.15", "@tiptap/extension-underline": "^2.0.0-beta.7", + "@tiptap/suggestion": "^2.0.0-beta.195", "@tiptap/vue-3": "^2.0.0-beta.96", "@vue-a11y/announcer": "^2.1.0", "@vue-a11y/skip-to": "^2.1.2", @@ -54,10 +55,9 @@ "@vueuse/core": "^9.1.0", "@vueuse/head": "^0.7.9", "@vueuse/router": "^9.0.2", - "@xiaoshuapp/draggable": "^4.1.0", "apollo-absinthe-upload-link": "^1.5.0", "autoprefixer": "^10", - "blurhash": "^1.1.3", + "blurhash": "^2.0.0", "bulma": "^0.9.4", "bulma-divider": "^0.2.0", "date-fns": "^2.16.0", @@ -82,16 +82,15 @@ "tippy.js": "^6.2.3", "unfetch": "^4.2.0", "vue": "^3.2.37", - "vue-class-component": "8.0.0-rc.1", "vue-i18n": "9", "vue-material-design-icons": "^5.1.2", "vue-matomo": "^4.1.0", "vue-meta": "^2.3.1", "vue-plausible": "^1.3.1", - "vue-property-decorator": "10.0.0-rc.3", "vue-router": "4", "vue-scrollto": "^2.17.1", - "vue-use-route-query": "^1.1.0" + "vue-use-route-query": "^1.1.0", + "vuedraggable": "^4.1.0" }, "devDependencies": { "@histoire/plugin-vue": "^0.10.0", @@ -113,7 +112,7 @@ "@types/prosemirror-view": "^1.11.4", "@types/sanitize-html": "^2.5.0", "@vitejs/plugin-vue": "^3.0.3", - "@vitest/ui": "^0.22.1", + "@vitest/ui": "^0.23.4", "@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-typescript": "^11.0.0", "@vue/test-utils": "^2.0.2", @@ -130,10 +129,10 @@ "prettier-eslint": "^15.0.1", "rollup-plugin-visualizer": "^5.7.1", "sass": "^1.34.1", - "typescript": "~4.7.4", + "typescript": "~4.8.3", "vite": "^3.0.9", - "vite-plugin-pwa": "^0.12.3", - "vitest": "^0.22.1", + "vite-plugin-pwa": "^0.13.0", + "vitest": "^0.23.3", "vue-i18n-extract": "^2.0.4" } } diff --git a/js/src/assets/oruga-tailwindcss.css b/js/src/assets/oruga-tailwindcss.css index 811eaef1c..63dffe692 100644 --- a/js/src/assets/oruga-tailwindcss.css +++ b/js/src/assets/oruga-tailwindcss.css @@ -153,7 +153,7 @@ body { /* Modal */ .modal-content { - @apply bg-white dark:bg-zinc-800 rounded px-2 py-4 w-full; + @apply bg-white dark:bg-zinc-800 rounded px-2 py-4 w-full z-0; } /* Switch */ @@ -210,7 +210,7 @@ button.menubar__button { /* Table */ .table tr { - @apply odd:bg-white dark:odd:bg-zinc-600 even:bg-gray-50 dark:even:bg-zinc-700 border-b rounded; + @apply odd:bg-white dark:odd:bg-zinc-600 last:border-b-0 even:bg-gray-50 dark:even:bg-zinc-700 border-b rounded; } .table-td { diff --git a/js/src/components/Activity/activity.scss b/js/src/components/Activity/activity.scss index 860de64ef..a7181f137 100644 --- a/js/src/components/Activity/activity.scss +++ b/js/src/components/Activity/activity.scss @@ -8,6 +8,5 @@ border: 2px solid; z-index: 2; flex-shrink: 0; - } } diff --git a/js/src/components/Editor/Mention.ts b/js/src/components/Editor/Mention.ts index 82103a309..b866df575 100644 --- a/js/src/components/Editor/Mention.ts +++ b/js/src/components/Editor/Mention.ts @@ -62,9 +62,10 @@ const mentionOptions: MentionOptions = { let popup: any; return { - onStart: (props: any) => { + onStart: (props: Record) => { component = new VueRenderer(MentionList, { - propsData: props, + props, + editor: props.editor, }); popup = tippy("body", { diff --git a/js/src/components/Editor/MentionList.vue b/js/src/components/Editor/MentionList.vue index 30642051a..678d9c2f6 100644 --- a/js/src/components/Editor/MentionList.vue +++ b/js/src/components/Editor/MentionList.vue @@ -20,7 +20,7 @@ import { ref, watch } from "vue"; const props = defineProps<{ items: IPerson[]; - command: ({ id }: { id: string }) => {}; + command: ({ id }: { id: string }) => any; }>(); // @Prop({ type: Function, required: true }) command!: any; @@ -31,37 +31,37 @@ watch(props.items, () => { selectedIndex.value = 0; }); -const onKeyDown = ({ event }: { event: KeyboardEvent }): boolean => { - if (event.key === "ArrowUp") { - upHandler(); - return true; - } +// const onKeyDown = ({ event }: { event: KeyboardEvent }): boolean => { +// if (event.key === "ArrowUp") { +// upHandler(); +// return true; +// } - if (event.key === "ArrowDown") { - downHandler(); - return true; - } +// if (event.key === "ArrowDown") { +// downHandler(); +// return true; +// } - if (event.key === "Enter") { - enterHandler(); - return true; - } +// if (event.key === "Enter") { +// enterHandler(); +// return true; +// } - return false; -}; +// return false; +// }; -const upHandler = (): void => { - selectedIndex.value = - (selectedIndex.value + props.items.length - 1) % props.items.length; -}; +// const upHandler = (): void => { +// selectedIndex.value = +// (selectedIndex.value + props.items.length - 1) % props.items.length; +// }; -const downHandler = (): void => { - selectedIndex.value = (selectedIndex.value + 1) % props.items.length; -}; +// const downHandler = (): void => { +// selectedIndex.value = (selectedIndex.value + 1) % props.items.length; +// }; -const enterHandler = (): void => { - selectItem(selectedIndex.value); -}; +// const enterHandler = (): void => { +// selectItem(selectedIndex.value); +// }; const selectItem = (index: number): void => { const item = props.items[index]; diff --git a/js/src/components/Event/AddressAutoComplete.vue b/js/src/components/Event/AddressAutoComplete.vue deleted file mode 100644 index db105b09a..000000000 --- a/js/src/components/Event/AddressAutoComplete.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - diff --git a/js/src/components/Event/EventCard.vue b/js/src/components/Event/EventCard.vue index d2aa8bf7a..bcf92c9b4 100644 --- a/js/src/components/Event/EventCard.vue +++ b/js/src/components/Event/EventCard.vue @@ -150,7 +150,7 @@ import RouteName from "../../router/name"; import InlineAddress from "@/components/Address/InlineAddress.vue"; import { computed, inject } from "vue"; -import MobilizonTag from "@/components/Tag.vue"; +import MobilizonTag from "@/components/TagElement.vue"; import AccountCircle from "vue-material-design-icons/AccountCircle.vue"; import Video from "vue-material-design-icons/Video.vue"; import { formatDateTimeForEvent } from "@/utils/datetime"; diff --git a/js/src/components/Event/EventMetadataSidebar.vue b/js/src/components/Event/EventMetadataSidebar.vue index f6cacfdbc..b6a0db330 100644 --- a/js/src/components/Event/EventMetadataSidebar.vue +++ b/js/src/components/Event/EventMetadataSidebar.vue @@ -84,7 +84,7 @@ (), - { - options: () => ({ - hideDate: true, - loggedPerson: false, - hideDetails: false, - organizerActor: null, - }), - } -); +const props = defineProps<{ + participation: IParticipant; + options?: IEventCardOptions; +}>(); const emit = defineEmits(["eventDeleted"]); @@ -353,10 +336,6 @@ const { result: currentActorResult } = useQuery(CURRENT_ACTOR_CLIENT); const currentActor = computed(() => currentActorResult.value?.currentActor); const { t } = useI18n({ useScope: "global" }); -const mergedOptions = computed(() => { - return { ...defaultOptions, ...props.options }; -}); - const dialog = inject("dialog"); const openDeleteEventModal = ( @@ -441,9 +420,8 @@ onDeleteEventError((error) => { * Delete the event */ const openDeleteEventModalWrapper = () => { - openDeleteEventModal( - props.participation.event, - deleteEvent(props.participation.event) + openDeleteEventModal(props.participation.event, (event: IEvent) => + deleteEvent({ eventId: event.id ?? "" }) ); }; @@ -474,15 +452,15 @@ const gotToWithCheck = async ( return router.push(route); }; -const organizerActor = computed(() => { - if ( - props.participation.event.attributedTo && - props.participation.event.attributedTo.id - ) { - return props.participation.event.attributedTo; - } - return props.participation.event.organizerActor; -}); +// const organizerActor = computed(() => { +// if ( +// props.participation.event.attributedTo && +// props.participation.event.attributedTo.id +// ) { +// return props.participation.event.attributedTo; +// } +// return props.participation.event.organizerActor; +// }); const seatsLeft = computed(() => { if (props.participation.event.options.maximumAttendeeCapacity > 0) { diff --git a/js/src/components/Event/FullAddressAutoComplete.vue b/js/src/components/Event/FullAddressAutoComplete.vue index dec60e5b3..640e3ce64 100644 --- a/js/src/components/Event/FullAddressAutoComplete.vue +++ b/js/src/components/Event/FullAddressAutoComplete.vue @@ -143,7 +143,7 @@ const props = withDefaults( } ); -const addressModalActive = ref(false); +// const addressModalActive = ref(false); const componentId = 0; @@ -186,14 +186,14 @@ const updateSelected = (option: IAddress): void => { emit("update:modelValue", selected.value); }; -const resetPopup = (): void => { - selected.value = new Address(); -}; +// const resetPopup = (): void => { +// selected.value = new Address(); +// }; -const openNewAddressModal = (): void => { - resetPopup(); - addressModalActive.value = true; -}; +// const openNewAddressModal = (): void => { +// resetPopup(); +// addressModalActive.value = true; +// }; const checkCurrentPosition = (e: LatLng): boolean => { if (!selected.value?.geom) return false; diff --git a/js/src/components/Group/GroupMemberCard.vue b/js/src/components/Group/GroupMemberCard.vue index 8c52ea202..748712044 100644 --- a/js/src/components/Group/GroupMemberCard.vue +++ b/js/src/components/Group/GroupMemberCard.vue @@ -94,7 +94,7 @@ import ExitToApp from "vue-material-design-icons/ExitToApp.vue"; import DotsHorizontal from "vue-material-design-icons/DotsHorizontal.vue"; import AccountGroup from "vue-material-design-icons/AccountGroup.vue"; import AccountCircle from "vue-material-design-icons/AccountCircle.vue"; -import Tag from "@/components/Tag.vue"; +import Tag from "@/components/TagElement.vue"; import { htmlToText } from "@/utils/html"; import { useI18n } from "vue-i18n"; diff --git a/js/src/components/LeafletMap.vue b/js/src/components/LeafletMap.vue index 0c6251c97..0426739ab 100644 --- a/js/src/components/LeafletMap.vue +++ b/js/src/components/LeafletMap.vue @@ -8,6 +8,8 @@ @click="clickMap" @update:zoom="updateZoom" :options="{ zoomControl: false }" + ref="mapComponent" + @ready="onMapReady" > @@ -16,28 +18,36 @@ :zoomInTitle="$t('Zoom in')" :zoomOutTitle="$t('Zoom out')" > - - + + + + {{ line }}
+