clean up TOCENTRY_ID_PREFIX

This commit is contained in:
Sofia Papacharalampous 2024-05-17 15:26:51 +03:00
parent 232915e155
commit 0860781cdf
8 changed files with 3 additions and 13 deletions

View File

@ -100,7 +100,7 @@
<div class="row toc-pane-container" #boundary>
<div #spacer></div>
<div class="col-12">
<app-table-of-contents [visibilityRulesService]="visibilityRulesService" [selectedFieldsetId]="fieldsetIdWithFocus" #table0fContents [showErrors]="showtocentriesErrors" [TOCENTRY_ID_PREFIX]="TOCENTRY_ID_PREFIX" [hasFocus]="step > 0" [formGroup]="formGroup.get('properties')" [descriptionTemplate]="item.descriptionTemplate" *ngIf="formGroup" [links]="links" [boundary]="boundary" [spacer]="spacer" [isActive]="step !== 0" stickyThing (stepFound)="onStepFound($event)" (currentLinks)="getLinks($event)" (entrySelected)="changeStep($event.entry, $event.execute)" [pageToFieldSetMap]="pageToFieldSetMap"></app-table-of-contents>
<app-table-of-contents [visibilityRulesService]="visibilityRulesService" [selectedFieldsetId]="fieldsetIdWithFocus" #table0fContents [showErrors]="showtocentriesErrors" [hasFocus]="step > 0" [formGroup]="formGroup.get('properties')" [descriptionTemplate]="item.descriptionTemplate" *ngIf="formGroup" [links]="links" [boundary]="boundary" [spacer]="spacer" [isActive]="step !== 0" stickyThing (stepFound)="onStepFound($event)" (currentLinks)="getLinks($event)" (entrySelected)="changeStep($event.entry, $event.execute)" [pageToFieldSetMap]="pageToFieldSetMap"></app-table-of-contents>
</div>
</div>
</div>
@ -146,7 +146,6 @@
[descriptionId]="formGroup.get('id').value"
[descriptionTemplate]="item.descriptionTemplate"
[visibilityRulesService]="visibilityRulesService"
[TOCENTRY_ID_PREFIX]="TOCENTRY_ID_PREFIX"
[hidden]="this.step === 0"
[linkToScroll]="linkToScroll"
[validationErrorModel]="editorModel.validationErrorModel"

View File

@ -37,7 +37,6 @@ export class DescriptionFormSectionComponent extends BaseComponent implements On
subsectionLinkToScroll: LinkToScroll;
@Output() askedToScroll = new EventEmitter<string>();
tocentriesType = ToCEntryType;
@Input() TOCENTRY_ID_PREFIX = "";
@Input() validationErrorModel: ValidationErrorModel;
constructor(

View File

@ -33,7 +33,6 @@ export class DescriptionFormComponent extends BaseComponent implements OnInit, A
// tocentries: ToCEntry[];
@Input() TOCENTRY_ID_PREFIX = "";
@Input() validationErrorModel: ValidationErrorModel;
// public hiddenEntriesIds: string[] = [];

View File

@ -35,7 +35,6 @@
*ngIf="entry.subEntries && entry.subEntries.length && expandChildren[idx]"
(entrySelected)="onEntrySelected($event)"
[selected]="selected"
[TOCENTRY_ID_PREFIX]="TOCENTRY_ID_PREFIX"
[showErrors]="showErrors"
[hiddenEntries]="hiddenEntries"
[visibilityRulesService]="visibilityRulesService"

View File

@ -23,7 +23,6 @@ export class TableOfContentsInternal implements OnInit, OnDestroy {
expandChildren: boolean[];
tocEntryTypeEnum = ToCEntryType;
@Input() TOCENTRY_ID_PREFIX = "";
@Input() showErrors: boolean = false;
@Input() hiddenEntries: string[] = [];
@Input() visibilityRulesService: VisibilityRulesService;
@ -154,7 +153,6 @@ export class TableOfContentsInternal implements OnInit, OnDestroy {
if (entry.type === ToCEntryType.FieldSet) {
const fieldSetId = entry.id;
// const element = document.getElementById(this.TOCENTRY_ID_PREFIX + fieldSetId);
const element = document.getElementById(fieldSetId);
if (element) {
element.click();//open mat expansion panel

View File

@ -9,7 +9,7 @@
<div *ngIf="tocentries" class="row docs-toc-container">
<div class="scroll-container col-12 internal-table">
<table-of-contents-internal #internalTable [TOCENTRY_ID_PREFIX]="TOCENTRY_ID_PREFIX" [tocentries]="tocentries"
<table-of-contents-internal #internalTable [tocentries]="tocentries"
[showErrors]="showErrors"
(entrySelected)="onToCentrySelected($event)"
[selected]="tocentrySelected"

View File

@ -50,7 +50,6 @@ export class TableOfContentsComponent extends BaseComponent implements OnInit, O
@Input() isActive: boolean;
tocentries: ToCEntry[] = null;
@Input() TOCENTRY_ID_PREFIX = '';
@Input() showErrors: boolean = false;
@Input() selectedFieldsetId: string;
@ -222,8 +221,7 @@ export class TableOfContentsComponent extends BaseComponent implements OnInit, O
entries.forEach(ie => {
if (ie.isIntersecting) {
try {
// const target_id = ie.target.id.replace(this.TOCENTRY_ID_PREFIX, '');
const target_id = ie.target.id;//.replace(this.TOCENTRY_ID_PREFIX, '');
const target_id = ie.target.id;
if (this.visibilityRulesService.isVisibleMap[target_id] ?? true) {
this.onToCentrySelected(this._findTocEntryById(target_id, this.tocentries));
}
@ -239,7 +237,6 @@ export class TableOfContentsComponent extends BaseComponent implements OnInit, O
fieldsetsEtries.forEach(e => {
if (e.type === ToCEntryType.FieldSet) {
try {
// const targetElement = document.getElementById(this.TOCENTRY_ID_PREFIX + e.id);
const targetElement = document.getElementById(e.id);
this._intersectionObserver.observe(targetElement);
} catch {

View File

@ -357,7 +357,6 @@ export class DmpBlueprintValueEditorModel implements DmpBlueprintValuePersist {
}
this.isRequired = field.required;
if (this.isRequired) console.log(field);
this.category = field.category;
return this;