diff --git a/.circleci/config.yml b/.circleci/config.yml index 251a81ce82..398173d5de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -246,11 +246,10 @@ jobs: - post_steps e2e-test: docker: - - image: mcr.microsoft.com/playwright:v1.47.0-jammy + - image: mcr.microsoft.com/playwright:v1.48.0-jammy steps: - checkout - run: npm i -D @playwright/test - - run: npx playwright install chrome - run: name: Install dependencies command: yarn install @@ -274,6 +273,7 @@ jobs: - run: name: Test nuxt ssr catalogue tests command: | + yarn playwright install chrome echo "PR number: ${CIRCLE_PULL_REQUEST##*/}" export E2E_BASE_URL=https://preview-emx2-pr-${CIRCLE_PULL_REQUEST##*/}.dev.molgenis.org/ echo $E2E_BASE_URL @@ -281,7 +281,8 @@ jobs: working_directory: apps/nuxt3-ssr - run: name: Run non ssr e2e tests - command: | + command: | + npx playwright install chrome echo "PR number: ${CIRCLE_PULL_REQUEST##*/}" export E2E_BASE_URL=https://preview-emx2-pr-${CIRCLE_PULL_REQUEST##*/}.dev.molgenis.org/ echo $E2E_BASE_URL diff --git a/apps/central/src/components/Groups.vue b/apps/central/src/components/Groups.vue index 50430fd574..a66487715b 100644 --- a/apps/central/src/components/Groups.vue +++ b/apps/central/src/components/Groups.vue @@ -20,20 +20,6 @@ /> - - Show changelog - - - Hide changelog - @@ -90,14 +76,8 @@ @@ -167,8 +147,7 @@ export default { search: null, sortColumn: "name", sortOrder: null, - changelogSchemas: [], - showChangeColumn: false, + lastUpdates: [], }; }, computed: { @@ -186,8 +165,8 @@ export default { this.session.roles.includes("Manager")) ); }, - showChangeColumnButton() { - return this.hasManagerPermission; + showChangeColumn() { + return this.session.email == "admin"; }, }, created() { @@ -219,34 +198,31 @@ export default { }, getSchemaList() { this.loading = true; - request("graphql", "{_schemas{id,label,description}}") + const schemaFragment = "_schemas{id,label,description}"; + const lastUpdateFragment = + "_lastUpdate{schemaName, tableName, stamp, userId, operation}"; + request( + "graphql", + `{${schemaFragment} ${this.showChangeColumn ? lastUpdateFragment : ""}}` + ) .then((data) => { this.schemas = data._schemas; - this.loading = false; - if (this.hasManagerPermission && this.showChangeColumn) { - this.fetchChangelogStatus(); - } - }) - .catch( - (error) => - (this.graphqlError = "internal server graphqlError" + error) - ); - }, - fetchChangelogStatus() { - this.schemas.forEach((schema) => { - request( - `/${schema.id}/settings/graphql`, - `{_settings (keys: ["isChangelogEnabled"]){ key, value }}` - ) - .then((data) => { - if (data._settings[0].value.toLowerCase() === "true") { - this.changelogSchemas.push(schema.id); + const lastUpdates = data._lastUpdate ?? []; + lastUpdates.forEach((lastUpdate) => { + const schemaLastUpdate = this.schemas.find( + (schema) => schema.id === lastUpdate.schemaName + ); + if (schemaLastUpdate) { + schemaLastUpdate.update = lastUpdate; } - }) - .catch((error) => { - console.log(error); }); - }); + this.loading = false; + }) + .catch((error) => { + console.error("internal server error", error); + this.graphqlError = "internal server error" + error; + this.loading = false; + }); }, filterSchema(unfiltered) { let filtered = unfiltered; @@ -268,7 +244,7 @@ export default { if (this.sortColumn === "lastUpdate") { sorted = unsortedCopy.sort((a, b) => { if (a.update && b.update) { - return a.update.getTime() - b.update.getTime(); + return new Date(a.update.stamp) - new Date(b.update.stamp); } else if (a.update && !b.update) { return 1; } else if (!a.update && b.update) { diff --git a/apps/central/src/components/LastUpdateField.vue b/apps/central/src/components/LastUpdateField.vue index dc6c6a86cb..63384bd52f 100644 --- a/apps/central/src/components/LastUpdateField.vue +++ b/apps/central/src/components/LastUpdateField.vue @@ -1,56 +1,23 @@ - diff --git a/apps/tailwind-components/components/content/ContentBlockData.vue b/apps/nuxt3-ssr/components/content/ContentBlockData.vue similarity index 93% rename from apps/tailwind-components/components/content/ContentBlockData.vue rename to apps/nuxt3-ssr/components/content/ContentBlockData.vue index 8633cf13be..ff2715915d 100644 --- a/apps/tailwind-components/components/content/ContentBlockData.vue +++ b/apps/nuxt3-ssr/components/content/ContentBlockData.vue @@ -1,8 +1,10 @@