diff --git a/.github/workflows/test_dht_node.yml b/.github/workflows/test_dht_node.yml index 2bbbd5e6d..4cb50a093 100644 --- a/.github/workflows/test_dht_node.yml +++ b/.github/workflows/test_dht_node.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Build 'test' image run: | docker build --target test -t "gradido/dht-node:test" -f dht-node/Dockerfile . @@ -49,7 +49,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Lint run: cd database && yarn && cd ../config && yarn install && cd ../dht-node && yarn && yarn run lint @@ -61,7 +61,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Download Docker Image uses: actions/download-artifact@v4 with: @@ -70,10 +70,10 @@ jobs: - name: Load Docker Image run: docker load < /tmp/dht-node.tar - + - name: docker-compose mariadb run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps mariadb - + - name: Sleep for 30 seconds run: sleep 30s shell: bash @@ -85,7 +85,7 @@ jobs: run: sleep 30s shell: bash - #- name: Unit tests - # run: cd database && yarn && yarn build && cd ../dht-node && yarn && yarn test - name: Unit tests - run: docker run --env NODE_ENV=test --env DB_HOST=mariadb --network gradido_internal-net --rm gradido/dht-node:test yarn run test + run: cd database && yarn && yarn build && cd ../config && yarn install && cd ../dht-node && yarn && yarn test + #- name: Unit tests + # run: docker run --env NODE_ENV=test --env DB_HOST=mariadb --network gradido_internal-net --rm gradido/dht-node:test yarn run test diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f712b290..27d9cdebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -#### [2.4.5](https://github.com/gradido/gradido/compare/2.3.1...2.4.5) +#### [2.5.1](https://github.com/gradido/gradido/compare/2.3.1...2.5.1) +- refactor(frontend): contribution form refactor [`#3442`](https://github.com/gradido/gradido/pull/3442) +- feat(backend): correct user data transfer to gms [`#3433`](https://github.com/gradido/gradido/pull/3433) +- feat(backend): switch marker colors of community location and user location [`#3445`](https://github.com/gradido/gradido/pull/3445) +- feat(backend): darker email font for content [`#3441`](https://github.com/gradido/gradido/pull/3441) +- fix(other): clear also ~/.cache/yarn [`#3362`](https://github.com/gradido/gradido/pull/3362) +- refactor(backend): test refactor better bun compatibility [`#3438`](https://github.com/gradido/gradido/pull/3438) +- chore(release): v2.4.5 beta [`#3435`](https://github.com/gradido/gradido/pull/3435) - feat(backend): add answer button inside E-Mail [`#3431`](https://github.com/gradido/gradido/pull/3431) - feat(other): build config in deployment [`#3430`](https://github.com/gradido/gradido/pull/3430) - fix(dht): and federation using config in bare-metal setup [`#3434`](https://github.com/gradido/gradido/pull/3434) diff --git a/admin/.env.dist b/admin/.env.dist index c3d62bfd2..62c2b0ffd 100644 --- a/admin/.env.dist +++ b/admin/.env.dist @@ -3,4 +3,5 @@ GRAPHQL_PATH=/graphql WALLET_URL=http://localhost WALLET_AUTH_PATH=/authenticate?token= WALLET_LOGIN_PATH=/login -DEBUG_DISABLE_AUTH=false \ No newline at end of file +DEBUG_DISABLE_AUTH=false +HUMHUB_ACTIVE=false \ No newline at end of file diff --git a/admin/.env.template b/admin/.env.template index 11e849271..354a684a3 100644 --- a/admin/.env.template +++ b/admin/.env.template @@ -6,3 +6,6 @@ WALLET_AUTH_PATH=$WALLET_AUTH_PATH WALLET_LOGIN_PATH=$WALLET_LOGIN_PATH GRAPHQL_PATH=$GRAPHQL_PATH DEBUG_DISABLE_AUTH=false + +HUMHUB_ACTIVE=$HUMHUB_ACTIVE +HUMHUB_API_URL=$HUMHUB_API_URL \ No newline at end of file diff --git a/admin/package.json b/admin/package.json index 5b4c7a24c..8b605d03d 100644 --- a/admin/package.json +++ b/admin/package.json @@ -3,7 +3,7 @@ "description": "Administration Interface for Gradido", "main": "index.js", "author": "Moriz Wahl", - "version": "2.4.5", + "version": "2.5.1", "license": "Apache-2.0", "scripts": { "start": "node run/server.js", @@ -55,7 +55,8 @@ "vue-router": "4.4.0", "vue3-datepicker": "^0.4.0", "vuex": "4.1.0", - "vuex-persistedstate": "4.1.0" + "vuex-persistedstate": "4.1.0", + "yup": "^1.6.1" }, "devDependencies": { "@apollo/client": "^3.10.8", @@ -88,6 +89,7 @@ "unplugin-icons": "^0.19.0", "unplugin-vue-components": "^0.27.3", "vite-plugin-environment": "^1.1.3", + "vite-plugin-graphql-loader": "^4.0.4", "vitest": "^2.0.5", "vitest-canvas-mock": "^0.3.3" }, diff --git a/admin/src/components/CollapseIcon.vue b/admin/src/components/CollapseIcon.vue new file mode 100644 index 000000000..240aed498 --- /dev/null +++ b/admin/src/components/CollapseIcon.vue @@ -0,0 +1,17 @@ + + diff --git a/admin/src/components/ContributionMessages/ContributionMessagesFormular.vue b/admin/src/components/ContributionMessages/ContributionMessagesFormular.vue index 0ae31c905..c8dc2f854 100644 --- a/admin/src/components/ContributionMessages/ContributionMessagesFormular.vue +++ b/admin/src/components/ContributionMessages/ContributionMessagesFormular.vue @@ -222,6 +222,10 @@ const onSubmit = () => { } } toastSuccess(t('message.request')) + form.value = { + text: '', + memo: props.contributionMemo, + } loading.value = false }) .catch((error) => { diff --git a/admin/src/components/ContributionMessages/ContributionMessagesList.spec.js b/admin/src/components/ContributionMessages/ContributionMessagesList.spec.js index 7d87082d4..bbb2f3806 100644 --- a/admin/src/components/ContributionMessages/ContributionMessagesList.spec.js +++ b/admin/src/components/ContributionMessages/ContributionMessagesList.spec.js @@ -93,10 +93,12 @@ describe('ContributionMessagesList', () => { wrapper = mount(ContributionMessagesList, { props: { - contributionId: 42, - contributionMemo: 'test memo', - contributionUserId: 108, - contributionStatus: 'PENDING', + contribution: { + id: 42, + memo: 'test memo', + userId: 108, + status: 'PENDING', + }, hideResubmission: true, }, global: { @@ -137,7 +139,7 @@ describe('ContributionMessagesList', () => { }) it('does not render the ContributionMessagesFormular when status is not PENDING or IN_PROGRESS', async () => { - await wrapper.setProps({ contributionStatus: 'COMPLETED' }) + await wrapper.setProps({ contribution: { status: 'COMPLETED' } }) expect(wrapper.find('contribution-messages-formular-stub').exists()).toBe(false) }) diff --git a/admin/src/components/ContributionMessages/ContributionMessagesList.vue b/admin/src/components/ContributionMessages/ContributionMessagesList.vue index 14b640066..9b0d11cbe 100644 --- a/admin/src/components/ContributionMessages/ContributionMessagesList.vue +++ b/admin/src/components/ContributionMessages/ContributionMessagesList.vue @@ -1,17 +1,49 @@ + + @@ -168,7 +174,13 @@ export default { required: false, }, }, - emits: ['update-contributions', 'reload-contribution', 'update-status', 'show-overlay'], + emits: [ + 'update-contributions', + 'reload-contribution', + 'update-status', + 'show-overlay', + 'search-for-email', + ], data() { return { slotIndex: 0, @@ -176,6 +188,12 @@ export default { creationUserData: {}, } }, + mounted() { + this.addClipboardListener() + }, + beforeUnmount() { + this.removeClipboardListener() + }, methods: { myself(item) { return item.userId === this.$store.state.moderator.id @@ -201,28 +219,39 @@ export default { this.$emit('update-contributions') }, rowToggleDetails(row, index) { - if (this.openRow) { - if (this.openRow.index === row.index) { - if (index === this.slotIndex) { - row.toggleDetails() - this.openRow = null - } else { - this.slotIndex = index - } - } else { - this.openRow.toggleDetails() - row.toggleDetails() - this.slotIndex = index - this.openRow = row - this.creationUserData = row.item - } + const isSameRow = this.openRow && this.openRow.index === row.index + const isSameSlot = index === this.slotIndex + + if (isSameRow && isSameSlot) { + row.toggleDetails() + this.openRow = null } else { + if (this.openRow) { + this.openRow.toggleDetails() + } row.toggleDetails() this.slotIndex = index this.openRow = row this.creationUserData = row.item } }, + addClipboardListener() { + document.addEventListener('copy', this.handleCopy) + }, + removeClipboardListener() { + document.removeEventListener('copy', this.handleCopy) + }, + handleCopy(event) { + // get from user selected text + const selectedText = window.getSelection().toString() + + if (selectedText) { + // remove hashtags + const cleanedText = selectedText.replace(/#[a-zA-Z0-9_-]*/g, '') + event.clipboardData.setData('text/plain', cleanedText) + event.preventDefault() + } + }, }, } @@ -231,4 +260,8 @@ export default { background-color: #e1a908; border-color: #e1a908; } + +.no-select { + user-select: none; +} diff --git a/admin/src/components/input/LabeledInput.vue b/admin/src/components/input/LabeledInput.vue new file mode 100644 index 000000000..920fceacd --- /dev/null +++ b/admin/src/components/input/LabeledInput.vue @@ -0,0 +1,45 @@ + + + diff --git a/admin/src/components/input/ValidatedInput.vue b/admin/src/components/input/ValidatedInput.vue new file mode 100644 index 000000000..2ee340eec --- /dev/null +++ b/admin/src/components/input/ValidatedInput.vue @@ -0,0 +1,86 @@ + + + diff --git a/admin/src/config/index.js b/admin/src/config/index.js index 03d542bfa..684b568ef 100644 --- a/admin/src/config/index.js +++ b/admin/src/config/index.js @@ -6,7 +6,7 @@ const pkg = require('../../package') const version = { ADMIN_MODULE_PROTOCOL: process.env.ADMIN_MODULE_PROTOCOL ?? 'http', - ADMIN_MODULE_HOST: process.env.ADMIN_MODULE_HOST ?? 'localhost', + ADMIN_MODULE_HOST: process.env.ADMIN_MODULE_HOST ?? '0.0.0.0', ADMIN_MODULE_PORT: process.env.ADMIN_MODULE_PORT ?? '8080', APP_VERSION: pkg.version, BUILD_COMMIT: process.env.BUILD_COMMIT ?? undefined, @@ -50,12 +50,17 @@ const endpoints = { const debug = { DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' ?? false, } +const humhub = { + HUMHUB_ACTIVE: process.env.HUMHUB_ACTIVE === 'true' || false, + HUMHUB_API_URL: process.env.HUMHUB_API_URL ?? COMMUNITY_URL + '/community/', +} const CONFIG = { ...version, ...environment, ...endpoints, ...debug, + ...humhub, ADMIN_MODULE_URL, COMMUNITY_URL, } diff --git a/admin/src/config/schema.js b/admin/src/config/schema.js index 7aee8136f..88847f347 100644 --- a/admin/src/config/schema.js +++ b/admin/src/config/schema.js @@ -5,6 +5,8 @@ const { COMMUNITY_URL, DEBUG, GRAPHQL_URI, + HUMHUB_ACTIVE, + HUMHUB_API_URL, NODE_ENV, PRODUCTION, } = require('gradido-config/build/src/commonSchema.js') @@ -17,6 +19,8 @@ module.exports = Joi.object({ COMMUNITY_URL, DEBUG, GRAPHQL_URI, + HUMHUB_ACTIVE, + HUMHUB_API_URL, NODE_ENV, PRODUCTION, diff --git a/admin/src/graphql/adminListContributions.js b/admin/src/graphql/adminListContributions.js index aa6c0c713..b37988233 100644 --- a/admin/src/graphql/adminListContributions.js +++ b/admin/src/graphql/adminListContributions.js @@ -26,6 +26,9 @@ export const adminListContributions = gql` id firstName lastName + email + username + humhubUsername amount memo createdAt diff --git a/admin/src/graphql/fragments.graphql b/admin/src/graphql/fragments.graphql new file mode 100644 index 000000000..77bf61a7c --- /dev/null +++ b/admin/src/graphql/fragments.graphql @@ -0,0 +1,23 @@ + +fragment SpaceFields on Space { + id + name + description + url +} + +fragment PaginationFields on Pagination { + total + page + pages +} + +fragment ProjectBrandingCommonFields on ProjectBranding { + id + name + alias + description + spaceId + newUserToSpace + logoUrl +} diff --git a/admin/src/graphql/projectBranding.graphql b/admin/src/graphql/projectBranding.graphql new file mode 100644 index 000000000..98f38dab0 --- /dev/null +++ b/admin/src/graphql/projectBranding.graphql @@ -0,0 +1,35 @@ +#import './fragments.graphql' + +query projectBrandings { + projectBrandings { + ...ProjectBrandingCommonFields + } +} + +mutation upsertProjectBranding($input: ProjectBrandingInput!) { + upsertProjectBranding(input: $input) { + ...ProjectBrandingCommonFields + } +} + +mutation deleteProjectBranding($id: ID!) { + deleteProjectBranding(id: $id) +} + +query spaces($page: Int!, $limit: Int!) { + spaces(page: $page, limit: $limit) { + pagination { + ...PaginationFields + } + results { + ...SpaceFields + } + } +} + +query spaceWithNameAndDescription($id: ID!) { + space(id: $id) { + name + description + } +} \ No newline at end of file diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 22bb1d614..a5c4d2e37 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -1,5 +1,7 @@ { "GDD": "GDD", + "actions": "Aktionen", + "alias": "Alias", "all_emails": "Alle Nutzer", "back": "zurück", "change_user_role": "Nutzerrolle ändern", @@ -33,7 +35,8 @@ "validTo": "Enddatum" }, "contributionMessagesForm": { - "resubmissionDateInPast": "Wiedervorlage Datum befindet sich in der Vergangenheit!" + "resubmissionDateInPast": "Wiedervorlage Datum befindet sich in der Vergangenheit!", + "hasRegisteredAt": "hat sich am {createdAt} registriert." }, "contributions": { "all": "Alle", @@ -42,6 +45,8 @@ "denied": "Abgelehnt", "open": "Offen" }, + "copied-to-clipboard": "In die Zwischenablage kopiert", + "copy-to-clipboard": "In die Zwischenablage kopieren", "created": "Geschöpft", "createdAt": "Angelegt", "creation": "Schöpfung", @@ -68,6 +73,8 @@ "deleted": "gelöscht", "deleted_user": "Alle gelöschten Nutzer", "deny": "Ablehnen", + "description": "Beschreibung", + "details": "Details", "e_mail": "E-Mail", "edit": "bearbeiten", "enabled": "aktiviert", @@ -92,6 +99,9 @@ "verified": "Verifiziert", "verifiedAt": "Verifiziert am" }, + "filter": { + "byEmail": "Nach E-Mail filtern" + }, "firstname": "Vorname", "footer": { "app_version": "App version {version}", @@ -112,6 +122,10 @@ "describe": "Teilt Koordinaten im Format 'Breitengrad, Längengrad' automatisch auf. Fügen sie hier einfach z.B. ihre Koordinaten von Google Maps, zum Beispiel: 49.28187664243721, 9.740672183943639, ein." } }, + "goTo": { + "userSearch": "Zur Nutzersuche gehen", + "humhubProfile": "Zum Humhub Profil gehen" + }, "help": { "help": "Hilfe", "transactionlist": { @@ -127,6 +141,8 @@ "lastname": "Nachname", "latitude": "Breitengrad:", "latitude-longitude-smart": "Breitengrad, Längengrad", + "link": "Link", + "logo": "Logo", "longitude": "Längengrad:", "math": { "equals": "=", @@ -134,7 +150,7 @@ "plus": "+" }, "message": { - "request": "Die Anfrage wurde gesendet." + "request": "Die Eingabe wurde gespeichert." }, "moderator": { "history": "Die Daten wurden geändert. Dies sind die alten Daten.", @@ -155,6 +171,8 @@ "instances": "Instanzen", "logout": "Abmelden", "my-account": "Mein Konto", + "projectBranding": "Projekt Branding", + "projectBrandingTooltip": "Nutze ein eigenes Logo im Gradido Login und füge neue Benutzer einem Humhub-Space hinzu", "statistic": "Statistik", "user_search": "Nutzersuche" }, @@ -199,8 +217,24 @@ "yes": "Ja, Nutzer wiederherstellen" } }, + "projectBranding": { + "addTooltip": "Neuen Projekt Branding Eintrag hinzufügen", + "chosenSpace": "Gewählter Space: {space}", + "created": "Neuer Projekt Branding Eintrag wurde erstellt.", + "error": "Fehler beim Erstellen des Projekt Branding Eintrags: {message}", + "noAccessRightSpace": "Gewählter Space: {spaceId} (Keine Zugriffsrechte)", + "openSpaceInHumhub": "In Humhub öffnen", + "spaceId": "Humhub Space ID", + "selectSpace": "Humhub Space auswählen", + "title": "Projekt Brandings", + "updated": "Projekt Branding Eintrag wurde aktualisiert.", + "newUserToSpace": "Benutzer hinzufügen?", + "newUserToSpaceTooltip": "Neue Benutzer automatisch zum Space hinzufügen, falls Space vorhanden" + }, "redeemed": "eingelöst", + "registered": "Registriert", "removeNotSelf": "Als Admin/Moderator kannst du dich nicht selber löschen.", + "reset": "Zurücksetzen", "save": "Speichern", "statistic": { "activeUsers": "Aktive Mitglieder", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index c8c45a7a0..b3f500564 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -1,5 +1,7 @@ { "GDD": "GDD", + "actions": "Actions", + "alias": "Alias", "all_emails": "All users", "back": "back", "change_user_role": "Change user role", @@ -33,7 +35,8 @@ "validTo": "End-Date" }, "contributionMessagesForm": { - "resubmissionDateInPast": "Resubmission date is in the past!" + "resubmissionDateInPast": "Resubmission date is in the past!", + "hasRegisteredAt": "registered on {createdAt}." }, "contributions": { "all": "All", @@ -42,6 +45,8 @@ "denied": "Rejected", "open": "Open" }, + "copied-to-clipboard": "Copied to clipboard", + "copy-to-clipboard": "Copy to clipboard", "created": "Created for", "createdAt": "Created at", "creation": "Creation", @@ -68,6 +73,8 @@ "deleted": "deleted", "deleted_user": "All deleted user", "deny": "Reject", + "description": "Description", + "details": "Details", "e_mail": "E-mail", "edit": "edit", "enabled": "enabled", @@ -92,6 +99,9 @@ "verified": "Verified", "verifiedAt": "Verified at" }, + "filter": { + "byEmail": "Filter by email" + }, "firstname": "Firstname", "footer": { "app_version": "App version {version}", @@ -112,6 +122,10 @@ "describe": "Automatically splits coordinates in the format 'latitude, longitude'. Simply enter your coordinates from Google Maps here, for example: 49.28187664243721, 9.740672183943639." } }, + "goTo": { + "userSearch": "Go to user search", + "humhubProfile": "Go to Humhub profile" + }, "help": { "help": "Help", "transactionlist": { @@ -127,6 +141,8 @@ "lastname": "Lastname", "latitude": "Latitude:", "latitude-longitude-smart": "Latitude, Longitude", + "link": "Link", + "logo": "Logo", "longitude": "Longitude:", "math": { "equals": "=", @@ -134,7 +150,7 @@ "plus": "+" }, "message": { - "request": "Request has been sent." + "request": "The entry has been saved." }, "moderator": { "history": "The data has been changed. This is the old data.", @@ -155,6 +171,8 @@ "instances": "Instances", "logout": "Logout", "my-account": "My Account", + "projectBranding": "Project Branding", + "projectBrandingTooltip": "Use your own logo in the Gradido login and add new users to a Humhub space", "statistic": "Statistic", "user_search": "User search" }, @@ -199,9 +217,25 @@ "yes": "Yes,undelete user" } }, + "projectBranding": { + "addTooltip": "Add new project branding entry", + "chosenSpace": "Choosen Humhub Space: {space}", + "created": "New project branding entry has been created.", + "error": "Error when creating the project branding entry: {message}", + "noAccessRightSpace": "Selected space: {spaceId} (No access rights)", + "openSpaceInHumhub": "Open in Humhub", + "spaceId": "Humhub Space ID", + "selectSpace": "Select Humhub Space", + "title": "Project Branding", + "updated": "Project branding entry has been updated.", + "newUserToSpace": "Add user?", + "newUserToSpaceTooltip": "The hours should contain a maximum of two decimal places" + }, "redeemed": "redeemed", + "registered": "Registered", "removeNotSelf": "As an admin/moderator, you cannot delete yourself.", - "save": "Speichern", + "reset": "Reset", + "save": "Save", "statistic": { "activeUsers": "Active members", "count": "Count", diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 4fe2f80af..d9497df7a 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -58,6 +58,7 @@ @update-status="updateStatus" @reload-contribution="reloadContribution" @update-contributions="refetch" + @search-for-email="query = $event" /> formatDateOrDash(value), }, { key: 'moderatorId', label: t('moderator.moderator') }, - { key: 'editCreation', label: t('chat') }, + { key: 'editCreation', label: t('details') }, { key: 'confirm', label: t('save') }, ], // confirmed contributions @@ -181,7 +182,7 @@ const fields = computed( formatter: (value) => formatDateOrDash(value), }, { key: 'confirmedBy', label: t('moderator.moderator') }, - { key: 'chatCreation', label: t('chat') }, + { key: 'chatCreation', label: t('details') }, ], // denied contributions [ @@ -209,7 +210,7 @@ const fields = computed( formatter: (value) => formatDateOrDash(value), }, { key: 'deniedBy', label: t('moderator.moderator') }, - { key: 'chatCreation', label: t('chat') }, + { key: 'chatCreation', label: t('details') }, ], // deleted contributions [ @@ -237,7 +238,7 @@ const fields = computed( formatter: (value) => formatDateOrDash(value), }, { key: 'deletedBy', label: t('moderator.moderator') }, - { key: 'chatCreation', label: t('chat') }, + { key: 'chatCreation', label: t('details') }, ], // all contributions [ @@ -266,7 +267,7 @@ const fields = computed( formatter: (value) => formatDateOrDash(value), }, { key: 'confirmedBy', label: t('moderator.moderator') }, - { key: 'chatCreation', label: t('chat') }, + { key: 'chatCreation', label: t('details') }, ], ][tabIndex.value], ) diff --git a/admin/src/pages/ProjectBranding.vue b/admin/src/pages/ProjectBranding.vue new file mode 100644 index 000000000..925a0f75e --- /dev/null +++ b/admin/src/pages/ProjectBranding.vue @@ -0,0 +1,109 @@ + + + diff --git a/admin/src/pages/UserSearch.spec.js b/admin/src/pages/UserSearch.spec.js index c363eaf1c..6a1de70a8 100644 --- a/admin/src/pages/UserSearch.spec.js +++ b/admin/src/pages/UserSearch.spec.js @@ -15,6 +15,11 @@ vi.mock('@/composables/useToast', () => ({ toastSuccess: vi.fn(), }), })) +vi.mock('vue-router', () => ({ + useRoute: () => ({ + query: {}, + }), +})) // Mock icon components const mockIconComponent = { diff --git a/admin/src/pages/UserSearch.vue b/admin/src/pages/UserSearch.vue index 72fa15934..78bfc7e90 100644 --- a/admin/src/pages/UserSearch.vue +++ b/admin/src/pages/UserSearch.vue @@ -43,8 +43,9 @@ diff --git a/frontend/src/components/Contributions/ContributionListItem.spec.js b/frontend/src/components/Contributions/ContributionListItem.spec.js index 5abb1f8b6..eb5fb1247 100644 --- a/frontend/src/components/Contributions/ContributionListItem.spec.js +++ b/frontend/src/components/Contributions/ContributionListItem.spec.js @@ -22,6 +22,12 @@ vi.mock('@vue/apollo-composable', () => ({ })), })) +vi.mock('@/composables/useToast', () => ({ + useAppToast: vi.fn(() => ({ + addToast: vi.fn(), + })), +})) + describe('ContributionListItem', () => { let wrapper diff --git a/frontend/src/components/Menu/NavItem.vue b/frontend/src/components/Menu/NavItem.vue new file mode 100644 index 000000000..af8760dce --- /dev/null +++ b/frontend/src/components/Menu/NavItem.vue @@ -0,0 +1,19 @@ + + + diff --git a/frontend/src/components/Menu/Navbar.vue b/frontend/src/components/Menu/Navbar.vue index 50645ed65..958405b45 100644 --- a/frontend/src/components/Menu/Navbar.vue +++ b/frontend/src/components/Menu/Navbar.vue @@ -79,18 +79,10 @@ export default { height: 150px; } -.auth-navbar > .nav-link { - color: #383838 !important; -} - .navbar-toggler { font-size: 2.25rem; } -.auth-navbar > .router-link-exact-active { - color: #0e79bc !important; -} - button.navbar-toggler > span.navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(4, 112, 6, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); } diff --git a/frontend/src/components/Menu/Sidebar.vue b/frontend/src/components/Menu/Sidebar.vue index 684405f2c..5c623d961 100644 --- a/frontend/src/components/Menu/Sidebar.vue +++ b/frontend/src/components/Menu/Sidebar.vue @@ -10,31 +10,31 @@ @@ -49,7 +49,7 @@ > diff --git a/frontend/src/components/TransactionLinks/TransactionLink.vue b/frontend/src/components/TransactionLinks/TransactionLink.vue index 6cc086e0f..2f414f894 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.vue +++ b/frontend/src/components/TransactionLinks/TransactionLink.vue @@ -35,7 +35,7 @@ class="pt-3 pb-3 test-qr-code" @click.stop="toggleQrModal" > - + {{ $t('qrCode') }} diff --git a/frontend/src/graphql/mutations.js b/frontend/src/graphql/mutations.js index 330790d07..e1e3bf7db 100644 --- a/frontend/src/graphql/mutations.js +++ b/frontend/src/graphql/mutations.js @@ -68,6 +68,7 @@ export const createUser = gql` $language: String! $publisherId: Int $redeemCode: String + $project: String ) { createUser( email: $email @@ -76,6 +77,7 @@ export const createUser = gql` language: $language publisherId: $publisherId redeemCode: $redeemCode + project: $project ) { id } @@ -166,8 +168,8 @@ export const createContributionMessage = gql` ` export const login = gql` - mutation ($email: String!, $password: String!, $publisherId: Int) { - login(email: $email, password: $password, publisherId: $publisherId) { + mutation ($email: String!, $password: String!, $publisherId: Int, $project: String) { + login(email: $email, password: $password, publisherId: $publisherId, project: $project) { gradidoID alias firstName diff --git a/frontend/src/graphql/projectBranding.graphql b/frontend/src/graphql/projectBranding.graphql new file mode 100644 index 000000000..7441ae8c3 --- /dev/null +++ b/frontend/src/graphql/projectBranding.graphql @@ -0,0 +1,3 @@ +query projectBrandingBanner($project: String!) { + projectBrandingBanner(alias: $project) +} diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 0d4858e98..b1ae7bed8 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -42,6 +42,11 @@ export const authenticateHumhubAutoLogin = gql` authenticateHumhubAutoLogin } ` +export const authenticateHumhubAutoLoginProject = gql` + query ($project: String!) { + authenticateHumhubAutoLogin(project: $project) + } +` export const transactionsQuery = gql` query ($currentPage: Int = 1, $pageSize: Int = 25, $order: Order = DESC) { diff --git a/frontend/src/layouts/AuthLayout.spec.js b/frontend/src/layouts/AuthLayout.spec.js index 24bb09f15..bf60678e1 100644 --- a/frontend/src/layouts/AuthLayout.spec.js +++ b/frontend/src/layouts/AuthLayout.spec.js @@ -1,5 +1,6 @@ import { describe, it, expect, beforeEach, vi } from 'vitest' import { mount } from '@vue/test-utils' +import { createStore } from 'vuex' import AuthLayout from './AuthLayout' import { BAvatar, @@ -39,6 +40,19 @@ vi.mock('@/config', () => ({ describe('AuthLayout', () => { let wrapper + const createVuexStore = () => { + return createStore({ + state: { + project: '', + }, + actions: { + project: vi.fn(), + }, + mutations: { + project: vi.fn(), + }, + }) + } const createWrapper = () => { return mount(AuthLayout, { @@ -54,6 +68,7 @@ describe('AuthLayout', () => { BImg, BPopover, }, + plugins: [createVuexStore()], mocks: { $i18n: { locale: 'en', @@ -97,17 +112,16 @@ describe('AuthLayout', () => { expect(wrapper.find('nav#sidenav-main').exists()).toBe(false) }) - it('has LanguageSwitch2', () => { - expect(wrapper.findComponent({ name: 'LanguageSwitch2' }).exists()).toBe(true) - }) - it('displays the community name', () => { expect(wrapper.find('.h1').text()).toBe('Test Community') }) it('test size in setTextSize', async () => { + const mockEl = { style: {} } + vi.spyOn(document, 'querySelector').mockReturnValue(mockEl) + await wrapper.vm.setTextSize(0.85) - expect(wrapper.vm.$refs.pageFontSize.$el.style.fontSize).toBe('0.85rem') + expect(mockEl.style.fontSize).toBe('0.85rem') }) }) @@ -115,6 +129,7 @@ describe('AuthLayout', () => { beforeEach(() => { wrapper = mount(AuthLayout, { global: { + plugins: [createVuexStore()], mocks: { $i18n: { locale: 'en', diff --git a/frontend/src/layouts/AuthLayout.vue b/frontend/src/layouts/AuthLayout.vue index bc77b102f..e9f0aeaf7 100644 --- a/frontend/src/layouts/AuthLayout.vue +++ b/frontend/src/layouts/AuthLayout.vue @@ -19,11 +19,21 @@
- + - + + + + + +
{{ $t('welcome') }}
{{ communityName }}
@@ -33,7 +43,7 @@
- + @@ -61,7 +71,14 @@ + -