mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 02:51:54 +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 preferenceQuery = createQuery()
|
||||||
const objectConfigurations = createQuery()
|
const objectConfigurations = createQuery()
|
||||||
let preference: ViewletPreference[] = []
|
let preference: ViewletPreference[] = []
|
||||||
let loading = true
|
|
||||||
|
let configurationsLoading = true
|
||||||
|
let preferencesLoading = true
|
||||||
|
$: loading = configurationsLoading || preferencesLoading
|
||||||
|
|
||||||
let configurationRaw: Viewlet[] = []
|
let configurationRaw: Viewlet[] = []
|
||||||
let configurations: Record<Ref<Class<Doc>>, Viewlet['config']> = {}
|
let configurations: Record<Ref<Class<Doc>>, Viewlet['config']> = {}
|
||||||
|
|
||||||
$: viewlet &&
|
function fetchConfigurations (viewlet: Viewlet): void {
|
||||||
|
configurationsLoading = true
|
||||||
|
configurations = {}
|
||||||
|
|
||||||
objectConfigurations.query(
|
objectConfigurations.query(
|
||||||
view.class.Viewlet,
|
view.class.Viewlet,
|
||||||
{
|
{
|
||||||
@ -37,11 +43,13 @@
|
|||||||
},
|
},
|
||||||
(res) => {
|
(res) => {
|
||||||
configurationRaw = res
|
configurationRaw = res
|
||||||
loading = false
|
configurationsLoading = false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
$: viewlet &&
|
function fetchPreferences (viewlet: Viewlet): void {
|
||||||
|
preferencesLoading = true
|
||||||
preferenceQuery.query(
|
preferenceQuery.query(
|
||||||
view.class.ViewletPreference,
|
view.class.ViewletPreference,
|
||||||
{
|
{
|
||||||
@ -50,9 +58,10 @@
|
|||||||
},
|
},
|
||||||
(res) => {
|
(res) => {
|
||||||
preference = res
|
preference = res
|
||||||
loading = false
|
preferencesLoading = false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function updateConfiguration (configurationRaw: Viewlet[], preference: ViewletPreference[]): void {
|
function updateConfiguration (configurationRaw: Viewlet[], preference: ViewletPreference[]): void {
|
||||||
const newConfigurations: Record<Ref<Class<Doc>>, Viewlet['config']> = {}
|
const newConfigurations: Record<Ref<Class<Doc>>, Viewlet['config']> = {}
|
||||||
@ -74,6 +83,9 @@
|
|||||||
configurations = newConfigurations
|
configurations = newConfigurations
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: fetchConfigurations(viewlet)
|
||||||
|
$: fetchPreferences(viewlet)
|
||||||
|
|
||||||
$: updateConfiguration(configurationRaw, preference)
|
$: updateConfiguration(configurationRaw, preference)
|
||||||
|
|
||||||
$: config = preference.find((it) => it.attachedTo === viewlet._id)?.config ?? viewlet.config
|
$: config = preference.find((it) => it.attachedTo === viewlet._id)?.config ?? viewlet.config
|
||||||
|
Loading…
Reference in New Issue
Block a user