diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e225fa99b..86979751d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,7 @@ jobs: ########################################################################## - name: Frontend | Build `production` image run: | - docker build --target production -t "gradido/frontend:latest" -t "gradido/frontend:production" -t "gradido/frontend:${VERSION}" -t "gradido/frontend:${BUILD_VERSION}" frontend/ + docker build -f ./frontend/Dockerfile --target production -t "gradido/frontend:latest" -t "gradido/frontend:production" -t "gradido/frontend:${VERSION}" -t "gradido/frontend:${BUILD_VERSION}" . docker save "gradido/frontend" > /tmp/frontend.tar - name: Upload Artifact uses: actions/upload-artifact@v4 @@ -43,6 +43,43 @@ jobs: name: docker-frontend-production path: /tmp/frontend.tar + ############################################################################## + # JOB: DOCKER BUILD PRODUCTION ADMIN ######################################### + ############################################################################## + build_production_admin: + name: Docker Build Production - Admin + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v4 + ########################################################################## + # SET ENVS ############################################################### + ########################################################################## + - name: ENV - VERSION + run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - BUILD_VERSION + run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + ########################################################################## + # ADMIN ################################################################## + ########################################################################## + - name: Admin | Build `production` image + run: | + docker build -f ./admin/Dockerfile --target production -t "gradido/admin:latest" -t "gradido/admin:production" -t "gradido/admin:${VERSION}" -t "gradido/admin:${BUILD_VERSION}" . + docker save "gradido/admin" > /tmp/admin.tar + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: docker-admin-production + path: /tmp/admin.tar + ############################################################################## # JOB: DOCKER BUILD PRODUCTION BACKEND ####################################### ############################################################################## @@ -170,14 +207,14 @@ jobs: ########################################################################## # DATABASE UP ############################################################ ########################################################################## - - name: Database | Build `production_up` image + - name: Database | Build `up` image run: | - docker build --target production_up -t "gradido/database:production_up" database/ - docker save "gradido/database:production_up" > /tmp/database_up.tar + docker build --target up -t "gradido/database:up" database/ + docker save "gradido/database:up" > /tmp/database_up.tar - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: docker-database-production_up + name: docker-database-up path: /tmp/database_up.tar ############################################################################## @@ -243,6 +280,13 @@ jobs: path: /tmp - name: Load Docker Image run: docker load < /tmp/frontend.tar + - name: Download Docker Image (Admin) + uses: actions/download-artifact@v4 + with: + name: docker-admin-production + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/admin.tar - name: Download Docker Image (Backend) uses: actions/download-artifact@v4 with: @@ -267,7 +311,7 @@ jobs: - name: Download Docker Image (Database) uses: actions/download-artifact@v4 with: - name: docker-database-production_up + name: docker-database-up path: /tmp - name: Load Docker Image run: docker load < /tmp/database_up.tar @@ -287,6 +331,8 @@ jobs: run: echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin - name: Push frontend run: docker push --all-tags gradido/frontend + - name: Push admin + run: docker push --all-tags gradido/admin - name: Push backend run: docker push --all-tags gradido/backend - name: Push dht-node diff --git a/.gitignore b/.gitignore index 149d8d245..3d7f34078 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.log *.bak .turbo +vite.config.mjs.timestamp-* /node_modules/* messages.pot nbproject diff --git a/admin/Dockerfile b/admin/Dockerfile index 3069db630..0ad7be7af 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -14,9 +14,9 @@ ENV BUILD_DATE="1970-01-01T00:00:00.00Z" ARG BUILD_VERSION ENV BUILD_VERSION=${BUILD_VERSION:-'broken'} ARG BUILD_COMMIT -ENV BUILD_COMMIT=${BUILD_COMMIT:-'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef'} +ENV BUILD_COMMIT=${BUILD_COMMIT:-'decafcabdecafcabdecafcabdecafcabdecafcab'} ARG BUILD_COMMIT_SHORT -ENV BUILD_COMMIT_SHORT=${BUILD_COMMIT_SHORT:-'deadbeef'} +ENV BUILD_COMMIT_SHORT=${BUILD_COMMIT_SHORT:-'decafcab'} ## SET NODE_ENV ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV} diff --git a/admin/package.json b/admin/package.json index bb1854f95..d98e10209 100644 --- a/admin/package.json +++ b/admin/package.json @@ -11,12 +11,15 @@ "start": "vite preview", "postbuild": "uname | grep -q Linux && find build -type f -regex '.*\\.\\(html\\|js\\|css\\|svg\\|json\\)' -exec gzip -9 -k {} + || echo 'Skip precompress on non-Linux'", "lint": "eslint --max-warnings=0 --ext .js,.vue,.json .", + "lint:fix": "eslint --max-warnings=0 --ext .js,.vue,.json . --fix", "stylelint": "stylelint --max-warnings=0 '**/*.{scss,vue}'", + "stylelint:fix": "stylelint --max-warnings=0 '**/*.{scss,vue}' --fix", "test": "cross-env TZ=UTC vitest run", "test:coverage": "cross-env TZ=UTC vitest run --coverage", "test:debug": "cross-env TZ=UTC node --inspect-brk ./node_modules/vitest/vitest.mjs", "test:watch": "cross-env TZ=UTC vitest", - "locales": "scripts/sort.sh" + "locales": "scripts/sort.sh", + "locales:fix": "scripts/sort.sh --fix" }, "dependencies": { "@iconify/json": "^2.2.228", diff --git a/admin/src/components/ContributionMessages/ContributionMessagesList.spec.js b/admin/src/components/ContributionMessages/ContributionMessagesList.spec.js index a47c78601..d737a32c9 100644 --- a/admin/src/components/ContributionMessages/ContributionMessagesList.spec.js +++ b/admin/src/components/ContributionMessages/ContributionMessagesList.spec.js @@ -108,7 +108,7 @@ describe('ContributionMessagesList', () => { id: 42, memo: 'test memo', userId: 108, - status: 'PENDING', + contributionStatus: 'PENDING', user: defaultUser, }, hideResubmission: true, @@ -153,7 +153,7 @@ describe('ContributionMessagesList', () => { it('does not render the ContributionMessagesFormular when status is not PENDING or IN_PROGRESS', async () => { await wrapper.setProps({ contribution: { - status: 'COMPLETED', + contributionStatus: 'COMPLETED', user: defaultUser, }, }) diff --git a/admin/src/components/ContributionMessages/ContributionMessagesList.vue b/admin/src/components/ContributionMessages/ContributionMessagesList.vue index 09b5a69ac..343bc7ad6 100644 --- a/admin/src/components/ContributionMessages/ContributionMessagesList.vue +++ b/admin/src/components/ContributionMessages/ContributionMessagesList.vue @@ -41,7 +41,12 @@ /> -
+
{ expect(fields[0].key).toBe('createdAt') expect(fields[1].key).toBe('contributionDate') expect(fields[2].key).toBe('confirmedAt') - expect(fields[3].key).toBe('status') + expect(fields[3].key).toBe('contributionStatus') expect(fields[4].key).toBe('amount') expect(fields[5].key).toBe('memo') }) diff --git a/admin/src/components/CreationTransactionList.vue b/admin/src/components/CreationTransactionList.vue index 09dd41901..fe26bacd2 100644 --- a/admin/src/components/CreationTransactionList.vue +++ b/admin/src/components/CreationTransactionList.vue @@ -80,7 +80,7 @@ const fields = [ }, }, { - key: 'status', + key: 'contributionStatus', label: t('transactionlist.status'), }, { diff --git a/admin/src/components/Overlay.spec.js b/admin/src/components/Overlay.spec.js index 32053572d..77df17623 100644 --- a/admin/src/components/Overlay.spec.js +++ b/admin/src/components/Overlay.spec.js @@ -19,9 +19,13 @@ describe('Overlay', () => { amount: '100', contributionDate: '2023-01-15T00:00:00.000Z', memo: 'Test memo', - firstName: 'John', - lastName: 'Doe', - email: 'john.doe@example.com', + user: { + firstName: 'John', + lastName: 'Doe', + emailContact: { + email: 'john.doe@example.com', + }, + }, } beforeEach(() => { diff --git a/admin/src/components/Overlay.vue b/admin/src/components/Overlay.vue index d6d905e00..60f9b4373 100644 --- a/admin/src/components/Overlay.vue +++ b/admin/src/components/Overlay.vue @@ -23,11 +23,11 @@ {{ $t('name') }} - {{ item.firstName }} {{ item.lastName }} + {{ item.user.firstName }} {{ item.user.lastName }} {{ $t('e_mail') }} - {{ item.email }} + {{ item.user.emailContact.email }}
diff --git a/admin/src/components/RowDetails.vue b/admin/src/components/RowDetails.vue index 91c32c73c..9715ef158 100644 --- a/admin/src/components/RowDetails.vue +++ b/admin/src/components/RowDetails.vue @@ -6,7 +6,7 @@ :icon="type === 'PageCreationConfirm' ? 'x' : 'eye-slash-fill'" aria-label="Help" > - {{ $t('hide_details') }} {{ row.item.firstName }} {{ row.item.lastName }} + {{ $t('hide_details') }} {{ row.item.user.firstName }} {{ row.item.user.lastName }} diff --git a/admin/src/components/Tables/OpenCreationsTable.spec.js b/admin/src/components/Tables/OpenCreationsTable.spec.js index e2749329a..055f5bed6 100644 --- a/admin/src/components/Tables/OpenCreationsTable.spec.js +++ b/admin/src/components/Tables/OpenCreationsTable.spec.js @@ -14,12 +14,12 @@ describe('OpenCreationsTable', () => { let store const mockItems = [ - { id: 1, status: 'PENDING', userId: 2, moderatorId: null, messagesCount: 0 }, - { id: 2, status: 'CONFIRMED', userId: 3, moderatorId: 1, messagesCount: 2 }, + { id: 1, contributionStatus: 'PENDING', userId: 2, moderatorId: null, messagesCount: 0 }, + { id: 2, contributionStatus: 'CONFIRMED', userId: 3, moderatorId: 1, messagesCount: 2 }, ] const mockFields = [ - { key: 'status', label: 'Status' }, + { key: 'contributionStatus', label: 'Status' }, { key: 'bookmark', label: 'Bookmark' }, { key: 'memo', label: 'Memo' }, { key: 'editCreation', label: 'Edit' }, @@ -72,7 +72,7 @@ describe('OpenCreationsTable', () => { }) it('applies correct row class based on status', () => { - const rowClass = wrapper.vm.rowClass({ status: 'CONFIRMED' }, 'row') + const rowClass = wrapper.vm.rowClass({ contributionStatus: 'CONFIRMED' }, 'row') expect(rowClass).toBe('table-success') }) diff --git a/admin/src/components/Tables/OpenCreationsTable.vue b/admin/src/components/Tables/OpenCreationsTable.vue index 5bce1bfb7..d94f85bae 100644 --- a/admin/src/components/Tables/OpenCreationsTable.vue +++ b/admin/src/components/Tables/OpenCreationsTable.vue @@ -9,12 +9,12 @@ stacked="md" :tbody-tr-class="rowClass" > -