mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-19 08:51:37 +03:00
UBERF-8886 Fix presenter not found error (#7433)
This commit is contained in:
parent
fbb3471a49
commit
a62625f29f
@ -22,12 +22,18 @@
|
||||
const preferenceQuery = createQuery()
|
||||
const objectConfigurations = createQuery()
|
||||
let preference: ViewletPreference[] = []
|
||||
let loading = true
|
||||
|
||||
let configurationsLoading = true
|
||||
let preferencesLoading = true
|
||||
$: loading = configurationsLoading || preferencesLoading
|
||||
|
||||
let configurationRaw: Viewlet[] = []
|
||||
let configurations: Record<Ref<Class<Doc>>, Viewlet['config']> = {}
|
||||
|
||||
$: viewlet &&
|
||||
function fetchConfigurations (viewlet: Viewlet): void {
|
||||
configurationsLoading = true
|
||||
configurations = {}
|
||||
|
||||
objectConfigurations.query(
|
||||
view.class.Viewlet,
|
||||
{
|
||||
@ -37,11 +43,13 @@
|
||||
},
|
||||
(res) => {
|
||||
configurationRaw = res
|
||||
loading = false
|
||||
configurationsLoading = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
$: viewlet &&
|
||||
function fetchPreferences (viewlet: Viewlet): void {
|
||||
preferencesLoading = true
|
||||
preferenceQuery.query(
|
||||
view.class.ViewletPreference,
|
||||
{
|
||||
@ -50,9 +58,10 @@
|
||||
},
|
||||
(res) => {
|
||||
preference = res
|
||||
loading = false
|
||||
preferencesLoading = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function updateConfiguration (configurationRaw: Viewlet[], preference: ViewletPreference[]): void {
|
||||
const newConfigurations: Record<Ref<Class<Doc>>, Viewlet['config']> = {}
|
||||
@ -74,6 +83,9 @@
|
||||
configurations = newConfigurations
|
||||
}
|
||||
|
||||
$: fetchConfigurations(viewlet)
|
||||
$: fetchPreferences(viewlet)
|
||||
|
||||
$: updateConfiguration(configurationRaw, preference)
|
||||
|
||||
$: config = preference.find((it) => it.attachedTo === viewlet._id)?.config ?? viewlet.config
|
||||
|
Loading…
Reference in New Issue
Block a user