feat(editor): references dialog over the finding, view mode
A modal Dialog replaces the citations side sheet; families open it too (isCitable). The finding dialog shows only « Références citées » and « X références », also at zero; its edit form no longer carries reference_ids. A dirty form refusing « Aller à » or « Tout afficher » closes the clean references dialog first.
This commit is contained in:
1 parent
ff21b0315e
commit
abc781df52
29 files changed
+432
-858
No files matched your search
@@ -57,12 +57,18 @@ describe('sanitizeView', () => {
|
||||
expect(layerCount(sanitizeView(sheet)!)).toBe(2)
|
||||
})
|
||||
|
||||
it('a sheet needs a finding node, a layer needs the Constats tab', () => {
|
||||
it('citations need a family or a node, a layer needs the Constats tab', () => {
|
||||
const family = { kind: 'finding', zone_id: 'z', path: ['f'] }
|
||||
const zone = { kind: 'zone', id: 'z' }
|
||||
const raw = { tab: 'findings', section: 'drawing' }
|
||||
const asked = { ...raw, finding: { key: family, citations: true } }
|
||||
expect(sanitizeView(asked)?.finding).toEqual({
|
||||
key: family,
|
||||
citations: true,
|
||||
})
|
||||
const ofZone = { ...raw, finding: { key: zone, citations: true } }
|
||||
expect(sanitizeView(ofZone)?.finding).toEqual({
|
||||
key: zone,
|
||||
citations: false,
|
||||
})
|
||||
const elsewhere = {
|
||||
@@ -108,9 +114,12 @@ describe('sanitizeView', () => {
|
||||
).toBeNull()
|
||||
})
|
||||
|
||||
it('the finding filter names a finding node and lives on the References tab only', () => {
|
||||
it('the finding filter names a family or a node and lives on the References tab only', () => {
|
||||
const filtered = view('references', { referenceFilter: node })
|
||||
expect(sanitizeView(filtered)?.referenceFilter).toEqual(node)
|
||||
const family = { kind: 'finding' as const, zone_id: 'z', path: ['f'] }
|
||||
const byFamily = view('references', { referenceFilter: family })
|
||||
expect(sanitizeView(byFamily)?.referenceFilter).toEqual(family)
|
||||
expect(sanitizeView(filtered, false)?.referenceFilter).toEqual(node)
|
||||
expect(
|
||||
sanitizeView({ ...view('general'), referenceFilter: node })
|
||||
|
||||
Reference in new issue
Block a user