From ef3acfbf7c2fe7023450d451a3fb80e8b4b0d9aa Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Thu, 22 Jun 2023 15:22:37 +0700 Subject: [PATCH] UBER-505: Fix resolve errors in console (#3449) Signed-off-by: Andrey Sobolev --- .github/workflows/main.yml | 47 ++++++++++---- models/all/src/index.ts | 62 ++++++++----------- .../ui/src/components/internal/Root.svelte | 3 +- .../src/components/Form.svelte | 18 ++++-- .../src/components/Workbench.svelte | 6 +- 5 files changed, 81 insertions(+), 55 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c3f502af6..43f9761b0f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,17 +36,19 @@ jobs: env: cache-name: cache-node-modules with: - path: ./common/temp + path: | + ./common/temp + !./common/temp/build-cache key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} - - name: Cache PR common + - name: Cache Build cache uses: actions/cache@v3 with: - path: ./common/temp - key: ${{ runner.os }}-build-ref-${{ github.ref }} + path: ./common/temp/build-cache + key: build-cache-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-build-ref-${{ github.ref }} + build-cache-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Checking for mis-matching dependencies... run: node common/scripts/install-run-rush.js check @@ -198,7 +200,13 @@ jobs: tools key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - + - name: Cache Build cache + uses: actions/cache@v3 + with: + path: ./common/temp/build-cache + key: build-cache-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + build-cache-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Start MongoDB uses: supercharge/mongodb-github-action@1.9.0 with: @@ -213,7 +221,13 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - + - name: Cache Build cache + uses: actions/cache@v3 + with: + path: ./common/temp/build-cache + key: build-cache-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + build-cache-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Cache build results uses: actions/cache@v3 env: @@ -270,6 +284,7 @@ jobs: # cd ./tests # ./update-snapshot-ci.sh ./tests/db_dump - name: "Store docker logs" + if: always() run: | cd ./tests/sanity mkdir logs @@ -281,9 +296,13 @@ jobs: uses: actions/upload-artifact@v3 with: name: playwright-results - path: | - ./tests/sanity/playwright-report/ - ./tests/sanity/logs + path: ./tests/sanity/playwright-report/ + - name: Upload Logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: docker-logs + path: ./tests/sanity/logs # - name: Upload DB snapshot # if: always() # uses: actions/upload-artifact@v3 @@ -298,7 +317,13 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - + - name: Cache Build cache + uses: actions/cache@v3 + with: + path: ./common/temp/build-cache + key: build-cache-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + build-cache-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Cache build results uses: actions/cache@v3 env: diff --git a/models/all/src/index.ts b/models/all/src/index.ts index aa872bc461..e86239489f 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -84,6 +84,15 @@ type BuilderConfig = [(b: Builder) => void, Plugin] | [(b: Builder) => void, Plu export default function buildModel (enabled: string[] = ['*'], disabled: string[] = []): Builder { const builder = new Builder() + const defaultFilter = [ + workbench.class.Application, + presentation.class.ObjectSearchCategory, + notification.class.NotificationGroup, + view.class.Action, + contact.class.ChannelProvider, + setting.class.IntegrationType + ] + const builders: BuilderConfig[] = [ [coreModel, coreId], [activityModel, activityId], @@ -100,11 +109,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ enabled: true, beta: false, icon: contact.icon.ContactApplication, - classFilter: [ - workbench.class.Application, - presentation.class.ObjectSearchCategory, - notification.class.NotificationGroup - ] + classFilter: defaultFilter } ], [ @@ -129,12 +134,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ enabled: true, beta: false, icon: recruit.icon.RecruitApplication, - classFilter: [ - workbench.class.Application, - view.class.Action, - presentation.class.ObjectSearchCategory, - notification.class.NotificationGroup - ] + classFilter: defaultFilter } ], [settingModel, settingId], @@ -146,12 +146,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ description: telegram.string.ConfigDescription, enabled: true, beta: false, - classFilter: [ - workbench.class.Application, - view.class.Action, - contact.class.ChannelProvider, - setting.class.IntegrationType - ] + classFilter: defaultFilter } ], [ @@ -162,7 +157,8 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ description: lead.string.ConfigDescription, enabled: false, beta: true, - icon: lead.icon.LeadApplication + icon: lead.icon.LeadApplication, + classFilter: defaultFilter } ], [ @@ -173,12 +169,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ description: gmail.string.ConfigDescription, enabled: true, beta: false, - classFilter: [ - workbench.class.Application, - view.class.Action, - contact.class.ChannelProvider, - setting.class.IntegrationType - ] + classFilter: defaultFilter } ], [ @@ -190,7 +181,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ enabled: false, beta: true, icon: inventory.icon.InventoryApplication, - classFilter: [workbench.class.Application, view.class.Action] + classFilter: defaultFilter } ], [presentationModel, presentationId], @@ -207,7 +198,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ enabled: false, beta: true, icon: hr.icon.Structure, - classFilter: [workbench.class.Application, view.class.Action] + classFilter: defaultFilter } ], [ @@ -218,7 +209,8 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ description: document.string.ConfigDescription, enabled: false, beta: true, - icon: document.icon.DocumentApplication + icon: document.icon.DocumentApplication, + classFilter: defaultFilter } ], [ @@ -230,12 +222,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ enabled: true, beta: false, icon: tracker.icon.TrackerApplication, - classFilter: [ - workbench.class.Application, - view.class.Action, - presentation.class.ObjectSearchCategory, - notification.class.NotificationGroup - ] + classFilter: defaultFilter } ], [ @@ -247,7 +234,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ enabled: false, beta: true, icon: board.icon.Board, - classFilter: [workbench.class.Application, view.class.Action] + classFilter: defaultFilter } ], [ @@ -259,7 +246,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ enabled: false, beta: true, icon: calendar.icon.Calendar, - classFilter: [workbench.class.Application] + classFilter: defaultFilter } ], [ @@ -270,7 +257,8 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ description: bitrix.string.ConfigDescription, enabled: false, beta: true, - icon: bitrix.icon.Bitrix + icon: bitrix.icon.Bitrix, + classFilter: defaultFilter } ], [ @@ -281,7 +269,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ // description: request.string.ConfigDescription, enabled: false, beta: true, - classFilter: [workbench.class.Application, view.class.Action] + classFilter: defaultFilter } ], [automationModel, automationId], diff --git a/packages/ui/src/components/internal/Root.svelte b/packages/ui/src/components/internal/Root.svelte index 1cdece611f..d1337e7e1c 100644 --- a/packages/ui/src/components/internal/Root.svelte +++ b/packages/ui/src/components/internal/Root.svelte @@ -5,7 +5,7 @@ // import { applicationShortcutKey } from '../../utils' import { getCurrentLocation, location, navigate } from '../../location' - import { Theme, themeStore } from '@hcengineering/theme' + import { Theme } from '@hcengineering/theme' import Component from '../Component.svelte' import StatusComponent from '../Status.svelte' @@ -108,7 +108,6 @@
- {$themeStore.language}
{ if (ignoreInitialValidation) return for (const field of fields) { const v = object[field.name] @@ -72,7 +72,7 @@ status = new Status(Severity.INFO, login.status.RequiredField, { field: await translate(field.i18n, {}, language) }) - return + return false } if (f.id !== undefined) { const sameFields = fields.filter((f) => f.id === field.id) @@ -83,7 +83,7 @@ field: await translate(field.i18n, {}, language), field2: await translate(f.i18n, {}, language) }) - return + return false } } } @@ -93,11 +93,12 @@ field: await translate(field.i18n, {}), descr: field.ruleDescr ? await translate(field.ruleDescr, {}, language) : '' }) - return + return false } } } status = OK + return true } validate($themeStore.language) @@ -131,6 +132,15 @@ class="container" style:padding={$deviceInfo.docWidth <= 480 ? '.25rem 1.25rem' : '4rem 5rem'} style:min-height={$deviceInfo.docHeight > 720 ? '42rem' : '0'} + on:keydown={(evt) => { + if (evt.key === 'Enter' && !inAction) { + validate().then((res) => { + if (res) { + performAction(action) + } + }) + } + }} > {#if loginState !== 'none'}
diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index d5097ec081..614e2a5de8 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -271,7 +271,11 @@ async function syncLoc (loc: Location): Promise { const originalLoc = JSON.stringify(loc) // resolve short links - const resolvedLoc = await resolveShortLink(loc) + let resolvedLoc: ResolvedLocation | undefined + if (loc.path.length > 3 && getSpecialComponent(loc.path[3]) === undefined) { + resolvedLoc = await resolveShortLink(loc) + } + if (resolvedLoc && !areLocationsEqual(loc, resolvedLoc.loc)) { loc = mergeLoc(loc, resolvedLoc) }