From 90793d564552290f5fd2709248414b521b91a308 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Fri, 6 Aug 2021 23:53:15 +0200 Subject: [PATCH 01/63] Don't use tags interface for CSV filter (#7258) Fixes #6778 --- .../private/components/filter-sidebar-detail/filter-input.vue | 4 ++++ packages/shared/src/utils/get-filter-operators-for-type.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/app/src/views/private/components/filter-sidebar-detail/filter-input.vue b/app/src/views/private/components/filter-sidebar-detail/filter-input.vue index 6ef7aaffbd..04c67ecc32 100644 --- a/app/src/views/private/components/filter-sidebar-detail/filter-input.vue +++ b/app/src/views/private/components/filter-sidebar-detail/filter-input.vue @@ -126,6 +126,10 @@ export default defineComponent({ return 'interface-select-dropdown'; } + if (props.field.type === 'csv') { + return 'interface-input'; + } + return `interface-${getDefaultInterfaceForType(props.type)}`; }); diff --git a/packages/shared/src/utils/get-filter-operators-for-type.ts b/packages/shared/src/utils/get-filter-operators-for-type.ts index ccc74ef8b1..abfa5fd63e 100644 --- a/packages/shared/src/utils/get-filter-operators-for-type.ts +++ b/packages/shared/src/utils/get-filter-operators-for-type.ts @@ -7,6 +7,7 @@ export function getFilterOperatorsForType(type: Type): ClientFilterOperator[] { case 'json': case 'hash': case 'string': + case 'csv': return [ 'contains', 'ncontains', From f6a7853e7d49612e0cca389c856d4a31a277f095 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Sat, 7 Aug 2021 00:21:50 +0200 Subject: [PATCH 02/63] Rely on `RETURNING` when possible (#7259) * WIP use returning clause instead of max from id * Use returning where applicable, fallback to fetch Fixes #6279 --- api/src/database/index.ts | 5 ++++- api/src/services/items.ts | 26 +++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/api/src/database/index.ts b/api/src/database/index.ts index 14d31b1a4b..9a3b2ed434 100644 --- a/api/src/database/index.ts +++ b/api/src/database/index.ts @@ -53,7 +53,10 @@ export default function getDatabase(): Knex { searchPath: env.DB_SEARCH_PATH, connection: env.DB_CONNECTION_STRING || connectionConfig, log: { - warn: (msg) => logger.warn(msg), + warn: (msg) => { + if (msg.startsWith('.returning()')) return; + return logger.warn(msg); + }, error: (msg) => logger.error(msg), deprecate: (msg) => logger.info(msg), debug: (msg) => logger.debug(msg), diff --git a/api/src/services/items.ts b/api/src/services/items.ts index 8f4aa38718..5fe90a5e10 100644 --- a/api/src/services/items.ts +++ b/api/src/services/items.ts @@ -133,13 +133,15 @@ export class ItemsService implements AbstractSer let primaryKey = payloadWithTypeCasting[primaryKeyField]; try { - await trx.insert(payloadWithoutAliases).into(this.collection); + const result = await trx.insert(payloadWithoutAliases).into(this.collection).returning(primaryKeyField); + primaryKey = result[0]; } catch (err) { throw await translateDatabaseError(err); } - // When relying on a database auto-incremented ID, we'll have to fetch it from the DB in - // order to know what the PK is of the just-inserted item + // Most database support returning, those who don't tend to return the PK anyways + // (MySQL/SQLite). In case the primary key isn't know yet, we'll do a best-attempt at + // fetching it based on the last inserted row if (!primaryKey) { // Fetching it with max should be safe, as we're in the context of the current transaction const result = await trx.max(primaryKeyField, { as: 'id' }).from(this.collection).first(); @@ -162,9 +164,7 @@ export class ItemsService implements AbstractSer item: primaryKey, }; - await trx.insert(activityRecord).into('directus_activity'); - - const { id: activityID } = await trx.max('id', { as: 'id ' }).from('directus_activity').first(); + const activityID = (await trx.insert(activityRecord).into('directus_activity').returning('id'))[0] as number; // If revisions are tracked, create revisions record if (this.schema.collections[this.collection].accountability === 'all') { @@ -176,9 +176,7 @@ export class ItemsService implements AbstractSer delta: JSON.stringify(payload), }; - await trx.insert(revisionRecord).into('directus_revisions'); - - const { id: revisionID } = await trx.max('id', { as: 'id' }).from('directus_revisions').first(); + const revisionID = (await trx.insert(revisionRecord).into('directus_revisions').returning('id'))[0] as number; // Make sure to set the parent field of the child-revision rows const childrenRevisions = [...revisionsM2O, ...revisionsA2O, ...revisionsO2M]; @@ -470,10 +468,7 @@ export class ItemsService implements AbstractSer const activityPrimaryKeys: PrimaryKey[] = []; for (const activityRecord of activityRecords) { - await trx.insert(activityRecord).into('directus_activity'); - const result = await trx.max('id', { as: 'id' }).from('directus_activity').first(); - const primaryKey = result.id; - + const primaryKey = (await trx.insert(activityRecord).into('directus_activity').returning('id'))[0] as number; activityPrimaryKeys.push(primaryKey); } @@ -495,8 +490,9 @@ export class ItemsService implements AbstractSer })); for (let i = 0; i < revisionRecords.length; i++) { - await trx.insert(revisionRecords[i]).into('directus_revisions'); - const { id: revisionID } = await trx.max('id', { as: 'id' }).from('directus_revisions').first(); + const revisionID = ( + await trx.insert(revisionRecords[i]).into('directus_revisions').returning('id') + )[0] as number; if (opts?.onRevisionCreate) { opts.onRevisionCreate(revisionID); From 6b7ee361bafbc4470f83837971b6440dbd0f08e5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Aug 2021 19:22:52 -0400 Subject: [PATCH 03/63] update dependency p-queue to v7 (#7255) Co-authored-by: Renovate Bot --- app/package.json | 2 +- package-lock.json | 44 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/app/package.json b/app/package.json index ac0d88405f..38068dbd28 100644 --- a/app/package.json +++ b/app/package.json @@ -90,6 +90,6 @@ "vuedraggable": "4.0.3" }, "dependencies": { - "p-queue": "^6.6.2" + "p-queue": "^7.0.0" } } diff --git a/package-lock.json b/package-lock.json index 19493dcd48..9daa29a711 100644 --- a/package-lock.json +++ b/package-lock.json @@ -315,7 +315,7 @@ "name": "@directus/app", "version": "9.0.0-rc.88", "dependencies": { - "p-queue": "^6.6.2" + "p-queue": "^7.0.0" }, "devDependencies": { "@directus/docs": "9.0.0-rc.88", @@ -406,6 +406,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "app/node_modules/p-queue": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.1.0.tgz", + "integrity": "sha512-V+0vPJbhYkBqknPp0qnaz+dWcj8cNepfXZcsVIVEHPbFQXMPwrzCNIiM4FoxGtwHXtPzVCPHDvqCr1YrOJX2Gw==", + "dependencies": { + "eventemitter3": "^4.0.7", + "p-timeout": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "app/node_modules/p-timeout": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.0.0.tgz", + "integrity": "sha512-z+bU/N7L1SABsqKnQzvAnINgPX7NHdzwUV+gHyJE7VGNDZSr03rhcPODCZSWiiT9k+gf74QPmzcZzqJRvxYZow==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "docs": { "name": "@directus/docs", "version": "9.0.0-rc.88", @@ -59830,7 +59856,7 @@ "mime": "2.5.2", "mitt": "3.0.0", "nanoid": "3.1.23", - "p-queue": "*", + "p-queue": "^7.0.0", "pinia": "2.0.0-beta.5", "prettier": "2.3.2", "pretty-ms": "7.0.1", @@ -59857,6 +59883,20 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true + }, + "p-queue": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.1.0.tgz", + "integrity": "sha512-V+0vPJbhYkBqknPp0qnaz+dWcj8cNepfXZcsVIVEHPbFQXMPwrzCNIiM4FoxGtwHXtPzVCPHDvqCr1YrOJX2Gw==", + "requires": { + "eventemitter3": "^4.0.7", + "p-timeout": "^5.0.0" + } + }, + "p-timeout": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.0.0.tgz", + "integrity": "sha512-z+bU/N7L1SABsqKnQzvAnINgPX7NHdzwUV+gHyJE7VGNDZSr03rhcPODCZSWiiT9k+gf74QPmzcZzqJRvxYZow==" } } }, From 6eafe0101cb87b241ffefc26decf194972343169 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Aug 2021 09:25:48 -0400 Subject: [PATCH 04/63] update dependency @vitejs/plugin-vue to v1.4.0 (#7263) Co-authored-by: Renovate Bot --- app/package.json | 2 +- package-lock.json | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/package.json b/app/package.json index 38068dbd28..fd1a720b22 100644 --- a/app/package.json +++ b/app/package.json @@ -52,7 +52,7 @@ "@types/mime-types": "2.1.0", "@types/ms": "0.7.31", "@types/qrcode": "1.4.1", - "@vitejs/plugin-vue": "1.3.0", + "@vitejs/plugin-vue": "1.4.0", "@vue/cli-plugin-babel": "4.5.13", "@vue/cli-plugin-router": "4.5.13", "@vue/cli-plugin-typescript": "4.5.13", diff --git a/package-lock.json b/package-lock.json index 9daa29a711..bb23ec190f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -343,7 +343,7 @@ "@types/mime-types": "2.1.0", "@types/ms": "0.7.31", "@types/qrcode": "1.4.1", - "@vitejs/plugin-vue": "1.3.0", + "@vitejs/plugin-vue": "1.4.0", "@vue/cli-plugin-babel": "4.5.13", "@vue/cli-plugin-router": "4.5.13", "@vue/cli-plugin-typescript": "4.5.13", @@ -8328,9 +8328,9 @@ } }, "node_modules/@vitejs/plugin-vue": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.3.0.tgz", - "integrity": "sha512-wJvuJdTBjvucUX0vK4fuy60t+A9bJSZxc59vp1Y+8kiOd0NU5kFt4lay72gMWPeR+lSUjrTmGUq8Uzb99Jbw3A==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.4.0.tgz", + "integrity": "sha512-RkqfJHz9wdLKBp5Yi+kQL8BAljdrvPoccQm2PTZc/UcL4EjD11xsv2PPCduYx2oV1a/bpSKA3sD5sxOHFhz+LA==", "dev": true, "engines": { "node": ">=12.0.0" @@ -59833,7 +59833,7 @@ "@types/mime-types": "2.1.0", "@types/ms": "0.7.31", "@types/qrcode": "1.4.1", - "@vitejs/plugin-vue": "1.3.0", + "@vitejs/plugin-vue": "1.4.0", "@vue/cli-plugin-babel": "4.5.13", "@vue/cli-plugin-router": "4.5.13", "@vue/cli-plugin-typescript": "4.5.13", @@ -67473,9 +67473,9 @@ } }, "@vitejs/plugin-vue": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.3.0.tgz", - "integrity": "sha512-wJvuJdTBjvucUX0vK4fuy60t+A9bJSZxc59vp1Y+8kiOd0NU5kFt4lay72gMWPeR+lSUjrTmGUq8Uzb99Jbw3A==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.4.0.tgz", + "integrity": "sha512-RkqfJHz9wdLKBp5Yi+kQL8BAljdrvPoccQm2PTZc/UcL4EjD11xsv2PPCduYx2oV1a/bpSKA3sD5sxOHFhz+LA==", "dev": true, "requires": {} }, From 11ba37f6c7fc5accbb408febe3c4f1dc49257cae Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Mon, 9 Aug 2021 14:06:21 +0200 Subject: [PATCH 05/63] Move p-queue to app dev dependencies (#7273) --- app/package.json | 4 +--- package-lock.json | 12 +++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/package.json b/app/package.json index fd1a720b22..d52b2bc72f 100644 --- a/app/package.json +++ b/app/package.json @@ -75,6 +75,7 @@ "mime": "2.5.2", "mitt": "3.0.0", "nanoid": "3.1.23", + "p-queue": "7.1.0", "pinia": "2.0.0-beta.5", "prettier": "2.3.2", "pretty-ms": "7.0.1", @@ -88,8 +89,5 @@ "vue-i18n": "9.1.7", "vue-router": "4.0.10", "vuedraggable": "4.0.3" - }, - "dependencies": { - "p-queue": "^7.0.0" } } diff --git a/package-lock.json b/package-lock.json index bb23ec190f..4160fde7d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -314,9 +314,6 @@ "app": { "name": "@directus/app", "version": "9.0.0-rc.88", - "dependencies": { - "p-queue": "^7.0.0" - }, "devDependencies": { "@directus/docs": "9.0.0-rc.88", "@directus/extension-sdk": "9.0.0-rc.88", @@ -366,6 +363,7 @@ "mime": "2.5.2", "mitt": "3.0.0", "nanoid": "3.1.23", + "p-queue": "7.1.0", "pinia": "2.0.0-beta.5", "prettier": "2.3.2", "pretty-ms": "7.0.1", @@ -410,6 +408,7 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.1.0.tgz", "integrity": "sha512-V+0vPJbhYkBqknPp0qnaz+dWcj8cNepfXZcsVIVEHPbFQXMPwrzCNIiM4FoxGtwHXtPzVCPHDvqCr1YrOJX2Gw==", + "dev": true, "dependencies": { "eventemitter3": "^4.0.7", "p-timeout": "^5.0.0" @@ -425,6 +424,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.0.0.tgz", "integrity": "sha512-z+bU/N7L1SABsqKnQzvAnINgPX7NHdzwUV+gHyJE7VGNDZSr03rhcPODCZSWiiT9k+gf74QPmzcZzqJRvxYZow==", + "dev": true, "engines": { "node": ">=12" }, @@ -59856,7 +59856,7 @@ "mime": "2.5.2", "mitt": "3.0.0", "nanoid": "3.1.23", - "p-queue": "^7.0.0", + "p-queue": "7.1.0", "pinia": "2.0.0-beta.5", "prettier": "2.3.2", "pretty-ms": "7.0.1", @@ -59888,6 +59888,7 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.1.0.tgz", "integrity": "sha512-V+0vPJbhYkBqknPp0qnaz+dWcj8cNepfXZcsVIVEHPbFQXMPwrzCNIiM4FoxGtwHXtPzVCPHDvqCr1YrOJX2Gw==", + "dev": true, "requires": { "eventemitter3": "^4.0.7", "p-timeout": "^5.0.0" @@ -59896,7 +59897,8 @@ "p-timeout": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.0.0.tgz", - "integrity": "sha512-z+bU/N7L1SABsqKnQzvAnINgPX7NHdzwUV+gHyJE7VGNDZSr03rhcPODCZSWiiT9k+gf74QPmzcZzqJRvxYZow==" + "integrity": "sha512-z+bU/N7L1SABsqKnQzvAnINgPX7NHdzwUV+gHyJE7VGNDZSr03rhcPODCZSWiiT9k+gf74QPmzcZzqJRvxYZow==", + "dev": true } } }, From b1f1f6d25b1e458f1d0f55de9de435c845e0f9a7 Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Mon, 9 Aug 2021 14:09:20 +0200 Subject: [PATCH 06/63] Log error message when registering app extension fails (#7274) --- app/src/displays/register.ts | 4 +++- app/src/interfaces/register.ts | 4 +++- app/src/layouts/register.ts | 4 +++- app/src/modules/register.ts | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/displays/register.ts b/app/src/displays/register.ts index 0f66442800..94ef6b5b9a 100644 --- a/app/src/displays/register.ts +++ b/app/src/displays/register.ts @@ -15,9 +15,11 @@ export async function registerDisplays(app: App): Promise { : await import(/* @vite-ignore */ `${getRootPath()}extensions/displays/index.js`); displays.push(...customDisplays.default); - } catch { + } catch (err) { // eslint-disable-next-line no-console console.warn(`Couldn't load custom displays`); + // eslint-disable-next-line no-console + console.warn(err); } displaysRaw.value = displays; diff --git a/app/src/interfaces/register.ts b/app/src/interfaces/register.ts index 779b3654ef..d5a6d46ae0 100644 --- a/app/src/interfaces/register.ts +++ b/app/src/interfaces/register.ts @@ -16,9 +16,11 @@ export async function registerInterfaces(app: App): Promise { : await import(/* @vite-ignore */ `${getRootPath()}extensions/interfaces/index.js`); interfaces.push(...customInterfaces.default); - } catch { + } catch (err) { // eslint-disable-next-line no-console console.warn(`Couldn't load custom interfaces`); + // eslint-disable-next-line no-console + console.warn(err); } interfacesRaw.value = interfaces; diff --git a/app/src/layouts/register.ts b/app/src/layouts/register.ts index f6b6e7d2c2..92fabe8538 100644 --- a/app/src/layouts/register.ts +++ b/app/src/layouts/register.ts @@ -16,9 +16,11 @@ export async function registerLayouts(app: App): Promise { : await import(/* @vite-ignore */ `${getRootPath()}extensions/layouts/index.js`); layouts.push(...customLayouts.default); - } catch { + } catch (err) { // eslint-disable-next-line no-console console.warn(`Couldn't load custom layouts`); + // eslint-disable-next-line no-console + console.warn(err); } layoutsRaw.value = layouts; diff --git a/app/src/modules/register.ts b/app/src/modules/register.ts index c1311124a1..bbe3a23f12 100644 --- a/app/src/modules/register.ts +++ b/app/src/modules/register.ts @@ -20,9 +20,11 @@ export async function loadModules(): Promise { : await import(/* @vite-ignore */ `${getRootPath()}extensions/modules/index.js`); modules.push(...customModules.default); - } catch { + } catch (err) { // eslint-disable-next-line no-console console.warn(`Couldn't load custom modules`); + // eslint-disable-next-line no-console + console.warn(err); } queuedModules = modules; From 4449310c1a54b43a68c8875fee72b4f5a7a8b330 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 09:38:24 -0400 Subject: [PATCH 07/63] update dependency rollup to v2.56.1 (#7269) Co-authored-by: Renovate Bot --- package-lock.json | 20 ++++++++++---------- packages/format-title/package.json | 2 +- packages/sdk/package.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4160fde7d0..49d9ec0a0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43423,9 +43423,9 @@ } }, "node_modules/rollup": { - "version": "2.56.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.0.tgz", - "integrity": "sha512-weEafgbjbHCnrtJPNyCrhYnjP62AkF04P0BcV/1mofy1+gytWln4VVB1OK462cq2EAyWzRDpTMheSP/o+quoiA==", + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.1.tgz", + "integrity": "sha512-KkrsNjeiTfGJMUFBi/PNfj3fnt70akqdoNXOjlzwo98uA1qrlkmgt6SGaK5OwhyDYCVnJb6jb2Xa2wbI47P4Nw==", "bin": { "rollup": "dist/bin/rollup" }, @@ -54173,7 +54173,7 @@ "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.0.4", "rimraf": "3.0.2", - "rollup": "2.56.0", + "rollup": "2.56.1", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", @@ -57692,7 +57692,7 @@ "nock": "13.1.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "rollup": "2.56.0", + "rollup": "2.56.1", "rollup-plugin-copy": "3.4.0", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", @@ -60304,7 +60304,7 @@ "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.0.4", "rimraf": "3.0.2", - "rollup": "2.56.0", + "rollup": "2.56.1", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", @@ -62932,7 +62932,7 @@ "nock": "13.1.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "rollup": "2.56.0", + "rollup": "2.56.1", "rollup-plugin-copy": "3.4.0", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", @@ -95407,9 +95407,9 @@ } }, "rollup": { - "version": "2.56.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.0.tgz", - "integrity": "sha512-weEafgbjbHCnrtJPNyCrhYnjP62AkF04P0BcV/1mofy1+gytWln4VVB1OK462cq2EAyWzRDpTMheSP/o+quoiA==", + "version": "2.56.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.1.tgz", + "integrity": "sha512-KkrsNjeiTfGJMUFBi/PNfj3fnt70akqdoNXOjlzwo98uA1qrlkmgt6SGaK5OwhyDYCVnJb6jb2Xa2wbI47P4Nw==", "requires": { "fsevents": "~2.3.2" } diff --git a/packages/format-title/package.json b/packages/format-title/package.json index 02fc521855..7fd982f668 100644 --- a/packages/format-title/package.json +++ b/packages/format-title/package.json @@ -36,7 +36,7 @@ "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.0.4", "rimraf": "3.0.2", - "rollup": "2.56.0", + "rollup": "2.56.1", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index bc213c0a0b..261fc12ee7 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -58,7 +58,7 @@ "nock": "13.1.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "rollup": "2.56.0", + "rollup": "2.56.1", "rollup-plugin-copy": "3.4.0", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", From e43065bc125da6c13803dc4e55780f6766dd240e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 09:38:35 -0400 Subject: [PATCH 08/63] update dependency vue-router to v4.0.11 (#7272) Co-authored-by: Renovate Bot --- app/package.json | 2 +- package-lock.json | 20 ++++++++++---------- packages/shared/package.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/package.json b/app/package.json index d52b2bc72f..7e14ea90e3 100644 --- a/app/package.json +++ b/app/package.json @@ -87,7 +87,7 @@ "vite": "2.4.4", "vue": "3.1.5", "vue-i18n": "9.1.7", - "vue-router": "4.0.10", + "vue-router": "4.0.11", "vuedraggable": "4.0.3" } } diff --git a/package-lock.json b/package-lock.json index 49d9ec0a0a..e42b3508d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -375,7 +375,7 @@ "vite": "2.4.4", "vue": "3.1.5", "vue-i18n": "9.1.7", - "vue-router": "4.0.10", + "vue-router": "4.0.11", "vuedraggable": "4.0.3" } }, @@ -50463,9 +50463,9 @@ "dev": true }, "node_modules/vue-router": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.10.tgz", - "integrity": "sha512-YbPf6QnZpyyWfnk7CUt2Bme+vo7TLfg1nGZNkvYqKYh4vLaFw6Gn8bPGdmt5m4qrGnKoXLqc4htAsd3dIukICA==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.11.tgz", + "integrity": "sha512-sha6I8fx9HWtvTrFZfxZkiQQBpqSeT+UCwauYjkdOQYRvwsGwimlQQE2ayqUwuuXGzquFpCPoXzYKWlzL4OuXg==", "dependencies": { "@vue/devtools-api": "^6.0.0-beta.14" }, @@ -57885,7 +57885,7 @@ "knex-schema-inspector": "1.5.13", "lodash": "4.17.21", "vue": "3.1.5", - "vue-router": "4.0.10" + "vue-router": "4.0.11" }, "devDependencies": { "npm-run-all": "4.1.5", @@ -59868,7 +59868,7 @@ "vite": "2.4.4", "vue": "3.1.5", "vue-i18n": "9.1.7", - "vue-router": "4.0.10", + "vue-router": "4.0.11", "vuedraggable": "4.0.3" }, "dependencies": { @@ -63112,7 +63112,7 @@ "rimraf": "3.0.2", "typescript": "4.3.5", "vue": "3.1.5", - "vue-router": "4.0.10" + "vue-router": "4.0.11" }, "dependencies": { "date-fns": { @@ -100980,9 +100980,9 @@ } }, "vue-router": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.10.tgz", - "integrity": "sha512-YbPf6QnZpyyWfnk7CUt2Bme+vo7TLfg1nGZNkvYqKYh4vLaFw6Gn8bPGdmt5m4qrGnKoXLqc4htAsd3dIukICA==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.11.tgz", + "integrity": "sha512-sha6I8fx9HWtvTrFZfxZkiQQBpqSeT+UCwauYjkdOQYRvwsGwimlQQE2ayqUwuuXGzquFpCPoXzYKWlzL4OuXg==", "requires": { "@vue/devtools-api": "^6.0.0-beta.14" } diff --git a/packages/shared/package.json b/packages/shared/package.json index a91f32187b..d979162ad5 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -52,7 +52,7 @@ "knex-schema-inspector": "1.5.13", "lodash": "4.17.21", "vue": "3.1.5", - "vue-router": "4.0.10" + "vue-router": "4.0.11" }, "devDependencies": { "npm-run-all": "4.1.5", From d1b851e34abc4fb36993f4c1b37a98aab8162b94 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 09:38:49 -0400 Subject: [PATCH 09/63] update dependency ts-node to v10.2.0 (#7271) Co-authored-by: Renovate Bot --- package-lock.json | 105 ++++++++++++++++++++++++++++++++------ package.json | 2 +- packages/cli/package.json | 2 +- packages/sdk/package.json | 2 +- 4 files changed, 93 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index e42b3508d3..bd4a30b486 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "supertest": "6.1.4", "tedious": "11.4.0", "ts-jest": "27.0.4", - "ts-node": "10.1.0" + "ts-node": "10.2.0" }, "engines": { "node": ">=16.0.0", @@ -3140,6 +3140,27 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz", + "integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@directus/app": { "resolved": "app", "link": true @@ -48961,20 +48982,22 @@ } }, "node_modules/ts-node": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.1.0.tgz", - "integrity": "sha512-6szn3+J9WyG2hE+5W8e0ruZrzyk1uFLYye6IGMBadnOzDh8aP7t8CbFpsfCiEx2+wMixAhjFt7lOZC4+l+WbEA==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.0.tgz", + "integrity": "sha512-FstYHtQz6isj8rBtYMN4bZdnXN1vq4HCbqn9vdNQcInRqtB86PePJQIxE6es0PhxKWhj2PHuwbG40H+bxkZPmg==", "dev": true, "dependencies": { + "@cspotcode/source-map-support": "0.6.1", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.1", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", "yn": "3.1.1" }, "bin": { @@ -49074,6 +49097,27 @@ "typescript": ">=2.7" } }, + "node_modules/ts-node/node_modules/acorn": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", + "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ts-node/node_modules/acorn-walk": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz", + "integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ts-pnp": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/ts-pnp/-/ts-pnp-1.2.0.tgz", @@ -53817,7 +53861,7 @@ "prettier": "2.3.2", "rimraf": "3.0.2", "ts-jest": "27.0.4", - "ts-node": "10.1.0", + "ts-node": "10.2.0", "typescript": "4.3.5" } }, @@ -57698,7 +57742,7 @@ "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", "ts-jest": "27.0.4", - "ts-node": "10.1.0", + "ts-node": "10.2.0", "typescript": "4.3.5" } }, @@ -59805,6 +59849,21 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz", + "integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==", + "dev": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, "@directus/app": { "version": "file:app", "requires": { @@ -59947,7 +60006,7 @@ "strip-ansi": "^7.0.0", "strip-indent": "^4.0.0", "ts-jest": "27.0.4", - "ts-node": "10.1.0", + "ts-node": "10.2.0", "typescript": "4.3.5", "yargs": "^17.0.1", "yargs-parser": "^20.2.7" @@ -62938,7 +62997,7 @@ "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", "ts-jest": "27.0.4", - "ts-node": "10.1.0", + "ts-node": "10.2.0", "typescript": "4.3.5" }, "dependencies": { @@ -99836,21 +99895,37 @@ } }, "ts-node": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.1.0.tgz", - "integrity": "sha512-6szn3+J9WyG2hE+5W8e0ruZrzyk1uFLYye6IGMBadnOzDh8aP7t8CbFpsfCiEx2+wMixAhjFt7lOZC4+l+WbEA==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.0.tgz", + "integrity": "sha512-FstYHtQz6isj8rBtYMN4bZdnXN1vq4HCbqn9vdNQcInRqtB86PePJQIxE6es0PhxKWhj2PHuwbG40H+bxkZPmg==", "dev": true, "requires": { + "@cspotcode/source-map-support": "0.6.1", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.1", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", "yn": "3.1.1" + }, + "dependencies": { + "acorn": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", + "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "dev": true + }, + "acorn-walk": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz", + "integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==", + "dev": true + } } }, "ts-node-dev": { diff --git a/package.json b/package.json index 40762c71b9..d516579a37 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "supertest": "6.1.4", "tedious": "11.4.0", "ts-jest": "27.0.4", - "ts-node": "10.1.0" + "ts-node": "10.2.0" }, "simple-git-hooks": { "pre-commit": "npx lint-staged" diff --git a/packages/cli/package.json b/packages/cli/package.json index f573ce01e6..9d60349af4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -86,7 +86,7 @@ "prettier": "2.3.2", "rimraf": "3.0.2", "ts-jest": "27.0.4", - "ts-node": "10.1.0", + "ts-node": "10.2.0", "typescript": "4.3.5" }, "gitHead": "24621f3934dc77eb23441331040ed13c676ceffd" diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 261fc12ee7..23fb1d863f 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -64,7 +64,7 @@ "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", "ts-jest": "27.0.4", - "ts-node": "10.1.0", + "ts-node": "10.2.0", "typescript": "4.3.5" }, "gitHead": "24621f3934dc77eb23441331040ed13c676ceffd" From aca8c1078ed1748313bd4abf1f0ed96605901707 Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Mon, 9 Aug 2021 15:44:27 +0200 Subject: [PATCH 10/63] Only loads app extensions if SERVE_APP is true (#7275) This also ensures API/App only load their respective extensions in dev. --- api/src/app.ts | 2 +- api/src/extensions.ts | 23 +++++-- app/vite.config.js | 8 +-- packages/shared/src/constants/extensions.ts | 6 +- packages/shared/src/types/extensions.ts | 7 +- .../src/utils/node/ensure-extension-dirs.ts | 6 +- .../shared/src/utils/node/get-extensions.ts | 66 ++++++++++--------- 7 files changed, 71 insertions(+), 47 deletions(-) diff --git a/api/src/app.ts b/api/src/app.ts index 3f05840818..decf45fc17 100644 --- a/api/src/app.ts +++ b/api/src/app.ts @@ -171,7 +171,7 @@ export default async function createApp(): Promise { app.use('/relations', relationsRouter); app.use('/revisions', revisionsRouter); app.use('/roles', rolesRouter); - app.use('/server/', serverRouter); + app.use('/server', serverRouter); app.use('/settings', settingsRouter); app.use('/users', usersRouter); app.use('/utils', utilsRouter); diff --git a/api/src/extensions.ts b/api/src/extensions.ts index d510411d4d..1b1dcebf02 100644 --- a/api/src/extensions.ts +++ b/api/src/extensions.ts @@ -8,7 +8,14 @@ import { getPackageExtensions, resolvePackage, } from '@directus/shared/utils/node'; -import { APP_EXTENSION_TYPES, APP_SHARED_DEPS } from '@directus/shared/constants'; +import { + API_EXTENSION_PACKAGE_TYPES, + API_EXTENSION_TYPES, + APP_EXTENSION_TYPES, + APP_SHARED_DEPS, + EXTENSION_PACKAGE_TYPES, + EXTENSION_TYPES, +} from '@directus/shared/constants'; import getDatabase from './database'; import emitter from './emitter'; import env from './env'; @@ -31,14 +38,14 @@ let extensionBundles: Partial> = {}; export async function initializeExtensions(): Promise { try { - await ensureExtensionDirs(env.EXTENSIONS_PATH); + await ensureExtensionDirs(env.EXTENSIONS_PATH, env.SERVE_APP ? EXTENSION_TYPES : API_EXTENSION_TYPES); extensions = await getExtensions(); } catch (err) { logger.warn(`Couldn't load extensions`); logger.warn(err); } - if (env.SERVE_APP ?? env.NODE_ENV !== 'development') { + if (env.SERVE_APP) { extensionBundles = await generateExtensionBundles(); } @@ -71,8 +78,14 @@ export function registerExtensionHooks(): void { } async function getExtensions(): Promise { - const packageExtensions = await getPackageExtensions('.'); - const localExtensions = await getLocalExtensions(env.EXTENSIONS_PATH); + const packageExtensions = await getPackageExtensions( + '.', + env.SERVE_APP ? EXTENSION_PACKAGE_TYPES : API_EXTENSION_PACKAGE_TYPES + ); + const localExtensions = await getLocalExtensions( + env.EXTENSIONS_PATH, + env.SERVE_APP ? EXTENSION_TYPES : API_EXTENSION_TYPES + ); return [...packageExtensions, ...localExtensions]; } diff --git a/app/vite.config.js b/app/vite.config.js index ed31b97f31..d8ab80a3d5 100644 --- a/app/vite.config.js +++ b/app/vite.config.js @@ -8,7 +8,7 @@ import { getLocalExtensions, generateExtensionsEntry, } from '@directus/shared/utils/node'; -import { APP_SHARED_DEPS, APP_EXTENSION_TYPES } from '@directus/shared/constants'; +import { APP_SHARED_DEPS, APP_EXTENSION_TYPES, APP_EXTENSION_PACKAGE_TYPES } from '@directus/shared/constants'; // https://vitejs.dev/config/ export default defineConfig({ @@ -94,9 +94,9 @@ function directusExtensions() { const apiPath = path.join('..', 'api'); const extensionsPath = path.join(apiPath, 'extensions'); - await ensureExtensionDirs(extensionsPath); - const packageExtensions = await getPackageExtensions(apiPath); - const localExtensions = await getLocalExtensions(extensionsPath); + await ensureExtensionDirs(extensionsPath, APP_EXTENSION_TYPES); + const packageExtensions = await getPackageExtensions(apiPath, APP_EXTENSION_PACKAGE_TYPES); + const localExtensions = await getLocalExtensions(extensionsPath, APP_EXTENSION_TYPES); const extensions = [...packageExtensions, ...localExtensions]; diff --git a/packages/shared/src/constants/extensions.ts b/packages/shared/src/constants/extensions.ts index c5c3fbb008..0cb0e80e64 100644 --- a/packages/shared/src/constants/extensions.ts +++ b/packages/shared/src/constants/extensions.ts @@ -4,7 +4,11 @@ export const API_SHARED_DEPS = ['axios']; export const APP_EXTENSION_TYPES = ['interface', 'display', 'layout', 'module'] as const; export const API_EXTENSION_TYPES = ['hook', 'endpoint'] as const; export const EXTENSION_TYPES = [...APP_EXTENSION_TYPES, ...API_EXTENSION_TYPES] as const; -export const EXTENSION_PACKAGE_TYPES = [...EXTENSION_TYPES, 'pack'] as const; + +export const EXTENSION_PACK_TYPE = 'pack'; +export const APP_EXTENSION_PACKAGE_TYPES = [...APP_EXTENSION_TYPES, EXTENSION_PACK_TYPE] as const; +export const API_EXTENSION_PACKAGE_TYPES = [...API_EXTENSION_TYPES, EXTENSION_PACK_TYPE] as const; +export const EXTENSION_PACKAGE_TYPES = [...EXTENSION_TYPES, EXTENSION_PACK_TYPE] as const; export const EXTENSION_NAME_REGEX = /^(?:(?:@[^/]+\/)?directus-extension-|@directus\/extension-).+$/; diff --git a/packages/shared/src/types/extensions.ts b/packages/shared/src/types/extensions.ts index ed308ab118..ef9637b417 100644 --- a/packages/shared/src/types/extensions.ts +++ b/packages/shared/src/types/extensions.ts @@ -1,14 +1,19 @@ import { + API_EXTENSION_PACKAGE_TYPES, API_EXTENSION_TYPES, + APP_EXTENSION_PACKAGE_TYPES, APP_EXTENSION_TYPES, EXTENSION_PACKAGE_TYPES, EXTENSION_PKG_KEY, EXTENSION_TYPES, } from '../constants'; -export type ApiExtensionType = typeof API_EXTENSION_TYPES[number]; export type AppExtensionType = typeof APP_EXTENSION_TYPES[number]; +export type ApiExtensionType = typeof API_EXTENSION_TYPES[number]; export type ExtensionType = typeof EXTENSION_TYPES[number]; + +export type AppExtensionPackageType = typeof APP_EXTENSION_PACKAGE_TYPES[number]; +export type ApiExtensionPackageType = typeof API_EXTENSION_PACKAGE_TYPES[number]; export type ExtensionPackageType = typeof EXTENSION_PACKAGE_TYPES[number]; export type Extension = { diff --git a/packages/shared/src/utils/node/ensure-extension-dirs.ts b/packages/shared/src/utils/node/ensure-extension-dirs.ts index fc047ddc45..35c75c0f13 100644 --- a/packages/shared/src/utils/node/ensure-extension-dirs.ts +++ b/packages/shared/src/utils/node/ensure-extension-dirs.ts @@ -1,10 +1,10 @@ import path from 'path'; import fse from 'fs-extra'; import { pluralize } from '../pluralize'; -import { EXTENSION_TYPES } from '../../constants'; +import { ExtensionType } from '../../types'; -export async function ensureExtensionDirs(extensionsPath: string): Promise { - for (const extensionType of EXTENSION_TYPES) { +export async function ensureExtensionDirs(extensionsPath: string, types: readonly ExtensionType[]): Promise { + for (const extensionType of types) { const dirPath = path.resolve(extensionsPath, pluralize(extensionType)); try { await fse.ensureDir(dirPath); diff --git a/packages/shared/src/utils/node/get-extensions.ts b/packages/shared/src/utils/node/get-extensions.ts index 2498765f49..0c72582806 100644 --- a/packages/shared/src/utils/node/get-extensions.ts +++ b/packages/shared/src/utils/node/get-extensions.ts @@ -1,13 +1,13 @@ import path from 'path'; import fse from 'fs-extra'; -import { Extension, ExtensionManifestRaw } from '../../types'; +import { Extension, ExtensionManifestRaw, ExtensionPackageType, ExtensionType } from '../../types'; import { resolvePackage } from './resolve-package'; import { listFolders } from './list-folders'; -import { EXTENSION_NAME_REGEX, EXTENSION_PKG_KEY, EXTENSION_TYPES } from '../../constants'; +import { EXTENSION_NAME_REGEX, EXTENSION_PKG_KEY } from '../../constants'; import { pluralize } from '../pluralize'; import { validateExtensionManifest } from '../validate-extension-manifest'; -export async function getPackageExtensions(root: string): Promise { +export async function getPackageExtensions(root: string, types: readonly ExtensionPackageType[]): Promise { let pkg: { dependencies?: Record }; try { @@ -31,35 +31,37 @@ export async function getPackageExtensions(root: string): Promise { throw new Error(`The extension manifest of "${extensionName}" is not valid.`); } - if (extensionManifest[EXTENSION_PKG_KEY].type === 'pack') { - const extensionChildren = Object.keys(extensionManifest.dependencies ?? {}).filter((dep) => - EXTENSION_NAME_REGEX.test(dep) - ); + if (types.includes(extensionManifest[EXTENSION_PKG_KEY].type)) { + if (extensionManifest[EXTENSION_PKG_KEY].type === 'pack') { + const extensionChildren = Object.keys(extensionManifest.dependencies ?? {}).filter((dep) => + EXTENSION_NAME_REGEX.test(dep) + ); - const extension: Extension = { - path: extensionPath, - name: extensionName, - version: extensionManifest.version, - type: extensionManifest[EXTENSION_PKG_KEY].type, - host: extensionManifest[EXTENSION_PKG_KEY].host, - children: extensionChildren, - local: false, - root: root === undefined, - }; + const extension: Extension = { + path: extensionPath, + name: extensionName, + version: extensionManifest.version, + type: extensionManifest[EXTENSION_PKG_KEY].type, + host: extensionManifest[EXTENSION_PKG_KEY].host, + children: extensionChildren, + local: false, + root: root === undefined, + }; - extensions.push(extension); - extensions.push(...(await listExtensionsChildren(extension.children || [], extension.path))); - } else { - extensions.push({ - path: extensionPath, - name: extensionName, - version: extensionManifest.version, - type: extensionManifest[EXTENSION_PKG_KEY].type, - entrypoint: extensionManifest[EXTENSION_PKG_KEY].path, - host: extensionManifest[EXTENSION_PKG_KEY].host, - local: false, - root: root === undefined, - }); + extensions.push(extension); + extensions.push(...(await listExtensionsChildren(extension.children || [], extension.path))); + } else { + extensions.push({ + path: extensionPath, + name: extensionName, + version: extensionManifest.version, + type: extensionManifest[EXTENSION_PKG_KEY].type, + entrypoint: extensionManifest[EXTENSION_PKG_KEY].path, + host: extensionManifest[EXTENSION_PKG_KEY].host, + local: false, + root: root === undefined, + }); + } } } @@ -67,10 +69,10 @@ export async function getPackageExtensions(root: string): Promise { } } -export async function getLocalExtensions(root: string): Promise { +export async function getLocalExtensions(root: string, types: readonly ExtensionType[]): Promise { const extensions: Extension[] = []; - for (const extensionType of EXTENSION_TYPES) { + for (const extensionType of types) { const typeDir = pluralize(extensionType); const typePath = path.resolve(root, typeDir); From e5683e0d0bf132801fceedfa8b6545f3ae282a8c Mon Sep 17 00:00:00 2001 From: Nicola Krumschmidt Date: Mon, 9 Aug 2021 18:00:09 +0200 Subject: [PATCH 11/63] Fix gitignore file in extension templates being deleted when publishing (#7279) --- .../extension-sdk/src/cli/commands/create.ts | 2 ++ .../extension-sdk/src/cli/utils/rename-map.ts | 20 +++++++++++++++++++ packages/extension-sdk/templates/common/.keep | 0 .../common/{.gitignore => _gitignore} | 0 4 files changed, 22 insertions(+) create mode 100644 packages/extension-sdk/src/cli/utils/rename-map.ts delete mode 100644 packages/extension-sdk/templates/common/.keep rename packages/extension-sdk/templates/common/{.gitignore => _gitignore} (100%) diff --git a/packages/extension-sdk/src/cli/commands/create.ts b/packages/extension-sdk/src/cli/commands/create.ts index cfe0526375..d622e1532e 100644 --- a/packages/extension-sdk/src/cli/commands/create.ts +++ b/packages/extension-sdk/src/cli/commands/create.ts @@ -6,6 +6,7 @@ import ora from 'ora'; import { EXTENSION_TYPES, EXTENSION_PKG_KEY } from '@directus/shared/constants'; import { isExtension } from '@directus/shared/utils'; import log from '../utils/logger'; +import renameMap from '../utils/rename-map'; const pkg = require('../../../../package.json'); @@ -46,6 +47,7 @@ export default async function create(type: string, name: string): Promise await fse.copy(path.join(TEMPLATE_PATH, 'common'), targetPath); await fse.copy(path.join(TEMPLATE_PATH, type), targetPath); + await renameMap(targetPath, (name) => (name.startsWith('_') ? `.${name.substring(1)}` : null)); const packageManifest = { name: `directus-extension-${name}`, diff --git a/packages/extension-sdk/src/cli/utils/rename-map.ts b/packages/extension-sdk/src/cli/utils/rename-map.ts new file mode 100644 index 0000000000..8687b5f164 --- /dev/null +++ b/packages/extension-sdk/src/cli/utils/rename-map.ts @@ -0,0 +1,20 @@ +import path from 'path'; +import fse from 'fs-extra'; + +export default async function renameMap(file: string, map: (name: string) => string | null): Promise { + const info = await fse.stat(file); + + if (info.isFile()) { + const newName = map(path.basename(file)); + + if (newName !== null) { + fse.rename(file, path.join(path.dirname(file), newName)); + } + } else { + const subFiles = await fse.readdir(file); + + for (const subFile of subFiles) { + await renameMap(path.join(file, subFile), map); + } + } +} diff --git a/packages/extension-sdk/templates/common/.keep b/packages/extension-sdk/templates/common/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/extension-sdk/templates/common/.gitignore b/packages/extension-sdk/templates/common/_gitignore similarity index 100% rename from packages/extension-sdk/templates/common/.gitignore rename to packages/extension-sdk/templates/common/_gitignore From 82967f7ec2815c784b303bf1ba35ced05aaf98c2 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Mon, 9 Aug 2021 18:39:58 +0200 Subject: [PATCH 12/63] New Crowdin updates (#7260) * New translations en-US.yaml (Spanish) * New translations en-US.yaml (Spanish) * New translations en-US.yaml (Russian) * New translations en-US.yaml (Russian) * New translations en-US.yaml (Russian) * New translations en-US.yaml (Russian) --- app/src/lang/translations/es-ES.yaml | 54 +++++++++++++++++++++++ app/src/lang/translations/ru-RU.yaml | 66 +++++++++++++++++++++++----- 2 files changed, 110 insertions(+), 10 deletions(-) diff --git a/app/src/lang/translations/es-ES.yaml b/app/src/lang/translations/es-ES.yaml index dc5133ee84..b6985ec3a4 100644 --- a/app/src/lang/translations/es-ES.yaml +++ b/app/src/lang/translations/es-ES.yaml @@ -36,6 +36,7 @@ role_name: Nombre del Rol branch: Rama leaf: Hoja indeterminate: Indeterminado +exclusive: Exclusivo db_only_click_to_configure: 'Solo Base de Datos: Clic para Configurar ' show_archived_items: Mostrar Elementos Archivados edited: Valor Editado @@ -47,6 +48,7 @@ create_role: Crear Rol create_user: Crear Usuario create_webhook: Crear Webhook invite_users: Invitar Usuarios +email_examples: "admin{'@'}ejemplo.com, usuario{'@'}ejemplo.com..." invite: Invitar email_already_invited: El correo electrónico "{email}" ya ha sido invitado emails: Correos Electrónicos @@ -68,6 +70,7 @@ delete_bookmark_copy: >- logoutReason: SIGN_OUT: Sesión terminada SESSION_EXPIRED: Sesión expirada +public_label: Público public_description: Controla qué datos de la API estarán disponibles sin requerir autenticarse not_allowed: No Permitido directus_version: Versión de Directus @@ -305,6 +308,7 @@ drag_mode: Modo Arrastrar cancel_crop: No Cortar original: Original url: URL +import_label: Importar file_details: Detalles de Archivo dimensions: Dimensiones size: Tamaño @@ -394,6 +398,7 @@ documentation: Documentación sidebar: Barra Lateral duration: Duración charset: Codificación +second: segundo file_moved: Archivo Movido collection_created: Colección Creada modified_on: Modificado en @@ -432,6 +437,7 @@ errors: USER_SUSPENDED: Usuario Suspendido CONTAINS_NULL_VALUES: El campo contiene valores nulos UNKNOWN: Error Inesperado + UNPROCESSABLE_ENTITY: Entidad no procesable INTERNAL_SERVER_ERROR: Error Inesperado NOT_NULL_VIOLATION: El valor no puede ser nulo value_hashed: Valor Hasheado de Manera Segura @@ -501,6 +507,10 @@ operators: nnull: No es Nulo contains: Contiene ncontains: No contiene + starts_with: Comienza con + nstarts_with: No comienza con + ends_with: Termina con + nends_with: No termina con between: Está Entre nbetween: No está Entre empty: Está vacío @@ -545,6 +555,7 @@ no_results_copy: Ajustar o limpiar filtros de búsqueda para ver los resultados. clear_filters: Limpiar Filtros saves_automatically: Guardar Automáticamente role: Rol +rule: Regla user: Usuario no_presets: Sin Predefinidos no_presets_copy: Los Predefinidos o Marcadores no se han guardado aún. @@ -816,11 +827,17 @@ relational_triggers: Disparadores Relacionales referential_action_field_label_m2o: Al eliminar {collection}... referential_action_field_label_o2m: Al deseleccionar {collection}... referential_action_no_action: Evitar la eliminación +referential_action_cascade: Eliminar el item {collection} (cascada) referential_action_set_null: Anular el campo {field} referential_action_set_default: Establecer {field} a su valor predeterminado choose_action: Elegir acción +continue_label: Continuar +continue_as: >- + Actualmente {name} ha iniciado sesión. Si reconoce esta cuenta, presione continuar. editing_role: 'Rol {role}' creating_webhook: Creando Webhook +default_label: Por defecto +delete_label: Eliminar delete_are_you_sure: >- Esta acción es permanente y no puede ser revertida. ¿Realmente le gustaría proceder? delete_field_are_you_sure: >- @@ -872,11 +889,17 @@ sort_direction: Dirección de Ordenamiento sort_asc: Ordenar ascendente sort_desc: Orden descendente template: Plantilla +require_value_to_be_set: Requiere valor para ser establecido translation: Traducción value: Valor view_project: Ver Proyecto report_error: Reportar Error +start: Iniciar interfaces: + group-accordion: + all_closed: Todo Cerrado + first_opened: Primero Abierto + all_opened: Todo Abierto presentation-links: presentation-links: Botón de enlace links: Enlaces @@ -985,8 +1008,18 @@ interfaces: box: Bloque / Alineación imageToken: Token de Imagen imageToken_label: Qué token (estático) añadir a las fuentes de la imagen + presentation-notice: + notice: Aviso + list-o2m: + one-to-many: Uno a Muchos + no_collection: No se encontró la colección system-folder: folder: Directorio + description: Seleccione una carpeta + root_name: Raíz de la Biblioteca de Archivos + system_default: Valores por defecto del sistema + list: + repeater: Repetidor slider: slider: Deslizador description: Seleccionar un número usando un deslizador @@ -1007,8 +1040,18 @@ interfaces: add_tags: Agregar etiquetas... input: mask: Enmascarado + mask_label: Ocultar el valor real + clear: Valor Limpiado + clear_label: Guardar como cadena vacía + minimum_value: Valor Mínimo + maximum_value: Valor Máximo + step_interval: Intervalo de Pasos + slug: Slugify + input-multiline: + textarea: Área de Texto boolean: toggle: Alternar + description: Alternar entre Activado y Desactivado label_default: Habilitado translations: display_template: Plantilla de Presentación @@ -1021,6 +1064,13 @@ interfaces: auto: Automático dropdown: Lista Desplegable modal: Diálogo + input-rich-text-html: + wysiwyg: WYSIWYG + toolbar: Barra de Herramientas + custom_formats: Formatos Personalizados + options_override: Sobrescribir Opciones + input-autocomplete-api: + results_path: Ruta de Resultados displays: boolean: boolean: Booleano @@ -1123,3 +1173,7 @@ layouts: comfortable: Cómoda compact: Compacto cozy: Cómoda + calendar: + calendar: Calendario + start_date_field: Campo Fecha de Inicio + end_date_field: Campo Fecha de Fin diff --git a/app/src/lang/translations/ru-RU.yaml b/app/src/lang/translations/ru-RU.yaml index 02e4948f10..974521ff1a 100644 --- a/app/src/lang/translations/ru-RU.yaml +++ b/app/src/lang/translations/ru-RU.yaml @@ -20,12 +20,13 @@ #'SIMD', 'ArrayBuffer', 'DataView', 'JSON', 'Promise', 'Generator', 'GeneratorFunction', 'Reflect', #'Proxy', 'Intl' edit_field: Редактировать поле -item_revision: Версия Элемента -duplicate_field: Дубликат Поля -half_width: Половина Ширины -full_width: Полная ширина +conditions: Условия +item_revision: Редакция +duplicate_field: Клонировать поле +half_width: Полширины +full_width: Вся ширина group: Группа -fill_width: Полная Ширина +fill_width: В ширину field_name_translations: Переводы Названия Поля enter_password_to_enable_tfa: Введите свой пароль для включения Двухфакторной Аутентификации add_field: Добавить поле @@ -34,15 +35,15 @@ branch: Ветка children: Дочерние элементы db_only_click_to_configure: 'Только База данных: Нажмите для Настройки ' show_archived_items: Показать элементы в архиве -edited: Изменённое значение +edited: Значение изменено required: Необходимые required_for_app_access: Требуется для доступа к приложению requires_value: Требуется значение create_preset: Создать Пресет -create_role: Создать Роль -create_user: Создать Пользователя +create_role: Создать роль +create_user: Создать пользователя create_webhook: Создать веб-хук -invite_users: Пригласить Пользователей +invite_users: Пригласить пользователей invite: Пригласить email_already_invited: На адрес "{email}" уже было отправлено приглашение emails: Email-адреса @@ -64,6 +65,7 @@ delete_bookmark_copy: >- logoutReason: SIGN_OUT: Вы вышли SESSION_EXPIRED: Сессия истекла +public_label: Публичный public_description: Управляет какие данные доступны по API без аутентификации. not_allowed: Не Разрешено directus_version: Версия Directus @@ -108,6 +110,7 @@ no_access: Нет Доступа use_custom: Использовать Свой nullable: Разрешить NULL значение allow_null_value: Разрешить NULL значение +allow_multiple: Разрешить несколько field_standard: Стандарт field_presentation: Представление и Алиасы field_file: Один Файл @@ -297,6 +300,7 @@ drag_mode: Режим Перетаскивания cancel_crop: Отменить Обрезку original: Исходный url: URL +import_label: Импорт file_details: Информация о Файле dimensions: Размеры size: Размер @@ -337,7 +341,9 @@ save_and_stay: Сохранить и Остаться save_as_copy: Сохранить и Копировать add_existing: Добавить Существующий creating_items: Создание элементов +enable_create_button: С кнопкой «Создать» selecting_items: Выбор элементов +enable_select_button: С кнопкой «Выбрать» comments: Комментарии no_comments: Комментариев Пока Нет click_to_expand: Нажмите, чтобы Раскрыть @@ -420,7 +426,9 @@ errors: ROUTE_NOT_FOUND: Не найдено RECORD_NOT_UNIQUE: Обнаружен дубликат значения USER_SUSPENDED: Пользователь заблокирован + CONTAINS_NULL_VALUES: Поле содержит значения null UNKNOWN: Неожиданная Ошибка + UNPROCESSABLE_ENTITY: Необрабатываемый объект INTERNAL_SERVER_ERROR: Неожиданная Ошибка NOT_NULL_VIOLATION: Значение не может быть null value_hashed: Значение Безопасно Хэшировано @@ -534,6 +542,7 @@ no_results_copy: Настройте или сбросьте фильтры по clear_filters: Сбросить Фильтры saves_automatically: Сохраняется Автоматически role: Роль +rule: Правило user: Пользователь no_presets: Нет Пресетов no_presets_copy: Пресеты или закладки пока не были сохранены. @@ -805,8 +814,11 @@ referential_action_no_action: Предотвратить удаление referential_action_set_null: Обнулить поле {field} referential_action_set_default: Установить полю {field} значение по умолчанию choose_action: Выбрать действие +continue_label: Продолжить editing_role: '{role} Роль' creating_webhook: Создание Веб-хука +default_label: По умолчанию +delete_label: Удалить delete_are_you_sure: >- Это действие является необратимым и не может быть отменено. Вы уверены, что хотите продолжить? delete_field_are_you_sure: >- @@ -862,10 +874,20 @@ translation: Перевод value: Значение view_project: Просмотр Проекта report_error: Сообщить об Ошибке +start: Начало interfaces: + group-accordion: + name: Аккордеон + description: Отображать поля или группы как секции аккордеона + all_closed: Все закрыты + first_opened: Первая открыта + all_opened: Все открыты + accordion_mode: Вид аккордеона + max_one_section_open: 1 открытая секция presentation-links: presentation-links: Ссылки кнопок links: Ссылки + description: Настраиваемые кнопки-ссылки для динамических URL-адресов style: Стиль primary: Первичный link: Ссылки @@ -882,6 +904,8 @@ interfaces: description: Выбор с помощью дерева чекбоксов value_combining: Объединение значений value_combining_note: Определяет, какое значение сохраняется при выборе вложенных вариантов. + show_all: Показывать все + show_selected: Показать выбранные input-code: code: Код description: Написать или поделиться фрагментами кода @@ -899,6 +923,7 @@ interfaces: color: Цвет description: Введите или выберите значение цвета placeholder: Выберите цвет... + preset_colors: Предустановленные цвета preset_colors_add_label: Добавить новый цвет... name_placeholder: Введите название цвета... datetime: @@ -916,6 +941,7 @@ interfaces: divider: Разделитель title_placeholder: Введите название... inline_title: Строчный заголовок + inline_title_label: Показать заголовок внутри строки margin_top: Отступ сверху margin_top_label: Увеличить отступ сверху select-dropdown: @@ -929,6 +955,7 @@ interfaces: choices_value_placeholder: Введите значение... select-multiple-dropdown: select-multiple-dropdown: Выпадающий список (несколько) + description: Выбор нескольких элементов из выпадающего списка file: file: Файл description: Выберите или загрузите файл @@ -938,6 +965,7 @@ interfaces: input-hash: hash: Хэш description: Введите значение для хеширования + masked: С маской masked_label: Скрывать настоящие значения select-icon: icon: Иконка @@ -967,10 +995,18 @@ interfaces: customSyntax_add: Добавить произвольный синтаксис box: Блок / Строчный элемент imageToken: Ключ изображения + presentation-notice: + notice: Уведомление + description: Показать короткое уведомление + text: Введите содержание уведомления здесь... list-o2m: one-to-many: Один ко многим + no_collection: Коллекция не найдена system-folder: folder: Папка + description: Выбрать папку + root_name: Корень файловой библиотеки + system_default: Системные настройки по умолчанию select-radio: radio-buttons: Радиокнопки description: Выбор одного из нескольких вариантов @@ -978,6 +1014,8 @@ interfaces: repeater: Повторитель edit_fields: Редактировать поля add_label: 'Ярлык «Создать новый»' + field_name_placeholder: Введите название поля... + field_note_placeholder: Примечание к полю... slider: slider: Слайдер description: Выберите номер с помощью слайдера @@ -1001,18 +1039,21 @@ interfaces: description: Ввести значение вручную trim: Обрезать trim_label: Обрезать начало и конец + mask: С маской mask_label: Скрыть настоящее значение clear: Очищенное значение clear_label: Сохранить как пустую строку minimum_value: Минимальное значение maximum_value: Максимальное значение step_interval: Интервал шага + slug: Форматировать для URL slug_label: Сделать введённое значение безопасным для URL input-multiline: textarea: Область текста description: Введите простой текст (несколько строк) boolean: toggle: Переключить + description: Переключение вкл / выкл label_placeholder: Введите метку... label_default: Включен translations: @@ -1034,7 +1075,12 @@ interfaces: options_override: Переопределение параметров input-autocomplete-api: input-autocomplete-api: Автоматическое дополнение ввода (API) + value_path: Путь значения trigger: Триггер + group-detail: + show_header: Показывать заголовок группы + header_icon: Иконка заголовка + header_color: Цвет заголовка displays: boolean: boolean: Логическое @@ -1125,7 +1171,7 @@ layouts: image_source: Источник изображения image_fit: Подгон Изображения crop: Обрезать - contain: Содержать + contain: Вписать title: Заголовок subtitle: Подзаголовок tabular: From e1c6bc5ac910826a5549d280d490f8e0fc0be86c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 14:13:41 -0400 Subject: [PATCH 13/63] update typescript-eslint monorepo to v4.29.1 (#7283) Co-authored-by: Renovate Bot --- package-lock.json | 140 +++++++++++++++++++++++----------------------- package.json | 4 +- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd4a30b486..eb448fc54f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,8 @@ "@types/listr": "0.14.4", "@types/node": "15.12.2", "@types/supertest": "2.0.11", - "@typescript-eslint/eslint-plugin": "4.29.0", - "@typescript-eslint/parser": "4.29.0", + "@typescript-eslint/eslint-plugin": "4.29.1", + "@typescript-eslint/parser": "4.29.1", "axios": "0.21.1", "dockerode": "3.3.0", "eslint": "7.32.0", @@ -8200,12 +8200,12 @@ "integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.0.tgz", - "integrity": "sha512-eiREtqWRZ8aVJcNru7cT/AMVnYd9a2UHsfZT8MR1dW3UUEg6jDv9EQ9Cq4CUPZesyQ58YUpoAADGv71jY8RwgA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.1.tgz", + "integrity": "sha512-AHqIU+SqZZgBEiWOrtN94ldR3ZUABV5dUG94j8Nms9rQnHFc8fvDOue/58K4CFz6r8OtDDc35Pw9NQPWo0Ayrw==", "dependencies": { - "@typescript-eslint/experimental-utils": "4.29.0", - "@typescript-eslint/scope-manager": "4.29.0", + "@typescript-eslint/experimental-utils": "4.29.1", + "@typescript-eslint/scope-manager": "4.29.1", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.1.0", @@ -8230,14 +8230,14 @@ } }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.0.tgz", - "integrity": "sha512-FpNVKykfeaIxlArLUP/yQfv/5/3rhl1ov6RWgud4OgbqWLkEq7lqgQU9iiavZRzpzCRQV4XddyFz3wFXdkiX9w==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.1.tgz", + "integrity": "sha512-kl6QG6qpzZthfd2bzPNSJB2YcZpNOrP6r9jueXupcZHnL74WiuSjaft7WSu17J9+ae9zTlk0KJMXPUj0daBxMw==", "dependencies": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.29.0", - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/typescript-estree": "4.29.0", + "@typescript-eslint/scope-manager": "4.29.1", + "@typescript-eslint/types": "4.29.1", + "@typescript-eslint/typescript-estree": "4.29.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -8253,13 +8253,13 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.0.tgz", - "integrity": "sha512-+92YRNHFdXgq+GhWQPT2bmjX09X7EH36JfgN2/4wmhtwV/HPxozpCNst8jrWcngLtEVd/4zAwA6BKojAlf+YqA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.1.tgz", + "integrity": "sha512-3fL5iN20hzX3Q4OkG7QEPFjZV2qsVGiDhEwwh+EkmE/w7oteiOvUNzmpu5eSwGJX/anCryONltJ3WDmAzAoCMg==", "dependencies": { - "@typescript-eslint/scope-manager": "4.29.0", - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/typescript-estree": "4.29.0", + "@typescript-eslint/scope-manager": "4.29.1", + "@typescript-eslint/types": "4.29.1", + "@typescript-eslint/typescript-estree": "4.29.1", "debug": "^4.3.1" }, "engines": { @@ -8279,12 +8279,12 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.0.tgz", - "integrity": "sha512-HPq7XAaDMM3DpmuijxLV9Io8/6pQnliiXMQUcAdjpJJSR+fdmbD/zHCd7hMkjJn04UQtCQBtshgxClzg6NIS2w==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.1.tgz", + "integrity": "sha512-Hzv/uZOa9zrD/W5mftZa54Jd5Fed3tL6b4HeaOpwVSabJK8CJ+2MkDasnX/XK4rqP5ZTWngK1ZDeCi6EnxPQ7A==", "dependencies": { - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/visitor-keys": "4.29.0" + "@typescript-eslint/types": "4.29.1", + "@typescript-eslint/visitor-keys": "4.29.1" }, "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" @@ -8295,9 +8295,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.0.tgz", - "integrity": "sha512-2YJM6XfWfi8pgU2HRhTp7WgRw78TCRO3dOmSpAvIQ8MOv4B46JD2chnhpNT7Jq8j0APlIbzO1Bach734xxUl4A==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.1.tgz", + "integrity": "sha512-Jj2yu78IRfw4nlaLtKjVaGaxh/6FhofmQ/j8v3NXmAiKafbIqtAPnKYrf0sbGjKdj0hS316J8WhnGnErbJ4RCA==", "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, @@ -8307,12 +8307,12 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.0.tgz", - "integrity": "sha512-8ZpNHDIOyqzzgZrQW9+xQ4k5hM62Xy2R4RPO3DQxMc5Rq5QkCdSpk/drka+DL9w6sXNzV5nrdlBmf8+x495QXQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.1.tgz", + "integrity": "sha512-lIkkrR9E4lwZkzPiRDNq0xdC3f2iVCUjw/7WPJ4S2Sl6C3nRWkeE1YXCQ0+KsiaQRbpY16jNaokdWnm9aUIsfw==", "dependencies": { - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/visitor-keys": "4.29.0", + "@typescript-eslint/types": "4.29.1", + "@typescript-eslint/visitor-keys": "4.29.1", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -8333,11 +8333,11 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.0.tgz", - "integrity": "sha512-LoaofO1C/jAJYs0uEpYMXfHboGXzOJeV118X4OsZu9f7rG7Pr9B3+4HTU8+err81rADa4xfQmAxnRnPAI2jp+Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.1.tgz", + "integrity": "sha512-zLqtjMoXvgdZY/PG6gqA73V8BjqPs4af1v2kiiETBObp+uC6gRYnJLmJHxC0QyUrrHDLJPIWNYxoBV3wbcRlag==", "dependencies": { - "@typescript-eslint/types": "4.29.0", + "@typescript-eslint/types": "4.29.1", "eslint-visitor-keys": "^2.0.0" }, "engines": { @@ -67459,12 +67459,12 @@ "integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw==" }, "@typescript-eslint/eslint-plugin": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.0.tgz", - "integrity": "sha512-eiREtqWRZ8aVJcNru7cT/AMVnYd9a2UHsfZT8MR1dW3UUEg6jDv9EQ9Cq4CUPZesyQ58YUpoAADGv71jY8RwgA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.1.tgz", + "integrity": "sha512-AHqIU+SqZZgBEiWOrtN94ldR3ZUABV5dUG94j8Nms9rQnHFc8fvDOue/58K4CFz6r8OtDDc35Pw9NQPWo0Ayrw==", "requires": { - "@typescript-eslint/experimental-utils": "4.29.0", - "@typescript-eslint/scope-manager": "4.29.0", + "@typescript-eslint/experimental-utils": "4.29.1", + "@typescript-eslint/scope-manager": "4.29.1", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.1.0", @@ -67473,50 +67473,50 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.0.tgz", - "integrity": "sha512-FpNVKykfeaIxlArLUP/yQfv/5/3rhl1ov6RWgud4OgbqWLkEq7lqgQU9iiavZRzpzCRQV4XddyFz3wFXdkiX9w==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.1.tgz", + "integrity": "sha512-kl6QG6qpzZthfd2bzPNSJB2YcZpNOrP6r9jueXupcZHnL74WiuSjaft7WSu17J9+ae9zTlk0KJMXPUj0daBxMw==", "requires": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.29.0", - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/typescript-estree": "4.29.0", + "@typescript-eslint/scope-manager": "4.29.1", + "@typescript-eslint/types": "4.29.1", + "@typescript-eslint/typescript-estree": "4.29.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.0.tgz", - "integrity": "sha512-+92YRNHFdXgq+GhWQPT2bmjX09X7EH36JfgN2/4wmhtwV/HPxozpCNst8jrWcngLtEVd/4zAwA6BKojAlf+YqA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.1.tgz", + "integrity": "sha512-3fL5iN20hzX3Q4OkG7QEPFjZV2qsVGiDhEwwh+EkmE/w7oteiOvUNzmpu5eSwGJX/anCryONltJ3WDmAzAoCMg==", "requires": { - "@typescript-eslint/scope-manager": "4.29.0", - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/typescript-estree": "4.29.0", + "@typescript-eslint/scope-manager": "4.29.1", + "@typescript-eslint/types": "4.29.1", + "@typescript-eslint/typescript-estree": "4.29.1", "debug": "^4.3.1" } }, "@typescript-eslint/scope-manager": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.0.tgz", - "integrity": "sha512-HPq7XAaDMM3DpmuijxLV9Io8/6pQnliiXMQUcAdjpJJSR+fdmbD/zHCd7hMkjJn04UQtCQBtshgxClzg6NIS2w==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.1.tgz", + "integrity": "sha512-Hzv/uZOa9zrD/W5mftZa54Jd5Fed3tL6b4HeaOpwVSabJK8CJ+2MkDasnX/XK4rqP5ZTWngK1ZDeCi6EnxPQ7A==", "requires": { - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/visitor-keys": "4.29.0" + "@typescript-eslint/types": "4.29.1", + "@typescript-eslint/visitor-keys": "4.29.1" } }, "@typescript-eslint/types": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.0.tgz", - "integrity": "sha512-2YJM6XfWfi8pgU2HRhTp7WgRw78TCRO3dOmSpAvIQ8MOv4B46JD2chnhpNT7Jq8j0APlIbzO1Bach734xxUl4A==" + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.1.tgz", + "integrity": "sha512-Jj2yu78IRfw4nlaLtKjVaGaxh/6FhofmQ/j8v3NXmAiKafbIqtAPnKYrf0sbGjKdj0hS316J8WhnGnErbJ4RCA==" }, "@typescript-eslint/typescript-estree": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.0.tgz", - "integrity": "sha512-8ZpNHDIOyqzzgZrQW9+xQ4k5hM62Xy2R4RPO3DQxMc5Rq5QkCdSpk/drka+DL9w6sXNzV5nrdlBmf8+x495QXQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.1.tgz", + "integrity": "sha512-lIkkrR9E4lwZkzPiRDNq0xdC3f2iVCUjw/7WPJ4S2Sl6C3nRWkeE1YXCQ0+KsiaQRbpY16jNaokdWnm9aUIsfw==", "requires": { - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/visitor-keys": "4.29.0", + "@typescript-eslint/types": "4.29.1", + "@typescript-eslint/visitor-keys": "4.29.1", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -67525,11 +67525,11 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.0.tgz", - "integrity": "sha512-LoaofO1C/jAJYs0uEpYMXfHboGXzOJeV118X4OsZu9f7rG7Pr9B3+4HTU8+err81rADa4xfQmAxnRnPAI2jp+Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.1.tgz", + "integrity": "sha512-zLqtjMoXvgdZY/PG6gqA73V8BjqPs4af1v2kiiETBObp+uC6gRYnJLmJHxC0QyUrrHDLJPIWNYxoBV3wbcRlag==", "requires": { - "@typescript-eslint/types": "4.29.0", + "@typescript-eslint/types": "4.29.1", "eslint-visitor-keys": "^2.0.0" } }, diff --git a/package.json b/package.json index d516579a37..603d4ae90b 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "@types/listr": "0.14.4", "@types/node": "15.12.2", "@types/supertest": "2.0.11", - "@typescript-eslint/eslint-plugin": "4.29.0", - "@typescript-eslint/parser": "4.29.0", + "@typescript-eslint/eslint-plugin": "4.29.1", + "@typescript-eslint/parser": "4.29.1", "axios": "0.21.1", "dockerode": "3.3.0", "eslint": "7.32.0", From d8889d777e23edbb824982a102e6c38efeff59ef Mon Sep 17 00:00:00 2001 From: Jay Cammarano <67079013+jaycammarano@users.noreply.github.com> Date: Mon, 9 Aug 2021 15:36:24 -0400 Subject: [PATCH 14/63] Only treat `tinyint(1)` and `tinyint(0)` as booleans (#7287) * added an if catch for tinyint(1) and tinyint(0) * made suggested changes toLowerCase() --- api/src/utils/get-local-type.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/utils/get-local-type.ts b/api/src/utils/get-local-type.ts index 8b7fbe8eec..839596fe93 100644 --- a/api/src/utils/get-local-type.ts +++ b/api/src/utils/get-local-type.ts @@ -6,7 +6,7 @@ import getDatabase from '../database'; const localTypeMap: Record = { // Shared boolean: { type: 'boolean' }, - tinyint: { type: 'boolean' }, + tinyint: { type: 'integer' }, smallint: { type: 'integer' }, mediumint: { type: 'integer' }, int: { type: 'integer' }, @@ -117,7 +117,6 @@ export default function getLocalType( } } } - /** Handle Postgres numeric decimals */ if (column.data_type === 'numeric' && column.numeric_precision !== null && column.numeric_scale !== null) { return 'decimal'; @@ -128,6 +127,11 @@ export default function getLocalType( return 'text'; } + /** Handle Boolean as TINYINT*/ + if (column.data_type.toLowerCase() === 'tinyint(1)' || column.data_type.toLowerCase() === 'tinyint(0)') { + return 'boolean'; + } + if (type) { return type.type; } From 802f7de8537134e09a12dba27ffd5df2c125111d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 20:19:05 +0000 Subject: [PATCH 15/63] update dependency @vue/compiler-sfc to v3.2.0 (#7288) Co-authored-by: Renovate Bot --- app/package.json | 2 +- package-lock.json | 165 +++++++++++++++++++++++++++++++++++++--------- 2 files changed, 136 insertions(+), 31 deletions(-) diff --git a/app/package.json b/app/package.json index 7e14ea90e3..1c1a0bb3ac 100644 --- a/app/package.json +++ b/app/package.json @@ -58,7 +58,7 @@ "@vue/cli-plugin-typescript": "4.5.13", "@vue/cli-plugin-vuex": "4.5.13", "@vue/cli-service": "4.5.13", - "@vue/compiler-sfc": "3.1.5", + "@vue/compiler-sfc": "3.2.0", "axios": "0.21.1", "base-64": "1.0.0", "codemirror": "5.62.2", diff --git a/package-lock.json b/package-lock.json index eb448fc54f..892ce6c917 100644 --- a/package-lock.json +++ b/package-lock.json @@ -346,7 +346,7 @@ "@vue/cli-plugin-typescript": "4.5.13", "@vue/cli-plugin-vuex": "4.5.13", "@vue/cli-service": "4.5.13", - "@vue/compiler-sfc": "3.1.5", + "@vue/compiler-sfc": "3.2.0", "axios": "0.21.1", "base-64": "1.0.0", "codemirror": "5.62.2", @@ -9761,17 +9761,17 @@ } }, "node_modules/@vue/compiler-sfc": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.1.5.tgz", - "integrity": "sha512-mtMY6xMvZeSRx9MTa1+NgJWndrkzVTdJ1pQAmAKQuxyb5LsHVvrgP7kcQFvxPHVpLVTORbTJWHaiqoKrJvi1iA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.0.tgz", + "integrity": "sha512-EWxdXID+a71UPQV/xNZwL60X9AJtumxIBWMBmvT8gT9ng57Ux52nDJVcErLl0AkT53h9sGP2K9Jt51gGSgTWEQ==", "dependencies": { "@babel/parser": "^7.13.9", "@babel/types": "^7.13.0", "@types/estree": "^0.0.48", - "@vue/compiler-core": "3.1.5", - "@vue/compiler-dom": "3.1.5", - "@vue/compiler-ssr": "3.1.5", - "@vue/shared": "3.1.5", + "@vue/compiler-core": "3.2.0", + "@vue/compiler-dom": "3.2.0", + "@vue/compiler-ssr": "3.2.0", + "@vue/shared": "3.2.0", "consolidate": "^0.16.0", "estree-walker": "^2.0.1", "hash-sum": "^2.0.0", @@ -9782,20 +9782,69 @@ "postcss-modules": "^4.0.0", "postcss-selector-parser": "^6.0.4", "source-map": "^0.6.1" - }, - "peerDependencies": { - "vue": "3.1.5" } }, - "node_modules/@vue/compiler-ssr": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.1.5.tgz", - "integrity": "sha512-CU5N7Di/a4lyJ18LGJxJYZS2a8PlLdWpWHX9p/XcsjT2TngMpj3QvHVRkuik2u8QrIDZ8OpYmTyj1WDNsOV+Dg==", + "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", + "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", "dependencies": { - "@vue/compiler-dom": "3.1.5", - "@vue/shared": "3.1.5" + "@babel/parser": "^7.12.0", + "@babel/types": "^7.12.0", + "@vue/shared": "3.2.0", + "estree-walker": "^2.0.1", + "source-map": "^0.6.1" } }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-dom": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", + "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", + "dependencies": { + "@vue/compiler-core": "3.2.0", + "@vue/shared": "3.2.0" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/shared": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", + "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.0.tgz", + "integrity": "sha512-EAdyPh/N/8V0dyg4beMPoVhgDn1VBKz1Pc5+s1VkCZ4EsVOG4bGtXUQwVXoR43bnzUcZsiwLh2ZAN4nu7c+TEg==", + "dependencies": { + "@vue/compiler-dom": "3.2.0", + "@vue/shared": "3.2.0" + } + }, + "node_modules/@vue/compiler-ssr/node_modules/@vue/compiler-core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", + "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", + "dependencies": { + "@babel/parser": "^7.12.0", + "@babel/types": "^7.12.0", + "@vue/shared": "3.2.0", + "estree-walker": "^2.0.1", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/compiler-ssr/node_modules/@vue/compiler-dom": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", + "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", + "dependencies": { + "@vue/compiler-core": "3.2.0", + "@vue/shared": "3.2.0" + } + }, + "node_modules/@vue/compiler-ssr/node_modules/@vue/shared": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", + "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" + }, "node_modules/@vue/component-compiler-utils": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.2.2.tgz", @@ -59898,7 +59947,7 @@ "@vue/cli-plugin-typescript": "4.5.13", "@vue/cli-plugin-vuex": "4.5.13", "@vue/cli-service": "4.5.13", - "@vue/compiler-sfc": "3.1.5", + "@vue/compiler-sfc": "3.2.0", "axios": "0.21.1", "base-64": "1.0.0", "codemirror": "5.62.2", @@ -68661,17 +68710,17 @@ } }, "@vue/compiler-sfc": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.1.5.tgz", - "integrity": "sha512-mtMY6xMvZeSRx9MTa1+NgJWndrkzVTdJ1pQAmAKQuxyb5LsHVvrgP7kcQFvxPHVpLVTORbTJWHaiqoKrJvi1iA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.0.tgz", + "integrity": "sha512-EWxdXID+a71UPQV/xNZwL60X9AJtumxIBWMBmvT8gT9ng57Ux52nDJVcErLl0AkT53h9sGP2K9Jt51gGSgTWEQ==", "requires": { "@babel/parser": "^7.13.9", "@babel/types": "^7.13.0", "@types/estree": "^0.0.48", - "@vue/compiler-core": "3.1.5", - "@vue/compiler-dom": "3.1.5", - "@vue/compiler-ssr": "3.1.5", - "@vue/shared": "3.1.5", + "@vue/compiler-core": "3.2.0", + "@vue/compiler-dom": "3.2.0", + "@vue/compiler-ssr": "3.2.0", + "@vue/shared": "3.2.0", "consolidate": "^0.16.0", "estree-walker": "^2.0.1", "hash-sum": "^2.0.0", @@ -68682,15 +68731,71 @@ "postcss-modules": "^4.0.0", "postcss-selector-parser": "^6.0.4", "source-map": "^0.6.1" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", + "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", + "requires": { + "@babel/parser": "^7.12.0", + "@babel/types": "^7.12.0", + "@vue/shared": "3.2.0", + "estree-walker": "^2.0.1", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", + "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", + "requires": { + "@vue/compiler-core": "3.2.0", + "@vue/shared": "3.2.0" + } + }, + "@vue/shared": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", + "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" + } } }, "@vue/compiler-ssr": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.1.5.tgz", - "integrity": "sha512-CU5N7Di/a4lyJ18LGJxJYZS2a8PlLdWpWHX9p/XcsjT2TngMpj3QvHVRkuik2u8QrIDZ8OpYmTyj1WDNsOV+Dg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.0.tgz", + "integrity": "sha512-EAdyPh/N/8V0dyg4beMPoVhgDn1VBKz1Pc5+s1VkCZ4EsVOG4bGtXUQwVXoR43bnzUcZsiwLh2ZAN4nu7c+TEg==", "requires": { - "@vue/compiler-dom": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/compiler-dom": "3.2.0", + "@vue/shared": "3.2.0" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", + "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", + "requires": { + "@babel/parser": "^7.12.0", + "@babel/types": "^7.12.0", + "@vue/shared": "3.2.0", + "estree-walker": "^2.0.1", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", + "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", + "requires": { + "@vue/compiler-core": "3.2.0", + "@vue/shared": "3.2.0" + } + }, + "@vue/shared": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", + "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" + } } }, "@vue/component-compiler-utils": { From 5ad5544bf44fe6c860d548dc172d854adbb5e9e5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 16:35:59 -0400 Subject: [PATCH 16/63] update dependency vue to v3.2.0 (#7289) Co-authored-by: Renovate Bot --- app/package.json | 2 +- package-lock.json | 244 ++++++++++------------------------- packages/shared/package.json | 2 +- 3 files changed, 70 insertions(+), 178 deletions(-) diff --git a/app/package.json b/app/package.json index 1c1a0bb3ac..5e991afeda 100644 --- a/app/package.json +++ b/app/package.json @@ -85,7 +85,7 @@ "tinymce": "5.8.2", "typescript": "4.3.5", "vite": "2.4.4", - "vue": "3.1.5", + "vue": "3.2.0", "vue-i18n": "9.1.7", "vue-router": "4.0.11", "vuedraggable": "4.0.3" diff --git a/package-lock.json b/package-lock.json index 892ce6c917..d53ad65485 100644 --- a/package-lock.json +++ b/package-lock.json @@ -373,7 +373,7 @@ "tinymce": "5.8.2", "typescript": "4.3.5", "vite": "2.4.4", - "vue": "3.1.5", + "vue": "3.2.0", "vue-i18n": "9.1.7", "vue-router": "4.0.11", "vuedraggable": "4.0.3" @@ -9740,24 +9740,24 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.5.tgz", - "integrity": "sha512-TXBhFinoBaXKDykJzY26UEuQU1K07FOp/0Ie+OXySqqk0bS0ZO7Xvl7UmiTUPYcLrWbxWBR7Bs/y55AI0MNc2Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", + "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", "dependencies": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.1.5", + "@vue/shared": "3.2.0", "estree-walker": "^2.0.1", "source-map": "^0.6.1" } }, "node_modules/@vue/compiler-dom": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.5.tgz", - "integrity": "sha512-ZsL3jqJ52OjGU/YiT/9XiuZAmWClKInZM2aFJh9gnsAPqOrj2JIELMbkIFpVKR/CrVO/f2VxfPiiQdQTr65jcQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", + "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", "dependencies": { - "@vue/compiler-core": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/compiler-core": "3.2.0", + "@vue/shared": "3.2.0" } }, "node_modules/@vue/compiler-sfc": { @@ -9784,32 +9784,6 @@ "source-map": "^0.6.1" } }, - "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", - "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", - "dependencies": { - "@babel/parser": "^7.12.0", - "@babel/types": "^7.12.0", - "@vue/shared": "3.2.0", - "estree-walker": "^2.0.1", - "source-map": "^0.6.1" - } - }, - "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-dom": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", - "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", - "dependencies": { - "@vue/compiler-core": "3.2.0", - "@vue/shared": "3.2.0" - } - }, - "node_modules/@vue/compiler-sfc/node_modules/@vue/shared": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", - "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" - }, "node_modules/@vue/compiler-ssr": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.0.tgz", @@ -9819,32 +9793,6 @@ "@vue/shared": "3.2.0" } }, - "node_modules/@vue/compiler-ssr/node_modules/@vue/compiler-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", - "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", - "dependencies": { - "@babel/parser": "^7.12.0", - "@babel/types": "^7.12.0", - "@vue/shared": "3.2.0", - "estree-walker": "^2.0.1", - "source-map": "^0.6.1" - } - }, - "node_modules/@vue/compiler-ssr/node_modules/@vue/compiler-dom": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", - "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", - "dependencies": { - "@vue/compiler-core": "3.2.0", - "@vue/shared": "3.2.0" - } - }, - "node_modules/@vue/compiler-ssr/node_modules/@vue/shared": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", - "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" - }, "node_modules/@vue/component-compiler-utils": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.2.2.tgz", @@ -10031,36 +9979,36 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz", - "integrity": "sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.0.tgz", + "integrity": "sha512-39L3UJe8+jYeCTM/QrDglDM05O11UrmyhazUOHOOj7+a9pPVu95HGInh5CkKQf98mx2gq6t3PPN8bCN5wK8Wwg==", "dependencies": { - "@vue/shared": "3.1.5" + "@vue/shared": "3.2.0" } }, "node_modules/@vue/runtime-core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.5.tgz", - "integrity": "sha512-YQbG5cBktN1RowQDKA22itmvQ+b40f0WgQ6CXK4VYoYICAiAfu6Cc14777ve8zp1rJRGtk5oIeS149TOculrTg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.0.tgz", + "integrity": "sha512-mZlkYTcw3mVwClwFTpql4hkDfOweHE/w+9r3Yb3UPwRs75bSJXMBRUikw1GVx01bZQ8VQPjBYowCElcWNSlKig==", "dependencies": { - "@vue/reactivity": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/reactivity": "3.2.0", + "@vue/shared": "3.2.0" } }, "node_modules/@vue/runtime-dom": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.5.tgz", - "integrity": "sha512-tNcf3JhVR0RfW0kw1p8xZgv30nvX8Y9rsz7eiQ0dHe273sfoCngAG0y4GvMaY4Xd8FsjUwFedd4suQ8Lu8meXg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.0.tgz", + "integrity": "sha512-NCHMfrUwpJelCTINpMRLFhzWKJkl07slabmTbECZFJnkdDfFkptGCWll42q58bbvwGmpAPDzNI3yYch72pcKwg==", "dependencies": { - "@vue/runtime-core": "3.1.5", - "@vue/shared": "3.1.5", + "@vue/runtime-core": "3.2.0", + "@vue/shared": "3.2.0", "csstype": "^2.6.8" } }, "node_modules/@vue/shared": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz", - "integrity": "sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", + "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" }, "node_modules/@vue/web-component-wrapper": { "version": "1.3.0", @@ -50398,13 +50346,13 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" }, "node_modules/vue": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.1.5.tgz", - "integrity": "sha512-Ho7HNb1nfDoO+HVb6qYZgeaobt1XbY6KXFe4HGs1b9X6RhkWG/113n4/SrtM1LUclM6OrP/Se5aPHHvAPG1iVQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.0.tgz", + "integrity": "sha512-eMo5yCdkWRmBfqp/acBI/Y1Omgk0NyGqPViaU66eOpKarXNtkdImzDA57+E76jnWVr6MEp/rg1n0vnxaVvALMQ==", "dependencies": { - "@vue/compiler-dom": "3.1.5", - "@vue/runtime-dom": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/compiler-dom": "3.2.0", + "@vue/runtime-dom": "3.2.0", + "@vue/shared": "3.2.0" } }, "node_modules/vue-eslint-parser": { @@ -57977,7 +57925,7 @@ "joi": "17.4.2", "knex-schema-inspector": "1.5.13", "lodash": "4.17.21", - "vue": "3.1.5", + "vue": "3.2.0", "vue-router": "4.0.11" }, "devDependencies": { @@ -59974,7 +59922,7 @@ "tinymce": "5.8.2", "typescript": "4.3.5", "vite": "2.4.4", - "vue": "3.1.5", + "vue": "3.2.0", "vue-i18n": "9.1.7", "vue-router": "4.0.11", "vuedraggable": "4.0.3" @@ -63219,7 +63167,7 @@ "npm-run-all": "4.1.5", "rimraf": "3.0.2", "typescript": "4.3.5", - "vue": "3.1.5", + "vue": "3.2.0", "vue-router": "4.0.11" }, "dependencies": { @@ -68689,24 +68637,24 @@ } }, "@vue/compiler-core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.5.tgz", - "integrity": "sha512-TXBhFinoBaXKDykJzY26UEuQU1K07FOp/0Ie+OXySqqk0bS0ZO7Xvl7UmiTUPYcLrWbxWBR7Bs/y55AI0MNc2Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", + "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", "requires": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.1.5", + "@vue/shared": "3.2.0", "estree-walker": "^2.0.1", "source-map": "^0.6.1" } }, "@vue/compiler-dom": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.5.tgz", - "integrity": "sha512-ZsL3jqJ52OjGU/YiT/9XiuZAmWClKInZM2aFJh9gnsAPqOrj2JIELMbkIFpVKR/CrVO/f2VxfPiiQdQTr65jcQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", + "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", "requires": { - "@vue/compiler-core": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/compiler-core": "3.2.0", + "@vue/shared": "3.2.0" } }, "@vue/compiler-sfc": { @@ -68731,34 +68679,6 @@ "postcss-modules": "^4.0.0", "postcss-selector-parser": "^6.0.4", "source-map": "^0.6.1" - }, - "dependencies": { - "@vue/compiler-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", - "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", - "requires": { - "@babel/parser": "^7.12.0", - "@babel/types": "^7.12.0", - "@vue/shared": "3.2.0", - "estree-walker": "^2.0.1", - "source-map": "^0.6.1" - } - }, - "@vue/compiler-dom": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", - "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", - "requires": { - "@vue/compiler-core": "3.2.0", - "@vue/shared": "3.2.0" - } - }, - "@vue/shared": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", - "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" - } } }, "@vue/compiler-ssr": { @@ -68768,34 +68688,6 @@ "requires": { "@vue/compiler-dom": "3.2.0", "@vue/shared": "3.2.0" - }, - "dependencies": { - "@vue/compiler-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", - "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", - "requires": { - "@babel/parser": "^7.12.0", - "@babel/types": "^7.12.0", - "@vue/shared": "3.2.0", - "estree-walker": "^2.0.1", - "source-map": "^0.6.1" - } - }, - "@vue/compiler-dom": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", - "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", - "requires": { - "@vue/compiler-core": "3.2.0", - "@vue/shared": "3.2.0" - } - }, - "@vue/shared": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", - "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" - } } }, "@vue/component-compiler-utils": { @@ -68946,36 +68838,36 @@ "requires": {} }, "@vue/reactivity": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz", - "integrity": "sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.0.tgz", + "integrity": "sha512-39L3UJe8+jYeCTM/QrDglDM05O11UrmyhazUOHOOj7+a9pPVu95HGInh5CkKQf98mx2gq6t3PPN8bCN5wK8Wwg==", "requires": { - "@vue/shared": "3.1.5" + "@vue/shared": "3.2.0" } }, "@vue/runtime-core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.5.tgz", - "integrity": "sha512-YQbG5cBktN1RowQDKA22itmvQ+b40f0WgQ6CXK4VYoYICAiAfu6Cc14777ve8zp1rJRGtk5oIeS149TOculrTg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.0.tgz", + "integrity": "sha512-mZlkYTcw3mVwClwFTpql4hkDfOweHE/w+9r3Yb3UPwRs75bSJXMBRUikw1GVx01bZQ8VQPjBYowCElcWNSlKig==", "requires": { - "@vue/reactivity": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/reactivity": "3.2.0", + "@vue/shared": "3.2.0" } }, "@vue/runtime-dom": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.5.tgz", - "integrity": "sha512-tNcf3JhVR0RfW0kw1p8xZgv30nvX8Y9rsz7eiQ0dHe273sfoCngAG0y4GvMaY4Xd8FsjUwFedd4suQ8Lu8meXg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.0.tgz", + "integrity": "sha512-NCHMfrUwpJelCTINpMRLFhzWKJkl07slabmTbECZFJnkdDfFkptGCWll42q58bbvwGmpAPDzNI3yYch72pcKwg==", "requires": { - "@vue/runtime-core": "3.1.5", - "@vue/shared": "3.1.5", + "@vue/runtime-core": "3.2.0", + "@vue/shared": "3.2.0", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz", - "integrity": "sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", + "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" }, "@vue/web-component-wrapper": { "version": "1.3.0", @@ -101045,13 +100937,13 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" }, "vue": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.1.5.tgz", - "integrity": "sha512-Ho7HNb1nfDoO+HVb6qYZgeaobt1XbY6KXFe4HGs1b9X6RhkWG/113n4/SrtM1LUclM6OrP/Se5aPHHvAPG1iVQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.0.tgz", + "integrity": "sha512-eMo5yCdkWRmBfqp/acBI/Y1Omgk0NyGqPViaU66eOpKarXNtkdImzDA57+E76jnWVr6MEp/rg1n0vnxaVvALMQ==", "requires": { - "@vue/compiler-dom": "3.1.5", - "@vue/runtime-dom": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/compiler-dom": "3.2.0", + "@vue/runtime-dom": "3.2.0", + "@vue/shared": "3.2.0" } }, "vue-eslint-parser": { diff --git a/packages/shared/package.json b/packages/shared/package.json index d979162ad5..10cbf5f750 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -51,7 +51,7 @@ "joi": "17.4.2", "knex-schema-inspector": "1.5.13", "lodash": "4.17.21", - "vue": "3.1.5", + "vue": "3.2.0", "vue-router": "4.0.11" }, "devDependencies": { From 8558beb07c2fde2f587fa67bf312e0a7f9d792ff Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Mon, 9 Aug 2021 22:57:50 +0200 Subject: [PATCH 17/63] Handle JSON in labels display (#7292) Fixes #7278 --- app/src/displays/labels/labels.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/displays/labels/labels.vue b/app/src/displays/labels/labels.vue index 37a4f3a6ec..60a0560565 100644 --- a/app/src/displays/labels/labels.vue +++ b/app/src/displays/labels/labels.vue @@ -81,17 +81,29 @@ export default defineComponent({ return items.map((item) => { const choice = (props.choices || []).find((choice) => choice.value === item); + let itemStringValue: string; + + if (typeof item === 'object') { + itemStringValue = JSON.stringify(item); + } else { + if (props.format) { + itemStringValue = formatTitle(item); + } else { + itemStringValue = item; + } + } + if (choice === undefined) { return { value: item, - text: props.format ? formatTitle(item) : item, + text: itemStringValue, foreground: props.defaultForeground, background: props.defaultBackground, }; } else { return { value: item, - text: choice.text || (props.format ? formatTitle(item) : item), + text: choice.text || itemStringValue, foreground: choice.foreground || props.defaultForeground, background: choice.background || props.defaultBackground, }; From 1ab765f003eaeaaa4a16cd35b145cb8580c6921e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:12:00 -0400 Subject: [PATCH 18/63] update dependency pinia to v2.0.0-rc.3 (#7055) Co-authored-by: Renovate Bot --- app/package.json | 2 +- package-lock.json | 65 +++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/app/package.json b/app/package.json index 5e991afeda..b91d9786ab 100644 --- a/app/package.json +++ b/app/package.json @@ -76,7 +76,7 @@ "mitt": "3.0.0", "nanoid": "3.1.23", "p-queue": "7.1.0", - "pinia": "2.0.0-beta.5", + "pinia": "2.0.0-rc.3", "prettier": "2.3.2", "pretty-ms": "7.0.1", "qrcode": "1.4.4", diff --git a/package-lock.json b/package-lock.json index d53ad65485..b800a3422d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -364,7 +364,7 @@ "mitt": "3.0.0", "nanoid": "3.1.23", "p-queue": "7.1.0", - "pinia": "2.0.0-beta.5", + "pinia": "2.0.0-rc.3", "prettier": "2.3.2", "pretty-ms": "7.0.1", "qrcode": "1.4.4", @@ -36360,17 +36360,26 @@ } }, "node_modules/pinia": { - "version": "2.0.0-beta.5", - "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.0-beta.5.tgz", - "integrity": "sha512-0XvufXNkEvl7Fk6wrg5DH/JYPihkoknet950SQNIlWxXpeI7omwR0H00QPIiEYkrdbsiHXJyvI2XndWGvD4v5A==", + "version": "2.0.0-rc.3", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.0-rc.3.tgz", + "integrity": "sha512-7MqF7sx1mymrdVcWKHAFsAwMdYKdcvKNmZ4KlgWgQbrDwQ7eU3o4qzFZJU/+b7I+pmXZ7hr154ENrBfjpQjeyQ==", "dev": true, "dependencies": { - "@vue/devtools-api": "^6.0.0-beta.15" + "@vue/devtools-api": "^6.0.0-beta.15", + "vue-demi": "latest" + }, + "funding": { + "url": "https://github.com/sponsors/posva" }, "peerDependencies": { - "typescript": "^4.3.5" + "@vue/composition-api": "^1.1.0 || ^1.1.0-0", + "typescript": "^4.3.5", + "vue": "^2.6.14 || ^3.2.0 || ^3.2.0-beta.4" }, "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + }, "typescript": { "optional": true } @@ -50355,6 +50364,32 @@ "@vue/shared": "3.2.0" } }, + "node_modules/vue-demi": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.11.2.tgz", + "integrity": "sha512-J+X8Au6BhQdcej6LY4O986634hZLu55L0ewU2j8my7WIKlu8cK0dqmdUxqVHHMd/cMrKKZ9SywB/id6aLhwCtA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, "node_modules/vue-eslint-parser": { "version": "7.10.0", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.10.0.tgz", @@ -59913,7 +59948,7 @@ "mitt": "3.0.0", "nanoid": "3.1.23", "p-queue": "7.1.0", - "pinia": "2.0.0-beta.5", + "pinia": "2.0.0-rc.3", "prettier": "2.3.2", "pretty-ms": "7.0.1", "qrcode": "1.4.4", @@ -89899,12 +89934,13 @@ "dev": true }, "pinia": { - "version": "2.0.0-beta.5", - "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.0-beta.5.tgz", - "integrity": "sha512-0XvufXNkEvl7Fk6wrg5DH/JYPihkoknet950SQNIlWxXpeI7omwR0H00QPIiEYkrdbsiHXJyvI2XndWGvD4v5A==", + "version": "2.0.0-rc.3", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.0-rc.3.tgz", + "integrity": "sha512-7MqF7sx1mymrdVcWKHAFsAwMdYKdcvKNmZ4KlgWgQbrDwQ7eU3o4qzFZJU/+b7I+pmXZ7hr154ENrBfjpQjeyQ==", "dev": true, "requires": { - "@vue/devtools-api": "^6.0.0-beta.15" + "@vue/devtools-api": "^6.0.0-beta.15", + "vue-demi": "latest" } }, "pinkie": { @@ -100946,6 +100982,13 @@ "@vue/shared": "3.2.0" } }, + "vue-demi": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.11.2.tgz", + "integrity": "sha512-J+X8Au6BhQdcej6LY4O986634hZLu55L0ewU2j8my7WIKlu8cK0dqmdUxqVHHMd/cMrKKZ9SywB/id6aLhwCtA==", + "dev": true, + "requires": {} + }, "vue-eslint-parser": { "version": "7.10.0", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.10.0.tgz", From 1fa975e59fb65c7291c2794ab43233732338bb1f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 21:20:38 +0000 Subject: [PATCH 19/63] update vue monorepo to v3.2.1 (#7293) Co-authored-by: Renovate Bot --- app/package.json | 4 +- package-lock.json | 188 +++++++++++++++++------------------ packages/shared/package.json | 2 +- 3 files changed, 97 insertions(+), 97 deletions(-) diff --git a/app/package.json b/app/package.json index b91d9786ab..6091bc16b2 100644 --- a/app/package.json +++ b/app/package.json @@ -58,7 +58,7 @@ "@vue/cli-plugin-typescript": "4.5.13", "@vue/cli-plugin-vuex": "4.5.13", "@vue/cli-service": "4.5.13", - "@vue/compiler-sfc": "3.2.0", + "@vue/compiler-sfc": "3.2.1", "axios": "0.21.1", "base-64": "1.0.0", "codemirror": "5.62.2", @@ -85,7 +85,7 @@ "tinymce": "5.8.2", "typescript": "4.3.5", "vite": "2.4.4", - "vue": "3.2.0", + "vue": "3.2.1", "vue-i18n": "9.1.7", "vue-router": "4.0.11", "vuedraggable": "4.0.3" diff --git a/package-lock.json b/package-lock.json index b800a3422d..31c02d818a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -346,7 +346,7 @@ "@vue/cli-plugin-typescript": "4.5.13", "@vue/cli-plugin-vuex": "4.5.13", "@vue/cli-service": "4.5.13", - "@vue/compiler-sfc": "3.2.0", + "@vue/compiler-sfc": "3.2.1", "axios": "0.21.1", "base-64": "1.0.0", "codemirror": "5.62.2", @@ -373,7 +373,7 @@ "tinymce": "5.8.2", "typescript": "4.3.5", "vite": "2.4.4", - "vue": "3.2.0", + "vue": "3.2.1", "vue-i18n": "9.1.7", "vue-router": "4.0.11", "vuedraggable": "4.0.3" @@ -9740,38 +9740,38 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", - "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.1.tgz", + "integrity": "sha512-UEJf2ZGww5wGVdrWIXIZo04KdJFGPmI2bHRUsBZ3AdyCAqJ5ykRXKOBn1OR1hvA2YzimudOEyHM+DpbBv91Kww==", "dependencies": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.2.0", + "@vue/shared": "3.2.1", "estree-walker": "^2.0.1", "source-map": "^0.6.1" } }, "node_modules/@vue/compiler-dom": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", - "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.1.tgz", + "integrity": "sha512-tXg8tkPb3j54zNfWqoao9T1JI41yWPz8TROzmif/QNNA46eq8/SRuRsBd36i47GWaz7mh+yg3vOJ87/YBjcMyQ==", "dependencies": { - "@vue/compiler-core": "3.2.0", - "@vue/shared": "3.2.0" + "@vue/compiler-core": "3.2.1", + "@vue/shared": "3.2.1" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.0.tgz", - "integrity": "sha512-EWxdXID+a71UPQV/xNZwL60X9AJtumxIBWMBmvT8gT9ng57Ux52nDJVcErLl0AkT53h9sGP2K9Jt51gGSgTWEQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.1.tgz", + "integrity": "sha512-fVLdme5RZVkBt+jxv2LCSRM72o4FX7BR2eu2FpjjEi1kEtUMKBDnjKwGWy7TyhTju0t0CocctyoM+G56vH7NpQ==", "dependencies": { "@babel/parser": "^7.13.9", "@babel/types": "^7.13.0", "@types/estree": "^0.0.48", - "@vue/compiler-core": "3.2.0", - "@vue/compiler-dom": "3.2.0", - "@vue/compiler-ssr": "3.2.0", - "@vue/shared": "3.2.0", + "@vue/compiler-core": "3.2.1", + "@vue/compiler-dom": "3.2.1", + "@vue/compiler-ssr": "3.2.1", + "@vue/shared": "3.2.1", "consolidate": "^0.16.0", "estree-walker": "^2.0.1", "hash-sum": "^2.0.0", @@ -9785,12 +9785,12 @@ } }, "node_modules/@vue/compiler-ssr": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.0.tgz", - "integrity": "sha512-EAdyPh/N/8V0dyg4beMPoVhgDn1VBKz1Pc5+s1VkCZ4EsVOG4bGtXUQwVXoR43bnzUcZsiwLh2ZAN4nu7c+TEg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.1.tgz", + "integrity": "sha512-6YAOtQunuEyYlVSjK1F7a7BXi7rxVfiTiJ0Ro7eq0q0MNCFV9Z+sN68lfa/E4ABVb0ledEY/Rt8kL23nwCoTCQ==", "dependencies": { - "@vue/compiler-dom": "3.2.0", - "@vue/shared": "3.2.0" + "@vue/compiler-dom": "3.2.1", + "@vue/shared": "3.2.1" } }, "node_modules/@vue/component-compiler-utils": { @@ -9979,36 +9979,36 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.0.tgz", - "integrity": "sha512-39L3UJe8+jYeCTM/QrDglDM05O11UrmyhazUOHOOj7+a9pPVu95HGInh5CkKQf98mx2gq6t3PPN8bCN5wK8Wwg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.1.tgz", + "integrity": "sha512-4Lja2KmyiKvuraDed6dXK2A6+r/7x7xGDA7vVR2Aqc8hQVu0+FWeVX+IBfiVOSpbZXFlHLNmCBFkbuWLQSlgxg==", "dependencies": { - "@vue/shared": "3.2.0" + "@vue/shared": "3.2.1" } }, "node_modules/@vue/runtime-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.0.tgz", - "integrity": "sha512-mZlkYTcw3mVwClwFTpql4hkDfOweHE/w+9r3Yb3UPwRs75bSJXMBRUikw1GVx01bZQ8VQPjBYowCElcWNSlKig==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.1.tgz", + "integrity": "sha512-IsgelRM/5hYeRhz5+ECi66XvYDdjG2t4lARjHvCXw5s9Q4N6uIbjLMwtLzAWRxYf3/y258BrD+ehxAi943ScJg==", "dependencies": { - "@vue/reactivity": "3.2.0", - "@vue/shared": "3.2.0" + "@vue/reactivity": "3.2.1", + "@vue/shared": "3.2.1" } }, "node_modules/@vue/runtime-dom": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.0.tgz", - "integrity": "sha512-NCHMfrUwpJelCTINpMRLFhzWKJkl07slabmTbECZFJnkdDfFkptGCWll42q58bbvwGmpAPDzNI3yYch72pcKwg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.1.tgz", + "integrity": "sha512-bUAHUSe49A5wYdHQ8wsLU1CMPXaG2fRuv2661mx/6Q9+20QxglT3ss8ZeL6AVRu16JNJMcdvTTsNpbnMbVc/lQ==", "dependencies": { - "@vue/runtime-core": "3.2.0", - "@vue/shared": "3.2.0", + "@vue/runtime-core": "3.2.1", + "@vue/shared": "3.2.1", "csstype": "^2.6.8" } }, "node_modules/@vue/shared": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", - "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.1.tgz", + "integrity": "sha512-INN92dVBNgd0TW9BqfQQKx/HWGCHhUUbAV5EZ5FgSCiEdwuZsJbGt1mdnaD9IxGhpiyOjP2ClxGG8SFp7ELcWg==" }, "node_modules/@vue/web-component-wrapper": { "version": "1.3.0", @@ -50355,13 +50355,13 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" }, "node_modules/vue": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.0.tgz", - "integrity": "sha512-eMo5yCdkWRmBfqp/acBI/Y1Omgk0NyGqPViaU66eOpKarXNtkdImzDA57+E76jnWVr6MEp/rg1n0vnxaVvALMQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.1.tgz", + "integrity": "sha512-0jhXluF5mzTAK5bXw/8yq4McvsI8HwEWI4cnQwJeN8NYGRbwh9wwuE4FNv1Kej9pxBB5ajTNsWr0M6DPs5EJZg==", "dependencies": { - "@vue/compiler-dom": "3.2.0", - "@vue/runtime-dom": "3.2.0", - "@vue/shared": "3.2.0" + "@vue/compiler-dom": "3.2.1", + "@vue/runtime-dom": "3.2.1", + "@vue/shared": "3.2.1" } }, "node_modules/vue-demi": { @@ -57960,7 +57960,7 @@ "joi": "17.4.2", "knex-schema-inspector": "1.5.13", "lodash": "4.17.21", - "vue": "3.2.0", + "vue": "3.2.1", "vue-router": "4.0.11" }, "devDependencies": { @@ -59930,7 +59930,7 @@ "@vue/cli-plugin-typescript": "4.5.13", "@vue/cli-plugin-vuex": "4.5.13", "@vue/cli-service": "4.5.13", - "@vue/compiler-sfc": "3.2.0", + "@vue/compiler-sfc": "3.2.1", "axios": "0.21.1", "base-64": "1.0.0", "codemirror": "5.62.2", @@ -59957,7 +59957,7 @@ "tinymce": "5.8.2", "typescript": "4.3.5", "vite": "2.4.4", - "vue": "3.2.0", + "vue": "3.2.1", "vue-i18n": "9.1.7", "vue-router": "4.0.11", "vuedraggable": "4.0.3" @@ -63202,7 +63202,7 @@ "npm-run-all": "4.1.5", "rimraf": "3.0.2", "typescript": "4.3.5", - "vue": "3.2.0", + "vue": "3.2.1", "vue-router": "4.0.11" }, "dependencies": { @@ -68672,38 +68672,38 @@ } }, "@vue/compiler-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.0.tgz", - "integrity": "sha512-+kfA4pisto26tcEh9Naf/qrizplYWnkBLHu3fX5Yu0c47RVBteVG3dHENFczl3Egwra+5NP5f3YuOgxK1ZMbNQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.1.tgz", + "integrity": "sha512-UEJf2ZGww5wGVdrWIXIZo04KdJFGPmI2bHRUsBZ3AdyCAqJ5ykRXKOBn1OR1hvA2YzimudOEyHM+DpbBv91Kww==", "requires": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.2.0", + "@vue/shared": "3.2.1", "estree-walker": "^2.0.1", "source-map": "^0.6.1" } }, "@vue/compiler-dom": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.0.tgz", - "integrity": "sha512-CqfATmX04+58LNBTTUPRBLyYGLP0bxtL+8b7B8pEvXja7fpmxiYcKBQsdaXfyqoRJsaTzA7eVXQt/t0dYhu/SQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.1.tgz", + "integrity": "sha512-tXg8tkPb3j54zNfWqoao9T1JI41yWPz8TROzmif/QNNA46eq8/SRuRsBd36i47GWaz7mh+yg3vOJ87/YBjcMyQ==", "requires": { - "@vue/compiler-core": "3.2.0", - "@vue/shared": "3.2.0" + "@vue/compiler-core": "3.2.1", + "@vue/shared": "3.2.1" } }, "@vue/compiler-sfc": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.0.tgz", - "integrity": "sha512-EWxdXID+a71UPQV/xNZwL60X9AJtumxIBWMBmvT8gT9ng57Ux52nDJVcErLl0AkT53h9sGP2K9Jt51gGSgTWEQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.1.tgz", + "integrity": "sha512-fVLdme5RZVkBt+jxv2LCSRM72o4FX7BR2eu2FpjjEi1kEtUMKBDnjKwGWy7TyhTju0t0CocctyoM+G56vH7NpQ==", "requires": { "@babel/parser": "^7.13.9", "@babel/types": "^7.13.0", "@types/estree": "^0.0.48", - "@vue/compiler-core": "3.2.0", - "@vue/compiler-dom": "3.2.0", - "@vue/compiler-ssr": "3.2.0", - "@vue/shared": "3.2.0", + "@vue/compiler-core": "3.2.1", + "@vue/compiler-dom": "3.2.1", + "@vue/compiler-ssr": "3.2.1", + "@vue/shared": "3.2.1", "consolidate": "^0.16.0", "estree-walker": "^2.0.1", "hash-sum": "^2.0.0", @@ -68717,12 +68717,12 @@ } }, "@vue/compiler-ssr": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.0.tgz", - "integrity": "sha512-EAdyPh/N/8V0dyg4beMPoVhgDn1VBKz1Pc5+s1VkCZ4EsVOG4bGtXUQwVXoR43bnzUcZsiwLh2ZAN4nu7c+TEg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.1.tgz", + "integrity": "sha512-6YAOtQunuEyYlVSjK1F7a7BXi7rxVfiTiJ0Ro7eq0q0MNCFV9Z+sN68lfa/E4ABVb0ledEY/Rt8kL23nwCoTCQ==", "requires": { - "@vue/compiler-dom": "3.2.0", - "@vue/shared": "3.2.0" + "@vue/compiler-dom": "3.2.1", + "@vue/shared": "3.2.1" } }, "@vue/component-compiler-utils": { @@ -68873,36 +68873,36 @@ "requires": {} }, "@vue/reactivity": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.0.tgz", - "integrity": "sha512-39L3UJe8+jYeCTM/QrDglDM05O11UrmyhazUOHOOj7+a9pPVu95HGInh5CkKQf98mx2gq6t3PPN8bCN5wK8Wwg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.1.tgz", + "integrity": "sha512-4Lja2KmyiKvuraDed6dXK2A6+r/7x7xGDA7vVR2Aqc8hQVu0+FWeVX+IBfiVOSpbZXFlHLNmCBFkbuWLQSlgxg==", "requires": { - "@vue/shared": "3.2.0" + "@vue/shared": "3.2.1" } }, "@vue/runtime-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.0.tgz", - "integrity": "sha512-mZlkYTcw3mVwClwFTpql4hkDfOweHE/w+9r3Yb3UPwRs75bSJXMBRUikw1GVx01bZQ8VQPjBYowCElcWNSlKig==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.1.tgz", + "integrity": "sha512-IsgelRM/5hYeRhz5+ECi66XvYDdjG2t4lARjHvCXw5s9Q4N6uIbjLMwtLzAWRxYf3/y258BrD+ehxAi943ScJg==", "requires": { - "@vue/reactivity": "3.2.0", - "@vue/shared": "3.2.0" + "@vue/reactivity": "3.2.1", + "@vue/shared": "3.2.1" } }, "@vue/runtime-dom": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.0.tgz", - "integrity": "sha512-NCHMfrUwpJelCTINpMRLFhzWKJkl07slabmTbECZFJnkdDfFkptGCWll42q58bbvwGmpAPDzNI3yYch72pcKwg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.1.tgz", + "integrity": "sha512-bUAHUSe49A5wYdHQ8wsLU1CMPXaG2fRuv2661mx/6Q9+20QxglT3ss8ZeL6AVRu16JNJMcdvTTsNpbnMbVc/lQ==", "requires": { - "@vue/runtime-core": "3.2.0", - "@vue/shared": "3.2.0", + "@vue/runtime-core": "3.2.1", + "@vue/shared": "3.2.1", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.0.tgz", - "integrity": "sha512-MgdilC3YHYSCFuNlxZBgugh8B9/h/h+nQ6lkeaxqFWW+FnV/JzCwW4Bh5bYIYvBleG8QZjFwxdmdqSAWLXzgEA==" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.1.tgz", + "integrity": "sha512-INN92dVBNgd0TW9BqfQQKx/HWGCHhUUbAV5EZ5FgSCiEdwuZsJbGt1mdnaD9IxGhpiyOjP2ClxGG8SFp7ELcWg==" }, "@vue/web-component-wrapper": { "version": "1.3.0", @@ -100973,13 +100973,13 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" }, "vue": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.0.tgz", - "integrity": "sha512-eMo5yCdkWRmBfqp/acBI/Y1Omgk0NyGqPViaU66eOpKarXNtkdImzDA57+E76jnWVr6MEp/rg1n0vnxaVvALMQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.1.tgz", + "integrity": "sha512-0jhXluF5mzTAK5bXw/8yq4McvsI8HwEWI4cnQwJeN8NYGRbwh9wwuE4FNv1Kej9pxBB5ajTNsWr0M6DPs5EJZg==", "requires": { - "@vue/compiler-dom": "3.2.0", - "@vue/runtime-dom": "3.2.0", - "@vue/shared": "3.2.0" + "@vue/compiler-dom": "3.2.1", + "@vue/runtime-dom": "3.2.1", + "@vue/shared": "3.2.1" } }, "vue-demi": { diff --git a/packages/shared/package.json b/packages/shared/package.json index 10cbf5f750..ebc7a1b349 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -51,7 +51,7 @@ "joi": "17.4.2", "knex-schema-inspector": "1.5.13", "lodash": "4.17.21", - "vue": "3.2.0", + "vue": "3.2.1", "vue-router": "4.0.11" }, "devDependencies": { From 917d575319216e70af79be83c4bbc15fdc02791a Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Mon, 9 Aug 2021 23:22:36 +0200 Subject: [PATCH 20/63] Flush caches on server (re)start (#7294) --- api/src/app.ts | 3 +++ api/src/cache.ts | 6 ++++++ api/src/controllers/utils.ts | 7 ++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/api/src/app.ts b/api/src/app.ts index decf45fc17..3591816cad 100644 --- a/api/src/app.ts +++ b/api/src/app.ts @@ -43,6 +43,7 @@ import { track } from './utils/track'; import { validateEnv } from './utils/validate-env'; import { register as registerWebhooks } from './webhooks'; import { session } from './middleware/session'; +import { flushCaches } from './cache'; export default async function createApp(): Promise { validateEnv(['KEY', 'SECRET']); @@ -64,6 +65,8 @@ export default async function createApp(): Promise { logger.warn(`Database migrations have not all been run`); } + await flushCaches(); + await initializeExtensions(); registerExtensionHooks(); diff --git a/api/src/cache.ts b/api/src/cache.ts index f19a92d9e1..813fc9a7da 100644 --- a/api/src/cache.ts +++ b/api/src/cache.ts @@ -23,6 +23,12 @@ export function getCache(): { cache: Keyv | null; schemaCache: Keyv | null } { return { cache, schemaCache }; } +export async function flushCaches(): Promise { + const { schemaCache, cache } = getCache(); + await schemaCache?.clear(); + await cache?.clear(); +} + function getKeyvInstance(ttl: number | undefined): Keyv { switch (env.CACHE_STORE) { case 'redis': diff --git a/api/src/controllers/utils.ts b/api/src/controllers/utils.ts index a4414aebef..ec64b628fd 100644 --- a/api/src/controllers/utils.ts +++ b/api/src/controllers/utils.ts @@ -8,7 +8,7 @@ import { respond } from '../middleware/respond'; import { RevisionsService, UtilsService, ImportService } from '../services'; import asyncHandler from '../utils/async-handler'; import Busboy from 'busboy'; -import { getCache } from '../cache'; +import { flushCaches } from '../cache'; const router = Router(); @@ -123,10 +123,7 @@ router.post( throw new ForbiddenException(); } - const { cache, schemaCache } = getCache(); - - await cache?.clear(); - await schemaCache?.clear(); + await flushCaches(); res.status(200).end(); }) From dc9ede85ee0af467de05eacce699e4b9631c6bf6 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 9 Aug 2021 17:27:01 -0400 Subject: [PATCH 21/63] v9.0.0-rc.89 --- api/package.json | 20 +++++++++---------- app/package.json | 10 +++++----- docs/package.json | 2 +- lerna.json | 2 +- packages/cli/package.json | 6 +++--- packages/create-directus-project/package.json | 2 +- packages/drive-azure/package.json | 4 ++-- packages/drive-gcs/package.json | 4 ++-- packages/drive-s3/package.json | 4 ++-- packages/drive/package.json | 2 +- packages/extension-sdk/package.json | 4 ++-- packages/format-title/package.json | 2 +- packages/gatsby-source-directus/package.json | 2 +- packages/schema/package.json | 2 +- packages/sdk/package.json | 2 +- packages/shared/package.json | 2 +- packages/specs/package.json | 2 +- 17 files changed, 36 insertions(+), 36 deletions(-) diff --git a/api/package.json b/api/package.json index cb365eb377..4da26f1804 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "directus", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "GPL-3.0-only", "homepage": "https://github.com/directus/directus#readme", "description": "Directus is a real-time API and App dashboard for managing SQL database content.", @@ -68,15 +68,15 @@ "example.env" ], "dependencies": { - "@directus/app": "9.0.0-rc.88", - "@directus/drive": "9.0.0-rc.88", - "@directus/drive-azure": "9.0.0-rc.88", - "@directus/drive-gcs": "9.0.0-rc.88", - "@directus/drive-s3": "9.0.0-rc.88", - "@directus/format-title": "9.0.0-rc.88", - "@directus/schema": "9.0.0-rc.88", - "@directus/shared": "9.0.0-rc.88", - "@directus/specs": "9.0.0-rc.88", + "@directus/app": "9.0.0-rc.89", + "@directus/drive": "9.0.0-rc.89", + "@directus/drive-azure": "9.0.0-rc.89", + "@directus/drive-gcs": "9.0.0-rc.89", + "@directus/drive-s3": "9.0.0-rc.89", + "@directus/format-title": "9.0.0-rc.89", + "@directus/schema": "9.0.0-rc.89", + "@directus/shared": "9.0.0-rc.89", + "@directus/specs": "9.0.0-rc.89", "@godaddy/terminus": "^4.9.0", "@rollup/plugin-alias": "^3.1.2", "@rollup/plugin-virtual": "^2.0.3", diff --git a/app/package.json b/app/package.json index 6091bc16b2..a81ae1bb76 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "@directus/app", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "private": false, "description": "Directus is an Open-Source Headless CMS & API for Managing Custom Databases", "author": "Rijk van Zanten ", @@ -27,10 +27,10 @@ }, "gitHead": "24621f3934dc77eb23441331040ed13c676ceffd", "devDependencies": { - "@directus/docs": "9.0.0-rc.88", - "@directus/extension-sdk": "9.0.0-rc.88", - "@directus/format-title": "9.0.0-rc.88", - "@directus/shared": "9.0.0-rc.88", + "@directus/docs": "9.0.0-rc.89", + "@directus/extension-sdk": "9.0.0-rc.89", + "@directus/format-title": "9.0.0-rc.89", + "@directus/shared": "9.0.0-rc.89", "@fullcalendar/core": "5.9.0", "@fullcalendar/daygrid": "5.9.0", "@fullcalendar/interaction": "5.9.0", diff --git a/docs/package.json b/docs/package.json index 7c8136996f..f20e5acf1b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "@directus/docs", "private": false, - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "", "main": "dist/index.js", "scripts": { diff --git a/lerna.json b/lerna.json index 2b577fd512..3d0f0e6bae 100644 --- a/lerna.json +++ b/lerna.json @@ -5,7 +5,7 @@ "docs", "api" ], - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "command": { "bootstrap": { "npmClientArgs": [ diff --git a/packages/cli/package.json b/packages/cli/package.json index 9d60349af4..068393b02f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@directus/cli", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "The official Directus CLI", "repository": { "type": "git", @@ -40,8 +40,8 @@ "author": "João Biondo ", "license": "MIT", "dependencies": { - "@directus/format-title": "9.0.0-rc.88", - "@directus/sdk": "9.0.0-rc.88", + "@directus/format-title": "9.0.0-rc.89", + "@directus/sdk": "9.0.0-rc.89", "@types/yargs": "^17.0.0", "app-module-path": "^2.2.0", "chalk": "^4.1.0", diff --git a/packages/create-directus-project/package.json b/packages/create-directus-project/package.json index 6fb6a8e211..8c6fca076b 100644 --- a/packages/create-directus-project/package.json +++ b/packages/create-directus-project/package.json @@ -1,6 +1,6 @@ { "name": "create-directus-project", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "A small installer util that will create a directory, add boilerplate folders, and install Directus through npm.", "main": "lib/index.js", "bin": { diff --git a/packages/drive-azure/package.json b/packages/drive-azure/package.json index 9a4cf9feb1..3e70b60752 100644 --- a/packages/drive-azure/package.json +++ b/packages/drive-azure/package.json @@ -1,6 +1,6 @@ { "name": "@directus/drive-azure", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "Azure Blob driver for @directus/drive", "license": "MIT", "main": "dist/index.js", @@ -35,7 +35,7 @@ ], "dependencies": { "@azure/storage-blob": "^12.6.0", - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "normalize-path": "^3.0.0" }, "devDependencies": { diff --git a/packages/drive-gcs/package.json b/packages/drive-gcs/package.json index 2df7b6b03a..7a3f542cd1 100644 --- a/packages/drive-gcs/package.json +++ b/packages/drive-gcs/package.json @@ -1,6 +1,6 @@ { "name": "@directus/drive-gcs", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "Google Cloud Storage driver for @directus/drive", "license": "MIT", "main": "dist/index.js", @@ -33,7 +33,7 @@ "dev": "npm run build -- -w --preserveWatchOutput --incremental" }, "dependencies": { - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "@google-cloud/storage": "^5.8.5", "normalize-path": "^3.0.0" }, diff --git a/packages/drive-s3/package.json b/packages/drive-s3/package.json index dbbabe8a40..f906649a28 100644 --- a/packages/drive-s3/package.json +++ b/packages/drive-s3/package.json @@ -1,6 +1,6 @@ { "name": "@directus/drive-s3", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "AWS S3 driver for @directus/drive", "license": "MIT", "main": "dist/index.js", @@ -34,7 +34,7 @@ "dev": "npm run build -- -w --preserveWatchOutput --incremental" }, "dependencies": { - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "aws-sdk": "^2.928.0", "normalize-path": "^3.0.0" }, diff --git a/packages/drive/package.json b/packages/drive/package.json index d7447df49e..a4c0cd72b3 100644 --- a/packages/drive/package.json +++ b/packages/drive/package.json @@ -1,6 +1,6 @@ { "name": "@directus/drive", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "Flexible and Fluent way to manage storage in Node.js.", "license": "MIT", "main": "dist/index.js", diff --git a/packages/extension-sdk/package.json b/packages/extension-sdk/package.json index 9e94ad8d9d..72d63efca3 100644 --- a/packages/extension-sdk/package.json +++ b/packages/extension-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@directus/extension-sdk", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "A toolkit to develop extensions to extend Directus.", "main": "dist/cjs/index.js", "exports": { @@ -23,7 +23,7 @@ "author": "Nicola Krumschmidt", "gitHead": "24621f3934dc77eb23441331040ed13c676ceffd", "dependencies": { - "@directus/shared": "9.0.0-rc.88", + "@directus/shared": "9.0.0-rc.89", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.0", "@vue/compiler-sfc": "^3.1.1", diff --git a/packages/format-title/package.json b/packages/format-title/package.json index 7fd982f668..c5a70d901a 100644 --- a/packages/format-title/package.json +++ b/packages/format-title/package.json @@ -1,6 +1,6 @@ { "name": "@directus/format-title", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "Custom string formatter that converts any string into [Title Case](http://www.grammar-monster.com/lessons/capital_letters_title_case.htm)", "keywords": [ "title-case", diff --git a/packages/gatsby-source-directus/package.json b/packages/gatsby-source-directus/package.json index dc2b6f03d5..bf06bb3b2d 100644 --- a/packages/gatsby-source-directus/package.json +++ b/packages/gatsby-source-directus/package.json @@ -1,6 +1,6 @@ { "name": "@directus/gatsby-source-directus", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "Source plugin for pulling data into Gatsby from a Directus API.", "author": "João Biondo ", "license": "MIT", diff --git a/packages/schema/package.json b/packages/schema/package.json index 0927079d59..54cace96e6 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@directus/schema", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "Utility for extracting information about existing DB schema", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 23fb1d863f..0abcabaed7 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@directus/sdk", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "The official Directus SDK for use in JavaScript!", "repository": { "type": "git", diff --git a/packages/shared/package.json b/packages/shared/package.json index ebc7a1b349..7f8c77862b 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@directus/shared", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "Code shared between all directus packages.", "exports": { "./composables": { diff --git a/packages/specs/package.json b/packages/specs/package.json index e1661c6430..77a4cb72f5 100644 --- a/packages/specs/package.json +++ b/packages/specs/package.json @@ -1,6 +1,6 @@ { "name": "@directus/specs", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "description": "OpenAPI Specification of the Directus API", "main": "index.js", "scripts": { From 96be02701b36fcdb87f441c090a8dd3f984db406 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 9 Aug 2021 17:43:37 -0400 Subject: [PATCH 22/63] Update package-lock --- package-lock.json | 108 +++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index 31c02d818a..62d4b3b8a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,18 +57,18 @@ }, "api": { "name": "directus", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "GPL-3.0-only", "dependencies": { - "@directus/app": "9.0.0-rc.88", - "@directus/drive": "9.0.0-rc.88", - "@directus/drive-azure": "9.0.0-rc.88", - "@directus/drive-gcs": "9.0.0-rc.88", - "@directus/drive-s3": "9.0.0-rc.88", - "@directus/format-title": "9.0.0-rc.88", - "@directus/schema": "9.0.0-rc.88", - "@directus/shared": "9.0.0-rc.88", - "@directus/specs": "9.0.0-rc.88", + "@directus/app": "9.0.0-rc.89", + "@directus/drive": "9.0.0-rc.89", + "@directus/drive-azure": "9.0.0-rc.89", + "@directus/drive-gcs": "9.0.0-rc.89", + "@directus/drive-s3": "9.0.0-rc.89", + "@directus/format-title": "9.0.0-rc.89", + "@directus/schema": "9.0.0-rc.89", + "@directus/shared": "9.0.0-rc.89", + "@directus/specs": "9.0.0-rc.89", "@godaddy/terminus": "^4.9.0", "@rollup/plugin-alias": "^3.1.2", "@rollup/plugin-virtual": "^2.0.3", @@ -313,12 +313,12 @@ }, "app": { "name": "@directus/app", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "devDependencies": { - "@directus/docs": "9.0.0-rc.88", - "@directus/extension-sdk": "9.0.0-rc.88", - "@directus/format-title": "9.0.0-rc.88", - "@directus/shared": "9.0.0-rc.88", + "@directus/docs": "9.0.0-rc.89", + "@directus/extension-sdk": "9.0.0-rc.89", + "@directus/format-title": "9.0.0-rc.89", + "@directus/shared": "9.0.0-rc.89", "@fullcalendar/core": "5.9.0", "@fullcalendar/daygrid": "5.9.0", "@fullcalendar/interaction": "5.9.0", @@ -434,7 +434,7 @@ }, "docs": { "name": "@directus/docs", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "ISC", "devDependencies": { "directory-tree": "2.2.9", @@ -53840,11 +53840,11 @@ }, "packages/cli": { "name": "@directus/cli", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "MIT", "dependencies": { - "@directus/format-title": "9.0.0-rc.88", - "@directus/sdk": "9.0.0-rc.88", + "@directus/format-title": "9.0.0-rc.89", + "@directus/sdk": "9.0.0-rc.89", "@types/yargs": "^17.0.0", "app-module-path": "^2.2.0", "chalk": "^4.1.0", @@ -54026,7 +54026,7 @@ } }, "packages/create-directus-project": { - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "GPL-3.0-only", "dependencies": { "chalk": "^4.1.1", @@ -54064,7 +54064,7 @@ }, "packages/drive": { "name": "@directus/drive", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "MIT", "dependencies": { "fs-extra": "^10.0.0", @@ -54083,11 +54083,11 @@ }, "packages/drive-azure": { "name": "@directus/drive-azure", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "MIT", "dependencies": { "@azure/storage-blob": "^12.6.0", - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "normalize-path": "^3.0.0" }, "devDependencies": { @@ -54119,10 +54119,10 @@ }, "packages/drive-gcs": { "name": "@directus/drive-gcs", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "MIT", "dependencies": { - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "@google-cloud/storage": "^5.8.5", "normalize-path": "^3.0.0" }, @@ -54141,10 +54141,10 @@ }, "packages/drive-s3": { "name": "@directus/drive-s3", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "MIT", "dependencies": { - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "aws-sdk": "^2.928.0", "normalize-path": "^3.0.0" }, @@ -54191,9 +54191,9 @@ }, "packages/extension-sdk": { "name": "@directus/extension-sdk", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "dependencies": { - "@directus/shared": "9.0.0-rc.88", + "@directus/shared": "9.0.0-rc.89", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.0", "@vue/compiler-sfc": "^3.1.1", @@ -54242,7 +54242,7 @@ }, "packages/format-title": { "name": "@directus/format-title", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "MIT", "devDependencies": { "@rollup/plugin-commonjs": "20.0.0", @@ -54261,7 +54261,7 @@ }, "packages/gatsby-source-directus": { "name": "@directus/gatsby-source-directus", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "MIT", "dependencies": { "@directus/sdk-js": "9.0.0-rc.53", @@ -57737,7 +57737,7 @@ }, "packages/schema": { "name": "@directus/schema", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "GPL-3.0", "dependencies": { "knex-schema-inspector": "1.5.13", @@ -57750,7 +57750,7 @@ }, "packages/sdk": { "name": "@directus/sdk", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "MIT", "dependencies": { "axios": "^0.21.1" @@ -57952,7 +57952,7 @@ }, "packages/shared": { "name": "@directus/shared", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "dependencies": { "date-fns": "^2.21.1", "express": "4.17.1", @@ -57996,7 +57996,7 @@ }, "packages/specs": { "name": "@directus/specs", - "version": "9.0.0-rc.88", + "version": "9.0.0-rc.89", "license": "GPL-3.0", "dependencies": { "openapi3-ts": "^2.0.1" @@ -59899,10 +59899,10 @@ "@directus/app": { "version": "file:app", "requires": { - "@directus/docs": "9.0.0-rc.88", - "@directus/extension-sdk": "9.0.0-rc.88", - "@directus/format-title": "9.0.0-rc.88", - "@directus/shared": "9.0.0-rc.88", + "@directus/docs": "9.0.0-rc.89", + "@directus/extension-sdk": "9.0.0-rc.89", + "@directus/format-title": "9.0.0-rc.89", + "@directus/shared": "9.0.0-rc.89", "@fullcalendar/core": "5.9.0", "@fullcalendar/daygrid": "5.9.0", "@fullcalendar/interaction": "5.9.0", @@ -59996,8 +59996,8 @@ "@directus/cli": { "version": "file:packages/cli", "requires": { - "@directus/format-title": "9.0.0-rc.88", - "@directus/sdk": "9.0.0-rc.88", + "@directus/format-title": "9.0.0-rc.89", + "@directus/sdk": "9.0.0-rc.89", "@types/figlet": "1.5.4", "@types/fs-extra": "9.0.12", "@types/jest": "26.0.24", @@ -60273,7 +60273,7 @@ "version": "file:packages/drive-azure", "requires": { "@azure/storage-blob": "^12.6.0", - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "@types/fs-extra": "9.0.12", "@types/jest": "26.0.24", "@types/node": "15.12.2", @@ -60303,7 +60303,7 @@ "@directus/drive-gcs": { "version": "file:packages/drive-gcs", "requires": { - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "@google-cloud/storage": "^5.8.5", "@lukeed/uuid": "2.0.0", "@types/fs-extra": "9.0.12", @@ -60321,7 +60321,7 @@ "@directus/drive-s3": { "version": "file:packages/drive-s3", "requires": { - "@directus/drive": "9.0.0-rc.88", + "@directus/drive": "9.0.0-rc.89", "@lukeed/uuid": "2.0.0", "@types/fs-extra": "9.0.12", "@types/jest": "26.0.24", @@ -60353,7 +60353,7 @@ "@directus/extension-sdk": { "version": "file:packages/extension-sdk", "requires": { - "@directus/shared": "9.0.0-rc.88", + "@directus/shared": "9.0.0-rc.89", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.0", "@vue/compiler-sfc": "^3.1.1", @@ -75540,15 +75540,15 @@ "directus": { "version": "file:api", "requires": { - "@directus/app": "9.0.0-rc.88", - "@directus/drive": "9.0.0-rc.88", - "@directus/drive-azure": "9.0.0-rc.88", - "@directus/drive-gcs": "9.0.0-rc.88", - "@directus/drive-s3": "9.0.0-rc.88", - "@directus/format-title": "9.0.0-rc.88", - "@directus/schema": "9.0.0-rc.88", - "@directus/shared": "9.0.0-rc.88", - "@directus/specs": "9.0.0-rc.88", + "@directus/app": "9.0.0-rc.89", + "@directus/drive": "9.0.0-rc.89", + "@directus/drive-azure": "9.0.0-rc.89", + "@directus/drive-gcs": "9.0.0-rc.89", + "@directus/drive-s3": "9.0.0-rc.89", + "@directus/format-title": "9.0.0-rc.89", + "@directus/schema": "9.0.0-rc.89", + "@directus/shared": "9.0.0-rc.89", + "@directus/specs": "9.0.0-rc.89", "@godaddy/terminus": "^4.9.0", "@keyv/redis": "^2.1.2", "@rollup/plugin-alias": "^3.1.2", From 1330f69eb8a0aeb8e602c0c1f853edc03feba032 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 9 Aug 2021 17:51:54 -0400 Subject: [PATCH 23/63] Update release script To workaround breaking change in npm patch :tada: --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 603d4ae90b..38090597b1 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "dev": "lerna run dev --stream --parallel", "build": "lerna run build", "pack": "node docker/pack", - "release": "lerna version --force-publish --exact", + "release": "lerna version --force-publish --exact --no-push && echo \"Don't forget to update package-lock and push the changes to GH!\"", "test": "lerna run test", "test:e2e": "jest tests -c tests/jest.config.js", "test:e2e:watch": "npm run test:e2e -- --watch", From 942b6a6b9ff2246aa6e3bed90e56a412e8031274 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 9 Aug 2021 17:53:46 -0400 Subject: [PATCH 24/63] Update changelog --- changelog.md | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/changelog.md b/changelog.md index b10c0ce6db..97f5a530c8 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,160 @@ _Changes marked with a :warning: contain potential breaking changes depending on your use of the package._ +## v9.0.0-rc.89 (August 9, 2021) + +### :sparkles: New Features + +- **App** + - [#7202](https://github.com/directus/directus/pull/7202) Support dynamic variables in conditional fields + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7166](https://github.com/directus/directus/pull/7166) Add support for app-required field state + ([@rijkvanzanten](https://github.com/rijkvanzanten)) +- **API** + - [#7201](https://github.com/directus/directus/pull/7201) Allow JSON in env variables + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7082](https://github.com/directus/directus/pull/7082) Allow setting TLS options for SMTP configuration + ([@bernatvadell](https://github.com/bernatvadell)) +- **sdk** + - [#7192](https://github.com/directus/directus/pull/7192) Updated routes for SDK Settings, Relations, Collections, and + Fields ([@jaycammarano](https://github.com/jaycammarano)) + +### :rocket: Improvements + +- **API** + - [#7294](https://github.com/directus/directus/pull/7294) Flush caches on server (re)start + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7287](https://github.com/directus/directus/pull/7287) Only treat `tinyint(1)` and `tinyint(0)` as booleans + ([@jaycammarano](https://github.com/jaycammarano)) + - [#7259](https://github.com/directus/directus/pull/7259) Rely on `RETURNING` when possible + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7248](https://github.com/directus/directus/pull/7248) Add logger statement on password request failures + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7226](https://github.com/directus/directus/pull/7226) Add cache connection fallbacks + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7223](https://github.com/directus/directus/pull/7223) Warn if a collection includes a space + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7176](https://github.com/directus/directus/pull/7176) Don't trigger updates for pre-existing selected items + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7170](https://github.com/directus/directus/pull/7170) Show any sso login warnings in stdout + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#6922](https://github.com/directus/directus/pull/6922) Switch to exifr for image metadata extraction + ([@paescuj](https://github.com/paescuj)) +- **Extensions** + - [#7275](https://github.com/directus/directus/pull/7275) Only loads app extensions if SERVE_APP is true + ([@nickrum](https://github.com/nickrum)) +- **App** + - [#7274](https://github.com/directus/directus/pull/7274) Log error message when registering app extension fails + ([@nickrum](https://github.com/nickrum)) + - [#7254](https://github.com/directus/directus/pull/7254) Rate limit the outgoing requests from the app + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7229](https://github.com/directus/directus/pull/7229) Update/tweak groups + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7177](https://github.com/directus/directus/pull/7177) Refresh token after idle period/background tab + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7161](https://github.com/directus/directus/pull/7161) Add show all/selected toggle to tree-select + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + +### :bug: Bug Fixes + +- **App** + - [#7292](https://github.com/directus/directus/pull/7292) Handle JSON in labels display + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7258](https://github.com/directus/directus/pull/7258) Don't use tags interface for CSV filter + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7253](https://github.com/directus/directus/pull/7253) Fix formatted-value overflow ellpisis on card layout + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7252](https://github.com/directus/directus/pull/7252) Handle empty collection group in custom nav + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7175](https://github.com/directus/directus/pull/7175) Fix export sidebar detail for system collections + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7173](https://github.com/directus/directus/pull/7173) Only trim input on blur for text based values + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7169](https://github.com/directus/directus/pull/7169) Make sure disabled prevents click on list-item + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7158](https://github.com/directus/directus/pull/7158) Fix list-selection branch mode unselect bug + ([@rijkvanzanten](https://github.com/rijkvanzanten)) +- **Extensions** + - [#7279](https://github.com/directus/directus/pull/7279) Fix gitignore file in extension templates being deleted when + publishing ([@nickrum](https://github.com/nickrum)) + - [#7196](https://github.com/directus/directus/pull/7196) extension-sdk no long missing common folder + ([@jaycammarano](https://github.com/jaycammarano)) +- **API** + - [#7259](https://github.com/directus/directus/pull/7259) Rely on `RETURNING` when possible + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7249](https://github.com/directus/directus/pull/7249) Fix import of perf hook on node < 16 + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7240](https://github.com/directus/directus/pull/7240) Fix error on item creation with no validation step + ([@bernatvadell](https://github.com/bernatvadell)) + - [#7200](https://github.com/directus/directus/pull/7200) Fix timezone problems in `dateTime` type + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + - [#7168](https://github.com/directus/directus/pull/7168) Fix nested m2a collection permission retrieval + ([@rijkvanzanten](https://github.com/rijkvanzanten)) +- **sdk** + - [#7192](https://github.com/directus/directus/pull/7192) Updated routes for SDK Settings, Relations, Collections, and + Fields ([@jaycammarano](https://github.com/jaycammarano)) +- **specs** + - [#7172](https://github.com/directus/directus/pull/7172) Fix spec for default folder setting + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + +### :memo: Documentation + +- [#7174](https://github.com/directus/directus/pull/7174) Remove advanced example + ([@rijkvanzanten](https://github.com/rijkvanzanten)) + +### :package: Dependency Updates + +- [#7293](https://github.com/directus/directus/pull/7293) update vue monorepo to v3.2.1 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7289](https://github.com/directus/directus/pull/7289) update dependency vue to v3.2.0 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7288](https://github.com/directus/directus/pull/7288) update dependency @vue/compiler-sfc to v3.2.0 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7283](https://github.com/directus/directus/pull/7283) update typescript-eslint monorepo to v4.29.1 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7272](https://github.com/directus/directus/pull/7272) update dependency vue-router to v4.0.11 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7271](https://github.com/directus/directus/pull/7271) update dependency ts-node to v10.2.0 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7269](https://github.com/directus/directus/pull/7269) update dependency rollup to v2.56.1 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7263](https://github.com/directus/directus/pull/7263) update dependency @vitejs/plugin-vue to v1.4.0 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7255](https://github.com/directus/directus/pull/7255) update dependency p-queue to v7 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7238](https://github.com/directus/directus/pull/7238) update dependency lint-staged to v11.1.2 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7230](https://github.com/directus/directus/pull/7230) Fix pino deprecation warning + ([@rijkvanzanten](https://github.com/rijkvanzanten)) +- [#7227](https://github.com/directus/directus/pull/7227) update dependency npm to v7.20.5 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7225](https://github.com/directus/directus/pull/7225) update dependency npm to v7.20.4 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7208](https://github.com/directus/directus/pull/7208) update dependency rollup to v2.56.0 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7194](https://github.com/directus/directus/pull/7194) update dependency gatsby-source-filesystem to v3.11.0 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7187](https://github.com/directus/directus/pull/7187) update dependency npm to v7.20.3 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7181](https://github.com/directus/directus/pull/7181) update dependency sass to v1.37.5 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7179](https://github.com/directus/directus/pull/7179) update dependency sass to v1.37.4 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7171](https://github.com/directus/directus/pull/7171) update dependency sass to v1.37.3 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7165](https://github.com/directus/directus/pull/7165) update dependency @popperjs/core to v2.9.3 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7153](https://github.com/directus/directus/pull/7153) update dependency @types/lodash to v4.14.172 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7151](https://github.com/directus/directus/pull/7151) update dependency eslint-plugin-vue to v7.15.1 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7150](https://github.com/directus/directus/pull/7150) update dependency sass to v1.37.2 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7148](https://github.com/directus/directus/pull/7148) update dependency sass to v1.37.1 + ([@renovate[bot]](https://github.com/apps/renovate)) +- [#7055](https://github.com/directus/directus/pull/7055) update dependency pinia to v2.0.0-rc.3 + ([@renovate[bot]](https://github.com/apps/renovate)) + ## v9.0.0-rc.88 (August 2, 2021) ### :sparkles: New Features From a131005f6ee34c0dceb612033bc6fa3ac58d58a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 22:04:04 +0000 Subject: [PATCH 25/63] update dependency pinia to v2.0.0-rc.4 (#7297) Co-authored-by: Renovate Bot --- app/package.json | 2 +- package-lock.json | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/package.json b/app/package.json index a81ae1bb76..4493707eab 100644 --- a/app/package.json +++ b/app/package.json @@ -76,7 +76,7 @@ "mitt": "3.0.0", "nanoid": "3.1.23", "p-queue": "7.1.0", - "pinia": "2.0.0-rc.3", + "pinia": "2.0.0-rc.4", "prettier": "2.3.2", "pretty-ms": "7.0.1", "qrcode": "1.4.4", diff --git a/package-lock.json b/package-lock.json index 62d4b3b8a2..9e89330511 100644 --- a/package-lock.json +++ b/package-lock.json @@ -364,7 +364,7 @@ "mitt": "3.0.0", "nanoid": "3.1.23", "p-queue": "7.1.0", - "pinia": "2.0.0-rc.3", + "pinia": "2.0.0-rc.4", "prettier": "2.3.2", "pretty-ms": "7.0.1", "qrcode": "1.4.4", @@ -36360,9 +36360,9 @@ } }, "node_modules/pinia": { - "version": "2.0.0-rc.3", - "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.0-rc.3.tgz", - "integrity": "sha512-7MqF7sx1mymrdVcWKHAFsAwMdYKdcvKNmZ4KlgWgQbrDwQ7eU3o4qzFZJU/+b7I+pmXZ7hr154ENrBfjpQjeyQ==", + "version": "2.0.0-rc.4", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.0-rc.4.tgz", + "integrity": "sha512-I43V1TIFyDWT4UTi1CPLQXQZYXGQHQMKpDPI+oxC2fv0c+ej0fQBoKCn4WbfRWB+Vf5chhWM97GFLI+OWmUQEQ==", "dev": true, "dependencies": { "@vue/devtools-api": "^6.0.0-beta.15", @@ -36372,9 +36372,9 @@ "url": "https://github.com/sponsors/posva" }, "peerDependencies": { - "@vue/composition-api": "^1.1.0 || ^1.1.0-0", + "@vue/composition-api": "^1.1.0", "typescript": "^4.3.5", - "vue": "^2.6.14 || ^3.2.0 || ^3.2.0-beta.4" + "vue": "^2.6.14 || ^3.2.0" }, "peerDependenciesMeta": { "@vue/composition-api": { @@ -59948,7 +59948,7 @@ "mitt": "3.0.0", "nanoid": "3.1.23", "p-queue": "7.1.0", - "pinia": "2.0.0-rc.3", + "pinia": "2.0.0-rc.4", "prettier": "2.3.2", "pretty-ms": "7.0.1", "qrcode": "1.4.4", @@ -89934,9 +89934,9 @@ "dev": true }, "pinia": { - "version": "2.0.0-rc.3", - "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.0-rc.3.tgz", - "integrity": "sha512-7MqF7sx1mymrdVcWKHAFsAwMdYKdcvKNmZ4KlgWgQbrDwQ7eU3o4qzFZJU/+b7I+pmXZ7hr154ENrBfjpQjeyQ==", + "version": "2.0.0-rc.4", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.0-rc.4.tgz", + "integrity": "sha512-I43V1TIFyDWT4UTi1CPLQXQZYXGQHQMKpDPI+oxC2fv0c+ej0fQBoKCn4WbfRWB+Vf5chhWM97GFLI+OWmUQEQ==", "dev": true, "requires": { "@vue/devtools-api": "^6.0.0-beta.15", From b4a6d7383584c389644f6ba516cb232b855ff205 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Aug 2021 08:56:38 -0400 Subject: [PATCH 26/63] update dependency rollup to v2.56.2 (#7303) Co-authored-by: Renovate Bot --- package-lock.json | 20 ++++++++++---------- packages/format-title/package.json | 2 +- packages/sdk/package.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9e89330511..89861db82d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43450,9 +43450,9 @@ } }, "node_modules/rollup": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.1.tgz", - "integrity": "sha512-KkrsNjeiTfGJMUFBi/PNfj3fnt70akqdoNXOjlzwo98uA1qrlkmgt6SGaK5OwhyDYCVnJb6jb2Xa2wbI47P4Nw==", + "version": "2.56.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.2.tgz", + "integrity": "sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ==", "bin": { "rollup": "dist/bin/rollup" }, @@ -54249,7 +54249,7 @@ "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.0.4", "rimraf": "3.0.2", - "rollup": "2.56.1", + "rollup": "2.56.2", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", @@ -57768,7 +57768,7 @@ "nock": "13.1.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "rollup": "2.56.1", + "rollup": "2.56.2", "rollup-plugin-copy": "3.4.0", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", @@ -60395,7 +60395,7 @@ "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.0.4", "rimraf": "3.0.2", - "rollup": "2.56.1", + "rollup": "2.56.2", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", @@ -63023,7 +63023,7 @@ "nock": "13.1.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "rollup": "2.56.1", + "rollup": "2.56.2", "rollup-plugin-copy": "3.4.0", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", @@ -95499,9 +95499,9 @@ } }, "rollup": { - "version": "2.56.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.1.tgz", - "integrity": "sha512-KkrsNjeiTfGJMUFBi/PNfj3fnt70akqdoNXOjlzwo98uA1qrlkmgt6SGaK5OwhyDYCVnJb6jb2Xa2wbI47P4Nw==", + "version": "2.56.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.2.tgz", + "integrity": "sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ==", "requires": { "fsevents": "~2.3.2" } diff --git a/packages/format-title/package.json b/packages/format-title/package.json index c5a70d901a..99a19e3357 100644 --- a/packages/format-title/package.json +++ b/packages/format-title/package.json @@ -36,7 +36,7 @@ "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.0.4", "rimraf": "3.0.2", - "rollup": "2.56.1", + "rollup": "2.56.2", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 0abcabaed7..5a56d505cd 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -58,7 +58,7 @@ "nock": "13.1.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "rollup": "2.56.1", + "rollup": "2.56.2", "rollup-plugin-copy": "3.4.0", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-terser": "7.0.2", From cacd4f4ff1f95c7a8d23c5b5b3ac3e4fd29441c9 Mon Sep 17 00:00:00 2001 From: Pascal Jufer Date: Tue, 10 Aug 2021 15:30:24 +0200 Subject: [PATCH 27/63] Fix HTTP method for collections.createMany in SDK (#7304) * Fix HTTP method for collections.createMany in SDK * Post collections in data body Co-authored-by: rijkvanzanten --- packages/sdk/src/handlers/collections.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/sdk/src/handlers/collections.ts b/packages/sdk/src/handlers/collections.ts index 44e3341329..34a20b051a 100644 --- a/packages/sdk/src/handlers/collections.ts +++ b/packages/sdk/src/handlers/collections.ts @@ -33,9 +33,7 @@ export class CollectionsHandler { } async createMany(collections: PartialItem[]): Promise> { - const { data, meta } = await this.transport.get(`/collections`, { - params: collections, - }); + const { data, meta } = await this.transport.post(`/collections`, collections); return { data, From 123c3b11822d70ead99078a37ffdd97ef41d59a5 Mon Sep 17 00:00:00 2001 From: Pascal Jufer Date: Tue, 10 Aug 2021 15:39:47 +0200 Subject: [PATCH 28/63] Add perm check for sqlite, upload, extensions dirs (#7310) Co-authored-by: Rijk van Zanten --- api/src/app.ts | 3 +++ api/src/utils/validate-storage.ts | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 api/src/utils/validate-storage.ts diff --git a/api/src/app.ts b/api/src/app.ts index 3591816cad..5ed1fd4034 100644 --- a/api/src/app.ts +++ b/api/src/app.ts @@ -41,6 +41,7 @@ import sanitizeQuery from './middleware/sanitize-query'; import schema from './middleware/schema'; import { track } from './utils/track'; import { validateEnv } from './utils/validate-env'; +import { validateStorage } from './utils/validate-storage'; import { register as registerWebhooks } from './webhooks'; import { session } from './middleware/session'; import { flushCaches } from './cache'; @@ -54,6 +55,8 @@ export default async function createApp(): Promise { logger.warn('PUBLIC_URL is not a valid URL'); } + await validateStorage(); + await validateDBConnection(); if ((await isInstalled()) === false) { diff --git a/api/src/utils/validate-storage.ts b/api/src/utils/validate-storage.ts new file mode 100644 index 0000000000..bee2ed02db --- /dev/null +++ b/api/src/utils/validate-storage.ts @@ -0,0 +1,31 @@ +import env from '../env'; +import logger from '../logger'; +import { access } from 'fs/promises'; +import { constants } from 'fs'; +import path from 'path'; + +export async function validateStorage(): Promise { + if (env.DB_CLIENT === 'sqlite3') { + try { + await access(path.dirname(env.DB_FILENAME), constants.R_OK | constants.W_OK); + } catch { + logger.warn( + `Directory for SQLite database file (${path.resolve(path.dirname(env.DB_FILENAME))}) is not read/writeable!` + ); + } + } + + if (env.STORAGE_LOCATIONS.split(',').includes('local')) { + try { + await access(env.STORAGE_LOCAL_ROOT, constants.R_OK | constants.W_OK); + } catch { + logger.warn(`Upload directory (${path.resolve(env.STORAGE_LOCAL_ROOT)}) is not read/writeable!`); + } + } + + try { + await access(env.EXTENSIONS_PATH, constants.R_OK); + } catch { + logger.warn(`Extensions directory (${path.resolve(env.EXTENSIONS_PATH)}) is not readable!`); + } +} From 7437f594bd2df32d93aee14e0e5e69e261ccf964 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:46:02 -0400 Subject: [PATCH 29/63] update dependency eslint-plugin-vue to v7.16.0 (#7300) Co-authored-by: Renovate Bot --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 89861db82d..251a4394b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "eslint": "7.32.0", "eslint-config-prettier": "8.3.0", "eslint-plugin-prettier": "3.4.0", - "eslint-plugin-vue": "7.15.1", + "eslint-plugin-vue": "7.16.0", "globby": "11.0.4", "jest": "27.0.6", "knex": "0.95.9", @@ -19519,9 +19519,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "7.15.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.15.1.tgz", - "integrity": "sha512-4/r+n/i+ovyeW2gVRRH92kpy4lkpFbyPR4BMxGBTLtGnwqOKKzjSo6EMSaT0RhWPvEjK9uifcY8e7z5n8BIEgw==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.16.0.tgz", + "integrity": "sha512-0E2dVvVC7I2Xm1HXyx+ZwPj9CNX4NJjs4K4r+GVsHWyt5Pew3JLD4fI7A91b2jeL0TXE7LlszrwLSTJU9eqehw==", "dev": true, "dependencies": { "eslint-utils": "^2.1.0", @@ -76809,9 +76809,9 @@ "requires": {} }, "eslint-plugin-vue": { - "version": "7.15.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.15.1.tgz", - "integrity": "sha512-4/r+n/i+ovyeW2gVRRH92kpy4lkpFbyPR4BMxGBTLtGnwqOKKzjSo6EMSaT0RhWPvEjK9uifcY8e7z5n8BIEgw==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.16.0.tgz", + "integrity": "sha512-0E2dVvVC7I2Xm1HXyx+ZwPj9CNX4NJjs4K4r+GVsHWyt5Pew3JLD4fI7A91b2jeL0TXE7LlszrwLSTJU9eqehw==", "dev": true, "requires": { "eslint-utils": "^2.1.0", diff --git a/package.json b/package.json index 38090597b1..d319721197 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "eslint": "7.32.0", "eslint-config-prettier": "8.3.0", "eslint-plugin-prettier": "3.4.0", - "eslint-plugin-vue": "7.15.1", + "eslint-plugin-vue": "7.16.0", "globby": "11.0.4", "jest": "27.0.6", "knex": "0.95.9", From 0214b9a1bb776a73ffe72ad230f8c2023ac617e0 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Tue, 10 Aug 2021 16:00:22 +0200 Subject: [PATCH 30/63] Fix uuid resolving in SQLite (#7312) Fixes #7306 --- api/src/services/items.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/services/items.ts b/api/src/services/items.ts index 5fe90a5e10..a018353822 100644 --- a/api/src/services/items.ts +++ b/api/src/services/items.ts @@ -134,7 +134,7 @@ export class ItemsService implements AbstractSer try { const result = await trx.insert(payloadWithoutAliases).into(this.collection).returning(primaryKeyField); - primaryKey = result[0]; + primaryKey = primaryKey ?? result[0]; } catch (err) { throw await translateDatabaseError(err); } From 64fdc48adee0b4ec7955783e1f58603a630e7bff Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Tue, 10 Aug 2021 16:14:51 +0200 Subject: [PATCH 31/63] Clear the file payload after file upload (#7315) Fixes #7305 --- api/src/controllers/files.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/controllers/files.ts b/api/src/controllers/files.ts index 3538a94937..78ae4077dc 100644 --- a/api/src/controllers/files.ts +++ b/api/src/controllers/files.ts @@ -33,7 +33,7 @@ const multipartHandler = asyncHandler(async (req, res, next) => { */ let disk: string = toArray(env.STORAGE_LOCATIONS)[0]; - const payload: Partial = {}; + let payload: Partial = {}; let fileCount = 0; busboy.on('field', (fieldname: keyof File, val) => { @@ -70,6 +70,9 @@ const multipartHandler = asyncHandler(async (req, res, next) => { storage: payload.storage || disk, }; + // Clear the payload for the next to-be-uploaded file + payload = {}; + try { const primaryKey = await service.uploadOne(fileStream, payloadWithRequiredFields, existingPrimaryKey); savedFiles.push(primaryKey); From 260506d5cf39f3499be21f24aa64965fc9276d53 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 10 Aug 2021 10:23:45 -0400 Subject: [PATCH 32/63] Improve type checking --- app/src/interfaces/file/file.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/interfaces/file/file.vue b/app/src/interfaces/file/file.vue index 01ae18a784..65681cf702 100644 --- a/app/src/interfaces/file/file.vue +++ b/app/src/interfaces/file/file.vue @@ -17,7 +17,7 @@ class="preview" :class="{ 'has-file': file, - 'is-svg': file && file.type.includes('svg'), + 'is-svg': file?.type?.includes('svg'), }" > From 443f4591d782cd83c432bdcb407c0bee93f66137 Mon Sep 17 00:00:00 2001 From: Pascal Jufer Date: Tue, 10 Aug 2021 16:41:06 +0200 Subject: [PATCH 33/63] Mention TELEMETRY environment variable in docs (#7317) * Mention TELEMETRY environment variable in docs * Add clarification Co-authored-by: rijkvanzanten --- docs/reference/environment-variables.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/reference/environment-variables.md b/docs/reference/environment-variables.md index c516240db0..d9cfe36882 100644 --- a/docs/reference/environment-variables.md +++ b/docs/reference/environment-variables.md @@ -338,7 +338,7 @@ Based on the `EMAIL_TRANSPORT` used, you must also provide the following configu | `EMAIL_MAILGUN_DOMAIN` | A domain from [your Mailgun account](https://app.mailgun.com/app/sending/domains) | -- | | `EMAIL_MAILGUN_HOST` | Allows you to specify a custom host. | 'api.mailgun.net' | -## Misc. +## Admin Account If you're relying on Docker and/or the `directus bootstrap` CLI command, you can pass the following two environment variables to automatically configure the first user: @@ -348,6 +348,16 @@ variables to automatically configure the first user: | `ADMIN_EMAIL` | The email address of the first user that's automatically created when using `directus bootstrap`. | -- | | `ADMIN_PASSWORD` | The password of the first user that's automatically created when using `directus bootstrap`. | -- | +## Telemetry + +To more accurately gauge the frequency of installation, version fragmentation, and general size of the userbase, +Directus collects little and anonymized data about your environment. You can easily opt-out with the following +environment variable: + +| Variable | Description | Default Value | +| ----------- | ----------------------------------------------------------------- | ------------- | +| `TELEMETRY` | Allow Directus to collect anonymized data about your environment. | true | + --- ## Type Casting and Nesting From 5b92d7fa66ecccae12cf2f705446ed668377f41f Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 10 Aug 2021 10:52:16 -0400 Subject: [PATCH 34/63] Import access from fs-extra instead of fs/promises --- api/src/utils/validate-storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/utils/validate-storage.ts b/api/src/utils/validate-storage.ts index bee2ed02db..12478c1dce 100644 --- a/api/src/utils/validate-storage.ts +++ b/api/src/utils/validate-storage.ts @@ -1,6 +1,6 @@ import env from '../env'; import logger from '../logger'; -import { access } from 'fs/promises'; +import { access } from 'fs-extra'; import { constants } from 'fs'; import path from 'path'; From 26a8291e3e018c956f68181eed701c77b1b6d9ff Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 10 Aug 2021 11:01:23 -0400 Subject: [PATCH 35/63] Resolve sorting in list-o2m-tree-view on dnd --- app/src/interfaces/list-o2m-tree-view/list-o2m-tree-view.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/interfaces/list-o2m-tree-view/list-o2m-tree-view.vue b/app/src/interfaces/list-o2m-tree-view/list-o2m-tree-view.vue index 98f1ce2072..a093dca065 100644 --- a/app/src/interfaces/list-o2m-tree-view/list-o2m-tree-view.vue +++ b/app/src/interfaces/list-o2m-tree-view/list-o2m-tree-view.vue @@ -210,7 +210,7 @@ export default defineComponent({ return (value || []).map((item, index) => { return { ...item, - [relation.value.meta!.sort_field!]: index, + [relation.value.meta!.sort_field!]: index + 1, [relation.value.meta!.one_field!]: addSort(item[relation.value.meta!.one_field!]), }; }); @@ -227,7 +227,7 @@ export default defineComponent({ } function onDraggableChange() { - emit('input', stagedValues.value); + emitValue(stagedValues.value); } function useSelection() { From 3f3b3f0e16582c79bd68d68d728b02c8e6a69452 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Tue, 10 Aug 2021 17:16:29 +0200 Subject: [PATCH 36/63] Fix graphql GET request cache query extraction (#7319) Fixes #7298 --- api/src/utils/get-cache-key.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/utils/get-cache-key.ts b/api/src/utils/get-cache-key.ts index 30236ee829..99f83e54f3 100644 --- a/api/src/utils/get-cache-key.ts +++ b/api/src/utils/get-cache-key.ts @@ -8,7 +8,7 @@ export function getCacheKey(req: Request): string { const info = { user: req.accountability?.user || null, path, - query: path?.includes('/graphql') ? req.params.query : req.sanitizedQuery, + query: path?.includes('/graphql') ? req.query.query : req.sanitizedQuery, }; const key = hash(info); From 2789e27c26c608c3d788c2ef96459ff7e8ddf8b4 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Tue, 10 Aug 2021 18:39:58 +0200 Subject: [PATCH 37/63] Check for related collection before creation relation (#7323) Fixes #7302 --- api/src/services/relations.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/services/relations.ts b/api/src/services/relations.ts index 6df956a4ab..636e5336da 100644 --- a/api/src/services/relations.ts +++ b/api/src/services/relations.ts @@ -143,6 +143,10 @@ export class RelationsService { ); } + if (relation.related_collection && relation.related_collection in this.schema.collections === false) { + throw new InvalidPayloadException(`Collection "${relation.related_collection}" doesn't exist`); + } + const existingRelation = this.schema.relations.find( (existingRelation) => existingRelation.collection === relation.collection && existingRelation.field === relation.field From 670b45623728ba0770515e1911ee97438d6c77bb Mon Sep 17 00:00:00 2001 From: Adrian Dimitrov Date: Tue, 10 Aug 2021 17:45:16 +0100 Subject: [PATCH 38/63] Fix colors on different types (#7322) Co-authored-by: Rijk van Zanten --- .../presentation-links/presentation-links.vue | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/app/src/interfaces/presentation-links/presentation-links.vue b/app/src/interfaces/presentation-links/presentation-links.vue index 2ca7321c25..ef35b55132 100644 --- a/app/src/interfaces/presentation-links/presentation-links.vue +++ b/app/src/interfaces/presentation-links/presentation-links.vue @@ -64,35 +64,32 @@ export default defineComponent({ .action { &.info { - --v-button-icon-color: var(--white); - --v-button-background-color: var(--primary); - --v-button-background-color-hover: var(--primary-110); - --v-button-color: var(--white); - --v-button-color-hover: var(--white); + --v-button-background-color: var(--blue); + --v-button-background-color-hover: var(--blue-125); + --v-button-color: var(--blue-alt); + --v-button-color-hover: var(--blue-alt); } &.success { - --v-button-icon-color: var(--white); --v-button-background-color: var(--success); - --v-button-background-color-hover: var(--success-110); - --v-button-color: var(--white); - --v-button-color-hover: var(--white); + --v-button-background-color-hover: var(--success-125); + --v-button-color: var(--success-alt); + --v-button-color-hover: var(--success-alt); } &.warning { - --v-button-icon-color: var(--white); --v-button-background-color: var(--warning); - --v-button-background-color-hover: var(--warning-110); - --v-button-color: var(--white); - --v-button-color-hover: var(--white); + --v-button-background-color-hover: var(--warning-125); + --v-button-color: var(--warning-alt); + --v-button-color-hover: var(--warning-alt); } &.danger { --v-button-icon-color: var(--white); --v-button-background-color: var(--danger); - --v-button-background-color-hover: var(--danger-110); - --v-button-color: var(--white); - --v-button-color-hover: var(--white); + --v-button-background-color-hover: var(--danger-125); + --v-button-color: var(--danger-alt); + --v-button-color-hover: var(--danger-alt); } } From 8d78f700502969920f6e8be7b56dc1deaabc9bdf Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Tue, 10 Aug 2021 20:46:30 +0200 Subject: [PATCH 39/63] Check for non-existing parent pk records (#7331) Fixes #7330 --- api/src/services/payload.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/src/services/payload.ts b/api/src/services/payload.ts index d428f760d7..ccf80d70fb 100644 --- a/api/src/services/payload.ts +++ b/api/src/services/payload.ts @@ -2,7 +2,7 @@ import argon2 from 'argon2'; import { format, parseISO } from 'date-fns'; import Joi from 'joi'; import { Knex } from 'knex'; -import { clone, cloneDeep, isObject, isPlainObject, omit } from 'lodash'; +import { clone, cloneDeep, isObject, isPlainObject, omit, isNil } from 'lodash'; import { v4 as uuidv4 } from 'uuid'; import getDatabase from '../database'; import { ForbiddenException, InvalidPayloadException } from '../exceptions'; @@ -512,8 +512,9 @@ export class PayloadService { // primary key might be reported as a string instead of number, coming from the // http route, and or a bigInteger in the DB if ( - existingRecord[relation.field] == parent || - existingRecord[relation.field] == payload[currentPrimaryKeyField] + isNil(existingRecord[relation.field]) === false && + (existingRecord[relation.field] == parent || + existingRecord[relation.field] == payload[currentPrimaryKeyField]) ) { savedPrimaryKeys.push(existingRecord[relatedPrimaryKeyField]); continue; From 6ef348a118cac7d0191ec62e9cd582259b972d90 Mon Sep 17 00:00:00 2001 From: Adrian Dimitrov Date: Tue, 10 Aug 2021 19:50:05 +0100 Subject: [PATCH 40/63] Schema field types are not translated in the app (#7327) * Fix field type label translations * Use translate-object-values util Co-authored-by: rijkvanzanten --- app/src/interfaces/list/options.vue | 3 +- .../field-detail/components/schema.vue | 36 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/app/src/interfaces/list/options.vue b/app/src/interfaces/list/options.vue index 3e62b4a6cb..2899f38954 100644 --- a/app/src/interfaces/list/options.vue +++ b/app/src/interfaces/list/options.vue @@ -29,6 +29,7 @@ import Repeater from './list.vue'; import { Field, FieldMeta } from '@directus/shared/types'; import { fieldTypes } from '@/modules/settings/routes/data-model/field-detail/components/schema.vue'; import { DeepPartial } from '@directus/shared/types'; +import { translate } from '@/utils/translate-object-values'; export default defineComponent({ components: { Repeater }, @@ -110,7 +111,7 @@ export default defineComponent({ width: 'half', sort: 4, options: { - choices: fieldTypes, + choices: translate(fieldTypes), }, }, schema: null, diff --git a/app/src/modules/settings/routes/data-model/field-detail/components/schema.vue b/app/src/modules/settings/routes/data-model/field-detail/components/schema.vue index 1a4fbb61af..8ca199923a 100644 --- a/app/src/modules/settings/routes/data-model/field-detail/components/schema.vue +++ b/app/src/modules/settings/routes/data-model/field-detail/components/schema.vue @@ -163,72 +163,72 @@ + + + + diff --git a/app/src/interfaces/map/options.vue b/app/src/interfaces/map/options.vue new file mode 100644 index 0000000000..cd14a5ae25 --- /dev/null +++ b/app/src/interfaces/map/options.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/app/src/interfaces/map/style.ts b/app/src/interfaces/map/style.ts new file mode 100644 index 0000000000..6940e6f7af --- /dev/null +++ b/app/src/interfaces/map/style.ts @@ -0,0 +1,219 @@ +export default [ + { + id: 'directus-polygon-fill-inactive', + type: 'fill', + filter: ['all', ['==', 'active', 'false'], ['==', '$type', 'Polygon'], ['!=', 'mode', 'static']], + paint: { + 'fill-color': '#3bb2d0', + 'fill-outline-color': '#3bb2d0', + 'fill-opacity': 0.1, + }, + }, + { + id: 'directus-polygon-fill-active', + type: 'fill', + filter: ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']], + paint: { + 'fill-color': '#fbb03b', + 'fill-outline-color': '#fbb03b', + 'fill-opacity': 0.1, + }, + }, + { + id: 'directus-polygon-midpoint', + type: 'circle', + filter: ['all', ['==', '$type', 'Point'], ['==', 'meta', 'midpoint']], + paint: { + 'circle-radius': 3, + 'circle-color': '#fbb03b', + }, + }, + { + id: 'directus-polygon-stroke-inactive', + type: 'line', + filter: ['all', ['==', 'active', 'false'], ['==', '$type', 'Polygon'], ['!=', 'mode', 'static']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#3bb2d0', + 'line-width': 2, + }, + }, + { + id: 'directus-polygon-stroke-active', + type: 'line', + filter: ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#fbb03b', + 'line-dasharray': [0.2, 2], + 'line-width': 2, + }, + }, + { + id: 'directus-line-inactive', + type: 'line', + filter: ['all', ['==', 'active', 'false'], ['==', '$type', 'LineString'], ['!=', 'mode', 'static']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#3bb2d0', + 'line-width': 2, + }, + }, + { + id: 'directus-line-active', + type: 'line', + filter: ['all', ['==', '$type', 'LineString'], ['==', 'active', 'true']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#fbb03b', + 'line-dasharray': [0.2, 2], + 'line-width': 2, + }, + }, + { + id: 'directus-polygon-and-line-vertex-stroke-inactive', + type: 'circle', + filter: ['all', ['==', 'meta', 'vertex'], ['==', '$type', 'Point'], ['!=', 'mode', 'static']], + paint: { + 'circle-radius': 5, + 'circle-color': '#fff', + }, + }, + { + id: 'directus-polygon-and-line-vertex-inactive', + type: 'circle', + filter: ['all', ['==', 'meta', 'vertex'], ['==', '$type', 'Point'], ['!=', 'mode', 'static']], + paint: { + 'circle-radius': 3, + 'circle-color': '#fbb03b', + }, + }, + { + id: 'directus-points-shadow', + filter: [ + 'all', + ['==', 'active', 'false'], + ['==', '$type', 'Point'], + ['==', 'meta', 'feature'], + ['!=', 'meta', 'midpoint'], + ], + type: 'circle', + paint: { + 'circle-pitch-alignment': 'map', + 'circle-blur': 1, + 'circle-opacity': 0.5, + 'circle-radius': 6, + }, + }, + { + id: 'directus-point-inactive', + filter: [ + 'all', + ['==', '$type', 'Point'], + ['==', 'active', 'false'], + ['==', 'meta', 'feature'], + ['!=', 'meta', 'midpoint'], + ], + type: 'symbol', + layout: { + 'icon-image': 'place', + 'icon-anchor': 'bottom', + 'icon-allow-overlap': true, + 'icon-size': 2, + 'icon-offset': [0, 3], + }, + paint: { + 'icon-color': '#3bb2d0', + }, + }, + { + id: 'directus-point-active', + filter: [ + 'all', + ['==', '$type', 'Point'], + ['==', 'active', 'true'], + ['==', 'meta', 'feature'], + ['!=', 'meta', 'midpoint'], + ], + type: 'symbol', + layout: { + 'icon-image': 'place', + 'icon-anchor': 'bottom', + 'icon-allow-overlap': true, + 'icon-size': 2, + 'icon-offset': [0, 3], + }, + paint: { + 'icon-color': '#fbb03b', + }, + }, + { + id: 'directus-point-static', + type: 'symbol', + filter: [ + 'all', + ['==', '$type', 'Point'], + ['==', 'mode', 'static'], + ['==', 'meta', 'feature'], + ['!=', 'meta', 'midpoint'], + ], + layout: { + 'icon-image': 'place', + 'icon-anchor': 'bottom', + 'icon-allow-overlap': true, + 'icon-size': 2, + 'icon-offset': [0, 3], + }, + paint: { + 'icon-color': '#404040', + }, + }, + { + id: 'directus-polygon-fill-static', + type: 'fill', + filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']], + paint: { + 'fill-color': '#404040', + 'fill-outline-color': '#404040', + 'fill-opacity': 0.1, + }, + }, + { + id: 'directus-polygon-stroke-static', + type: 'line', + filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#404040', + 'line-width': 2, + }, + }, + { + id: 'directus-line-static', + type: 'line', + filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'LineString']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#404040', + 'line-width': 2, + }, + }, +]; diff --git a/app/src/lang/translations/en-US.yaml b/app/src/lang/translations/en-US.yaml index 8c2fff109c..03e3859565 100644 --- a/app/src/lang/translations/en-US.yaml +++ b/app/src/lang/translations/en-US.yaml @@ -22,10 +22,12 @@ edit_field: Edit Field conditions: Conditions +maps: Maps item_revision: Item Revision duplicate_field: Duplicate Field half_width: Half Width full_width: Full Width +limit: Limit group: Group and: And or: Or @@ -187,6 +189,7 @@ time: Time timestamp: Timestamp uuid: UUID hash: Hash +geometry: Geometry not_available_for_type: Not Available for this Type create_translations: Create Translations auto_refresh: Auto Refresh @@ -386,6 +389,7 @@ no_users_copy: There are no users in this role yet. webhooks_count: 'No Webhooks | One Webhook | {count} Webhooks' no_webhooks_copy: There are no webhooks yet. all_items: All Items +any: Any csv: CSV no_collections: No Collections create_collection: Create Collection @@ -504,6 +508,7 @@ color: Color circle: Circle empty_item: Empty Item log_in_with: 'Log In with {provider}' +advanced_settings: Advanced Settings advanced_filter: Advanced Filter delete_advanced_filter: Delete Filter change_advanced_filter_operator: Change Operator @@ -530,6 +535,10 @@ operators: nempty: Isn't empty all: Contains these keys has: Contains some of these keys + intersects: Intersects + nintersects: Doesn't intersect + intersects_bbox: Intersects bounding box + nintersects_bbox: Doesn't intersect bounding box loading: Loading... drop_to_upload: Drop to Upload item: Item @@ -944,6 +953,7 @@ interfaces: group-accordion: name: Accordion description: Display fields or groups as accordion sections + start: Start all_closed: All Closed first_opened: First Opened all_opened: All Opened @@ -1064,6 +1074,22 @@ interfaces: box: Block / Inline imageToken: Image Token imageToken_label: What (static) token to append to image sources + map: + map: Map + description: Select a location on a map + zoom: Zoom + geometry_type: Geometry type + geometry_format: Geometry format + default_view: Default view + invalid_options: Invalid options + invalid_format: Invalid format ({format}) + unexpected_geometry: Expected {expected}, got {got}. + fit_bounds: Fit view to data + native: Native + geojson: GeoJSON + lnglat: Longitude, Latitude + wkt: WKT + wkb: WKB presentation-notice: notice: Notice description: Display a short notice @@ -1273,3 +1299,16 @@ layouts: calendar: Calendar start_date_field: Start Date Field end_date_field: End Date Field + map: + map: Map + basemap: Basemap + layers: Layers + edit_custom_layers: Edit Layers + cluster_options: Clustering options + cluster: Activate clustering + cluster_radius: Cluster radius + cluster_minpoints: Cluster minimum size + cluster_maxzoom: Maximum zoom for clustering + fit_data: Fit data to view bounds + field: Geometry + invalid_geometry: Invalid geometry diff --git a/app/src/lang/translations/fr-FR.yaml b/app/src/lang/translations/fr-FR.yaml index 42c3a3a5ed..5408b60f5d 100644 --- a/app/src/lang/translations/fr-FR.yaml +++ b/app/src/lang/translations/fr-FR.yaml @@ -168,7 +168,7 @@ bigInteger: Grand entier boolean: Booléen date: Date datetime: Date et heure -decimal: Décimale +decimal: Décimal float: Décimal integer: Entier json: JSON @@ -179,6 +179,7 @@ time: Date et heure timestamp: Horodatage uuid: UUID (IDentifiant Unique Universel) hash: Hash +geometry: Geometrie not_available_for_type: Non disponible pour ce type create_translations: Créer des traductions auto_refresh: Actualisation automatique @@ -1002,6 +1003,18 @@ interfaces: box: Bloc / Inline imageToken: Token d'image imageToken_label: Quel token (statique) ajouter aux sources d'images + map: + map: Map + description: Selectionner un lieu sur une carte + geometry_type: Type de géométrie + geometry_format: Format de géométrie + storage_type: Storage type + default_view: Vue par défault + invalid_options: Options invalides + invalid_format: Format invalide ( {format} ) + unexpected_geometry: Attendu {expected}, reçu {got}. + fit_bounds: Ajuster la vue aux donnnées + native: Natif presentation-notice: notice: Remarque description: Afficher une courte remarque @@ -1198,3 +1211,15 @@ layouts: calendar: Calendrier start_date_field: Champ Date de début end_date_field: Champ Date de fin + map: + map: Carte + layers: Couche, + edit_custom_layers: Éditer les couches + cluster_options: Options de partitionnement + cluster: Activer le partitionnement + cluster_radius: Rayon de partitionnement + cluster_minpoints: Taille minimum de partitionnement + cluster_maxzoom: Zoom maximum du partitionnement + fit_data: Filter les données selon la position + field: Geometrie + invalid_geometry: Geometrie invalide diff --git a/app/src/layouts/map/actions.vue b/app/src/layouts/map/actions.vue new file mode 100644 index 0000000000..1fde62e009 --- /dev/null +++ b/app/src/layouts/map/actions.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/app/src/layouts/map/components/map.vue b/app/src/layouts/map/components/map.vue new file mode 100644 index 0000000000..80eb817df7 --- /dev/null +++ b/app/src/layouts/map/components/map.vue @@ -0,0 +1,511 @@ + + + + + + + + diff --git a/app/src/layouts/map/index.ts b/app/src/layouts/map/index.ts new file mode 100644 index 0000000000..aa523711d2 --- /dev/null +++ b/app/src/layouts/map/index.ts @@ -0,0 +1,363 @@ +import { defineLayout } from '@directus/shared/utils'; +import MapLayout from './map.vue'; +import MapOptions from './options.vue'; +import MapSidebar from './sidebar.vue'; +import MapActions from './actions.vue'; + +import { useI18n } from 'vue-i18n'; +import { toRefs, computed, ref, watch, Ref } from 'vue'; + +import { CameraOptions, AnyLayer } from 'maplibre-gl'; +import { GeometryOptions, toGeoJSON } from '@/utils/geometry'; +import { layers } from './style'; +import { useRouter } from 'vue-router'; +import { Filter } from '@directus/shared/types'; +import useCollection from '@/composables/use-collection/'; +import useItems from '@/composables/use-items'; +import { getFieldsFromTemplate } from '@/utils/get-fields-from-template'; +import type { Field, GeometryFormat } from '@directus/shared/types'; + +import { cloneDeep, merge } from 'lodash'; + +type LayoutQuery = { + fields: string[]; + sort: string; + limit: number; + page: number; +}; + +type LayoutOptions = { + cameraOptions?: CameraOptions & { bbox: any }; + customLayers?: Array; + geometryFormat?: GeometryFormat; + geometryField?: string; + fitDataToView?: boolean; + clusterData?: boolean; + animateOptions?: any; +}; + +export default defineLayout({ + id: 'map', + name: '$t:layouts.map.map', + icon: 'map', + smallHeader: true, + component: MapLayout, + slots: { + options: MapOptions, + sidebar: MapSidebar, + actions: MapActions, + }, + setup(props) { + const { t, n } = useI18n(); + const router = useRouter(); + + const { collection, searchQuery, selection, layoutOptions, layoutQuery, filters } = toRefs(props); + const { info, primaryKeyField, fields: fieldsInCollection } = useCollection(collection); + + const page = syncOption(layoutQuery, 'page', 1); + const limit = syncOption(layoutQuery, 'limit', 1000); + const sort = syncOption(layoutQuery, 'sort', fieldsInCollection.value[0].field); + + const customLayerDrawerOpen = ref(false); + const layoutElement = ref(null); + + const cameraOptions = syncOption(layoutOptions, 'cameraOptions', undefined); + const customLayers = syncOption(layoutOptions, 'customLayers', layers); + const fitDataToView = syncOption(layoutOptions, 'fitDataToView', true); + const clusterData = syncOption(layoutOptions, 'clusterData', false); + const geometryField = syncOption(layoutOptions, 'geometryField', undefined); + const geometryFormat = computed({ + get: () => layoutOptions.value?.geometryFormat, + set(newValue: GeometryFormat | undefined) { + layoutOptions.value = { + ...(layoutOptions.value || {}), + geometryFormat: newValue, + geometryField: undefined, + }; + }, + }); + + const geometryFields = computed(() => { + return (fieldsInCollection.value as Field[]).filter( + ({ type, meta }) => type == 'geometry' || meta?.interface == 'map' + ); + }); + + watch( + () => geometryFields.value, + (fields) => { + if (!geometryField.value && fields.length > 0) { + geometryField.value = fields[0].field; + } + }, + { immediate: true } + ); + + const geometryOptions = computed(() => { + const field = fieldsInCollection.value.filter((field: Field) => field.field == geometryField.value)[0]; + if (!field) return undefined; + if (field.type == 'geometry') { + return { + geometryField: field.field, + geometryFormat: 'native', + geometryType: field.schema?.geometry_type, + } as GeometryOptions; + } + if (field.meta && field.meta.interface == 'map' && field.meta.options) { + return { + geometryField: field.field, + geometryFormat: field.meta.options.geometryFormat, + geometryType: field.meta.options.geometryType, + } as GeometryOptions; + } + return undefined; + }); + + watch( + () => geometryOptions.value, + (options, _) => { + if (options?.geometryFormat !== 'native') { + fitDataToView.value = false; + } + } + ); + + const template = computed(() => { + if (info.value?.meta?.display_template) return info.value?.meta?.display_template; + return `{{ ${primaryKeyField.value?.field} }}`; + }); + + const queryFields = computed(() => { + return [geometryField.value, ...getFieldsFromTemplate(template.value)] + .concat(primaryKeyField.value?.field) + .filter((e) => !!e) as string[]; + }); + + const viewBoundsFilter = computed(() => { + if (!geometryField.value || !cameraOptions.value) { + return; + } + const bbox = cameraOptions.value?.bbox; + const bboxPolygon = [ + [bbox[0], bbox[1]], + [bbox[2], bbox[1]], + [bbox[2], bbox[3]], + [bbox[0], bbox[3]], + [bbox[0], bbox[1]], + ]; + return { + key: 'bbox-filter', + field: geometryField.value, + operator: 'intersects_bbox', + value: { + type: 'Polygon', + coordinates: [bboxPolygon], + } as any, + } as Filter; + }); + + const shouldUpdateCamera = ref(false); + const _filters = computed(() => { + if (geometryOptions.value?.geometryFormat === 'native' && fitDataToView.value) { + return filters.value.concat(viewBoundsFilter.value ?? []); + } + return filters.value; + }); + + const { items, loading, error, totalPages, itemCount, totalCount, getItems } = useItems(collection, { + sort, + limit, + page, + searchQuery, + fields: queryFields, + filters: _filters, + }); + + const geojson = ref({ type: 'FeatureCollection', features: [] }); + const geojsonBounds = ref(); + const geojsonError = ref(); + const geojsonLoading = ref(false); + + watch( + () => cameraOptions.value, + () => { + shouldUpdateCamera.value = false; + } + ); + + watch(() => searchQuery.value, onQueryChange); + watch(() => collection.value, onQueryChange); + watch(() => limit.value, onQueryChange); + watch(() => sort.value, onQueryChange); + watch(() => items.value, updateGeojson); + + watch( + () => geometryField.value, + () => (shouldUpdateCamera.value = true) + ); + + function onQueryChange() { + shouldUpdateCamera.value = true; + geojsonLoading.value = false; + page.value = 1; + } + + function updateGeojson() { + if (geometryOptions.value) { + try { + geojson.value = { type: 'FeatureCollection', features: [] }; + geojsonLoading.value = true; + geojsonError.value = null; + geojson.value = toGeoJSON(items.value, geometryOptions.value, template.value); + geojsonLoading.value = false; + if (!cameraOptions.value || shouldUpdateCamera.value) { + geojsonBounds.value = geojson.value.bbox; + } + } catch (error) { + geojsonLoading.value = false; + geojsonError.value = error; + geojson.value = { type: 'FeatureCollection', features: [] }; + } + } else { + geojson.value = { type: 'FeatureCollection', features: [] }; + } + } + + const directusLayers = ref(layers); + const directusSource = ref({ + type: 'geojson', + data: { + type: 'FeatureCollection', + features: [], + }, + }); + + watch(() => clusterData.value, updateSource, { immediate: true }); + updateLayers(); + + function updateLayers() { + customLayerDrawerOpen.value = false; + directusLayers.value = customLayers.value ?? []; + } + + function resetLayers() { + directusLayers.value = cloneDeep(layers); + customLayers.value = directusLayers.value; + } + + function updateSource() { + directusSource.value = merge({}, directusSource.value, { + cluster: clusterData.value, + }); + } + + function updateSelection(selected: Array | null) { + if (selected) { + selection.value = Array.from(new Set(selection.value.concat(selected))); + } else { + selection.value = []; + } + } + + const featureId = computed(() => { + return props.readonly ? null : primaryKeyField.value?.field; + }); + + function handleClick(key: number | string) { + if (props.selectMode) { + updateSelection([key]); + } else { + router.push(`/collections/${collection.value}/${key}`); + } + } + + const showingCount = computed(() => { + if ((itemCount.value || 0) < (totalCount.value || 0)) { + if (itemCount.value === 1) { + return t('one_filtered_item'); + } + return t('start_end_of_count_filtered_items', { + start: n((+page.value - 1) * limit.value + 1), + end: n(Math.min(page.value * limit.value, itemCount.value || 0)), + count: n(itemCount.value || 0), + }); + } + if (itemCount.value === 1) { + return t('one_item'); + } + return t('start_end_of_count_items', { + start: n((+page.value - 1) * limit.value + 1), + end: n(Math.min(page.value * limit.value, itemCount.value || 0)), + count: n(itemCount.value || 0), + }); + }); + + const activeFilterCount = computed(() => { + return filters.value.filter((filter) => !filter.locked).length; + }); + + return { + template, + selection, + geojson, + directusSource, + directusLayers, + customLayers, + updateLayers, + resetLayers, + featureId, + geojsonBounds, + geojsonLoading, + geojsonError, + geometryOptions, + handleClick, + geometryFormat, + geometryField, + cameraOptions, + fitDataToView, + clusterData, + updateSelection, + items, + loading, + error, + totalPages, + page, + toPage, + itemCount, + fieldsInCollection, + limit, + primaryKeyField, + sort, + info, + showingCount, + layoutElement, + activeFilterCount, + refresh, + resetPresetAndRefresh, + geometryFields, + customLayerDrawerOpen, + }; + + async function resetPresetAndRefresh() { + await props?.resetPreset?.(); + refresh(); + } + + function refresh() { + getItems(); + } + + function toPage(newPage: number) { + page.value = newPage; + } + + function syncOption(ref: Ref, key: T, defaultValue: R[T]) { + return computed({ + get: () => ref.value?.[key] ?? defaultValue, + set: (value: R[T]) => { + ref.value = Object.assign({}, ref.value, { [key]: value }) as R; + }, + }); + } + }, +}); diff --git a/app/src/layouts/map/map.vue b/app/src/layouts/map/map.vue new file mode 100644 index 0000000000..1a5c82d099 --- /dev/null +++ b/app/src/layouts/map/map.vue @@ -0,0 +1,255 @@ + + + + + + + + + diff --git a/app/src/layouts/map/options.vue b/app/src/layouts/map/options.vue new file mode 100644 index 0000000000..8e20efc692 --- /dev/null +++ b/app/src/layouts/map/options.vue @@ -0,0 +1,110 @@ + + + diff --git a/app/src/layouts/map/sidebar.vue b/app/src/layouts/map/sidebar.vue new file mode 100644 index 0000000000..2199ae9d32 --- /dev/null +++ b/app/src/layouts/map/sidebar.vue @@ -0,0 +1,24 @@ + + + diff --git a/app/src/layouts/map/style.ts b/app/src/layouts/map/style.ts new file mode 100644 index 0000000000..532cad3d31 --- /dev/null +++ b/app/src/layouts/map/style.ts @@ -0,0 +1,81 @@ +import { AnyLayer, Expression } from 'maplibre-gl'; + +const baseColor = '#09f'; +const selectColor = '#FFA500'; +const fill: Expression = ['case', ['boolean', ['feature-state', 'selected'], false], selectColor, baseColor]; +const outline: Expression = [ + 'case', + ['boolean', ['feature-state', 'selected'], false], + selectColor, + ['boolean', ['feature-state', 'hovered'], false], + selectColor, + baseColor, +]; + +export const layers: AnyLayer[] = [ + { + id: '__directus_polygons', + type: 'fill', + source: '__directus', + filter: ['all', ['!has', 'point_count'], ['==', '$type', 'Polygon']], + paint: { + 'fill-color': fill, + 'fill-opacity': 0.15, + }, + }, + { + id: '__directus_polygons_outline', + type: 'line', + source: '__directus', + filter: ['all', ['!has', 'point_count'], ['==', '$type', 'Polygon']], + paint: { + 'line-color': outline, + 'line-width': 2, + }, + }, + { + id: '__directus_lines', + type: 'line', + source: '__directus', + filter: ['all', ['!has', 'point_count'], ['==', '$type', 'LineString']], + paint: { + 'line-color': outline, + 'line-width': 2, + }, + }, + { + id: '__directus_points', + type: 'circle', + source: '__directus', + filter: ['all', ['!has', 'point_count'], ['==', '$type', 'Point']], + layout: {}, + paint: { + 'circle-radius': 5, + 'circle-color': fill, + 'circle-stroke-color': outline, + 'circle-stroke-width': 3, + }, + }, + { + id: '__directus_clusters', + type: 'circle', + source: '__directus', + filter: ['has', 'point_count'], + paint: { + 'circle-color': ['step', ['get', 'point_count'], '#51bbd6', 100, '#f1f075', 750, '#f28cb1'], + 'circle-radius': ['step', ['get', 'point_count'], 20, 100, 30, 750, 40], + }, + }, + { + id: '__directus_cluster_count', + type: 'symbol', + source: '__directus', + filter: ['has', 'point_count'], + layout: { + 'text-field': '{point_count_abbreviated}', + // 'text-font': ['Open Sans Semibold'], + 'text-font': ['Noto Sans Regular'], + 'text-size': ['step', ['get', 'point_count'], 15, 100, 17, 750, 19], + }, + }, +]; diff --git a/app/src/modules/collections/routes/collection.vue b/app/src/modules/collections/routes/collection.vue index 4762224174..418a5db42d 100644 --- a/app/src/modules/collections/routes/collection.vue +++ b/app/src/modules/collections/routes/collection.vue @@ -1,6 +1,10 @@