Fix: trigger change warning for saved views with default fields if changed (#7865)

This commit is contained in:
shamoon 2024-10-06 14:27:02 -07:00 committed by GitHub
parent 7c11a37150
commit 95d1abd416
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 8 deletions

View File

@ -319,7 +319,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-list/document-list.component.ts</context>
<context context-type="linenumber">128</context>
<context context-type="linenumber">138</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/custom-fields/custom-fields.component.html</context>
@ -6946,7 +6946,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-list/document-list.component.ts</context>
<context context-type="linenumber">245</context>
<context context-type="linenumber">255</context>
</context-group>
</trans-unit>
<trans-unit id="1494518490116523821" datatype="html">
@ -6957,7 +6957,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-list/document-list.component.ts</context>
<context context-type="linenumber">238</context>
<context context-type="linenumber">248</context>
</context-group>
</trans-unit>
<trans-unit id="5146398958364876914" datatype="html">
@ -7183,28 +7183,28 @@
<source>Reset filters / selection</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-list/document-list.component.ts</context>
<context context-type="linenumber">226</context>
<context context-type="linenumber">236</context>
</context-group>
</trans-unit>
<trans-unit id="4135055128446167640" datatype="html">
<source>Open first [selected] document</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-list/document-list.component.ts</context>
<context context-type="linenumber">254</context>
<context context-type="linenumber">264</context>
</context-group>
</trans-unit>
<trans-unit id="2155249406916744630" datatype="html">
<source>View &quot;<x id="PH" equiv-text="this.list.activeSavedViewTitle"/>&quot; saved successfully.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-list/document-list.component.ts</context>
<context context-type="linenumber">290</context>
<context context-type="linenumber">300</context>
</context-group>
</trans-unit>
<trans-unit id="6837554170707123455" datatype="html">
<source>View &quot;<x id="PH" equiv-text="savedView.name"/>&quot; created successfully.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-list/document-list.component.ts</context>
<context context-type="linenumber">333</context>
<context context-type="linenumber">343</context>
</context-group>
</trans-unit>
<trans-unit id="739880801667335279" datatype="html">

View File

@ -15,7 +15,12 @@ import {
isFullTextFilterRule,
} from 'src/app/utils/filter-rules'
import { FILTER_FULLTEXT_MORELIKE } from 'src/app/data/filter-rule-type'
import { DisplayField, DisplayMode, Document } from 'src/app/data/document'
import {
DEFAULT_DISPLAY_FIELDS,
DisplayField,
DisplayMode,
Document,
} from 'src/app/data/document'
import { SavedView } from 'src/app/data/saved-view'
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
import {
@ -108,6 +113,11 @@ export class DocumentListComponent
(this.unmodifiedSavedView.display_fields &&
this.unmodifiedSavedView.display_fields.join(',') !==
this.activeDisplayFields.join(',')) ||
(!this.unmodifiedSavedView.display_fields &&
this.activeDisplayFields.join(',') !==
DEFAULT_DISPLAY_FIELDS.filter((f) => f.id !== DisplayField.ADDED)
.map((f) => f.id)
.join(',')) ||
filterRulesDiffer(
this.unmodifiedSavedView.filter_rules,
this.list.filterRules