mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-24 09:16:43 +00:00
UBER-646: clear the class when view is changed to prevent using old one (#3541)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
315d20480b
commit
3c376696f6
@ -21,6 +21,7 @@
|
|||||||
import view from '../../plugin'
|
import view from '../../plugin'
|
||||||
import FilterTypePopup from './FilterTypePopup.svelte'
|
import FilterTypePopup from './FilterTypePopup.svelte'
|
||||||
import IconClose from '../icons/Close.svelte'
|
import IconClose from '../icons/Close.svelte'
|
||||||
|
import { onDestroy } from 'svelte'
|
||||||
|
|
||||||
export let _class: Ref<Class<Doc>> | undefined
|
export let _class: Ref<Class<Doc>> | undefined
|
||||||
export let space: Ref<Space> | undefined = undefined
|
export let space: Ref<Space> | undefined = undefined
|
||||||
@ -51,6 +52,10 @@
|
|||||||
if (e !== undefined) setFilters([e])
|
if (e !== undefined) setFilters([e])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
_class = undefined
|
||||||
|
})
|
||||||
|
|
||||||
function add (e: MouseEvent) {
|
function add (e: MouseEvent) {
|
||||||
const target = eventToHTMLElement(e)
|
const target = eventToHTMLElement(e)
|
||||||
showPopup(
|
showPopup(
|
||||||
|
@ -110,7 +110,6 @@
|
|||||||
query: fv.location.query ?? undefined,
|
query: fv.location.query ?? undefined,
|
||||||
fragment: fv.location.fragment ?? undefined
|
fragment: fv.location.fragment ?? undefined
|
||||||
})
|
})
|
||||||
setFilters(JSON.parse(fv.filters))
|
|
||||||
if (fv.viewletId !== undefined && fv.viewletId !== null) {
|
if (fv.viewletId !== undefined && fv.viewletId !== null) {
|
||||||
const viewlet = await client.findOne(view.class.Viewlet, { _id: fv.viewletId })
|
const viewlet = await client.findOne(view.class.Viewlet, { _id: fv.viewletId })
|
||||||
setActiveViewletId(fv.viewletId, fv.location)
|
setActiveViewletId(fv.viewletId, fv.location)
|
||||||
@ -118,6 +117,7 @@
|
|||||||
setViewOptions(viewlet, copy(fv.viewOptions))
|
setViewOptions(viewlet, copy(fv.viewOptions))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setFilters(JSON.parse(fv.filters))
|
||||||
}
|
}
|
||||||
|
|
||||||
const clearSelection = () => {
|
const clearSelection = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user