Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UBER-505: Fix resolve errors in console #3449

Merged
merged 3 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 25 additions & 37 deletions models/all/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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
}
],
[
Expand All @@ -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],
Expand All @@ -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
}
],
[
Expand All @@ -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
}
],
[
Expand All @@ -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
}
],
[
Expand All @@ -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],
Expand All @@ -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
}
],
[
Expand All @@ -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
}
],
[
Expand All @@ -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
}
],
[
Expand All @@ -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
}
],
[
Expand All @@ -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
}
],
[
Expand All @@ -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
}
],
[
Expand All @@ -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],
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/internal/Root.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -108,7 +108,6 @@
<div id="ui-root">
<div class="antiStatusBar">
<div class="flex-row-center h-full content-color">
{$themeStore.language}
<div
class="status-info"
style:margin-left={(isPortrait && docWidth <= 480) || (!isPortrait && docHeight <= 480) ? '1.5rem' : '0'}
Expand Down
18 changes: 14 additions & 4 deletions plugins/login-resources/src/components/Form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
export let object: any
export let ignoreInitialValidation: boolean = false

async function validate (language: string) {
async function validate (language: string): Promise<boolean> {
if (ignoreInitialValidation) return
for (const field of fields) {
const v = object[field.name]
Expand All @@ -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)
Expand All @@ -83,7 +83,7 @@
field: await translate(field.i18n, {}, language),
field2: await translate(f.i18n, {}, language)
})
return
return false
}
}
}
Expand All @@ -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)

Expand Down Expand Up @@ -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'}
<div class="flex-row-center caption">
Expand Down
6 changes: 5 additions & 1 deletion plugins/workbench-resources/src/components/Workbench.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@
async function syncLoc (loc: Location): Promise<void> {
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)
}
Expand Down