2021-02-17 17:39:07 +01:00
|
|
|
<!-- <span style="cursor: pointer;" [ngClass]="{'active': itemSelected?.id == parentLink?.id}" (click)="itemClicked(parentLink)" *ngIf="!(parentLink.type == undefined)" >
|
|
|
|
{{parentLink?.numbering}} {{parentLink?.label? parentLink?.label : 'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate}}
|
|
|
|
<span class="mat-button" (click)="deleteEntry(parentLink)" *ngIf="itemSelected?.id == parentLink?.id"><mat-icon>delete</mat-icon></span>
|
|
|
|
</span> -->
|
2021-02-12 12:23:39 +01:00
|
|
|
|
2021-02-24 15:56:14 +01:00
|
|
|
<div class="table-item row align-items-center" *ngIf="!(parentLink.type == undefined)">
|
2021-02-19 15:35:14 +01:00
|
|
|
<div class="col link-info"
|
|
|
|
>
|
2021-03-04 13:38:46 +01:00
|
|
|
<!-- [ngStyle]="{'padding-top': (!((parentLink?.subEntriesType == tocEntryType.FieldSet) && !selectedItemInLinks) || itemSelected?.id == parentLink.id)? '0em': '.6em'}" -->
|
|
|
|
|
2021-02-19 15:35:14 +01:00
|
|
|
<!-- <span style="cursor: pointer;" [ngClass]="{'active': itemSelected?.id == parentLink?.id}" (click)="itemClicked(parentLink)" >
|
2021-02-17 17:39:07 +01:00
|
|
|
{{parentLink?.numbering}} {{parentLink?.label? parentLink?.label : 'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate}}
|
2021-02-19 15:35:14 +01:00
|
|
|
</span> -->
|
|
|
|
|
2021-02-24 15:56:14 +01:00
|
|
|
<!-- <span style="cursor: pointer;" [ngClass]="{'active': itemSelected?.id == parentLink?.id}" (click)="itemClicked(parentLink)"
|
2021-02-19 15:35:14 +01:00
|
|
|
[matBadge]="parentLink.subEntries?.length"
|
|
|
|
matBadgeOverlap="false"
|
|
|
|
[matBadgeHidden]="!((parentLink?.subEntriesType == tocEntryType.FieldSet) && !selectedItemInLinks) || itemSelected?.id == parentLink.id"
|
|
|
|
matBadgePosition="before"
|
|
|
|
matBadgeColor="accent"
|
|
|
|
matBadgeSize="small"
|
|
|
|
|
2021-02-24 15:56:14 +01:00
|
|
|
[ngStyle]="{'font-size' : (parentLink.type == tocEntryType.FieldSet? '.9rem':'1rem')}"
|
|
|
|
> -->
|
2021-03-29 17:42:55 +02:00
|
|
|
<span class="table-label-element"
|
|
|
|
[ngClass]="{'table-label-element-active': itemSelected?.id == parentLink?.id, 'text-danger': colorError() ||(!colorError() && !selectedItemInLinks && parentLink?.form.invalid && colorizeInvalid && (itemSelected?.id != parentLink?.id) && !_findTocEntryById(itemSelected?.id, parentLink?.subEntries))}"
|
|
|
|
(click)="itemClicked(parentLink)"
|
2021-02-19 15:35:14 +01:00
|
|
|
[ngStyle]="{'font-size' : (parentLink.type == tocEntryType.FieldSet? '.9rem':'1rem')}"
|
2021-03-24 10:40:48 +01:00
|
|
|
[id]="'TABLE_ENTRY'+parentLink.id"
|
2021-02-19 15:35:14 +01:00
|
|
|
>
|
|
|
|
<!-- {{parentLink?.numbering}} {{parentLink?.label? parentLink?.label : 'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate}} -->
|
2021-03-29 17:42:55 +02:00
|
|
|
<!-- {{parentLink?.numbering}} {{parentLink?.form.get('title').value? parentLink?.form.get('title').value : ('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate) + ' '+ ( (parentLink.type ===tocEntryType.Page? ('DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.PAGE' | translate) : (parentLink.type === tocEntryType.Section? ('DATASET-PROFILE-EDITOR.STEPS.SECTION-INFO.SECTION' | translate) : '') ) | lowercase )}} -->
|
2021-02-19 15:35:14 +01:00
|
|
|
{{parentLink?.numbering}} {{parentLink?.form.get('title').value? parentLink?.form.get('title').value : 'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate}}
|
2021-03-29 17:42:55 +02:00
|
|
|
<ng-container *ngIf="!parentLink.form.get('title').value" [ngSwitch]="parentLink.type">
|
|
|
|
<ng-container *ngSwitchCase="tocEntryType.FieldSet">
|
|
|
|
{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.QUESTION' | translate |lowercase}}
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngSwitchCase="tocEntryType.Section">
|
|
|
|
{{'DATASET-PROFILE-EDITOR.STEPS.SECTION-INFO.SECTION' | translate |lowercase}}
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngSwitchCase="tocEntryType.Page">
|
|
|
|
{{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.PAGE' | translate | lowercase}}
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
</ng-container>
|
2021-02-24 15:56:14 +01:00
|
|
|
<!-- {{parentLink?.numbering}} {{parentLink?.form.get('title').value? parentLink?.form.get('title').value : parentLink.id}} -->
|
2021-02-17 17:39:07 +01:00
|
|
|
</span>
|
2021-02-19 15:35:14 +01:00
|
|
|
|
|
|
|
|
2021-02-12 12:23:39 +01:00
|
|
|
</div>
|
2021-02-24 15:56:14 +01:00
|
|
|
<div class="col-auto d-flex align-items-center" >
|
2021-03-12 17:19:51 +01:00
|
|
|
|
|
|
|
<ng-container *ngIf="!(!((parentLink?.subEntriesType == tocEntryType.FieldSet) && !selectedItemInLinks) || itemSelected?.id == parentLink.id ||isDragging)">
|
2021-03-29 17:42:55 +02:00
|
|
|
<!-- <mat-icon class="text-danger" style="font-size: 1.4em;" *ngIf="!colorError() && parentLink?.form.invalid && colorizeInvalid && allFieldsAreTouched(parentLink?.form)">priority_high</mat-icon> -->
|
2021-03-12 17:19:51 +01:00
|
|
|
<span class="badge-ball"
|
|
|
|
>
|
|
|
|
{{parentLink.subEntries?.length}}
|
|
|
|
</span>
|
|
|
|
</ng-container>
|
2021-02-24 15:56:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
<span style="cursor: pointer;" (click)="deleteEntry(parentLink)"
|
2021-03-22 14:47:45 +01:00
|
|
|
[hidden]="!(!viewOnly && (itemSelected?.id == parentLink?.id) && (parentLink?.type != tocEntryType.FieldSet))"
|
2021-02-24 15:56:14 +01:00
|
|
|
>
|
2021-03-04 13:38:46 +01:00
|
|
|
<mat-icon style="font-size: 1.4em;">delete</mat-icon>
|
2021-02-24 15:56:14 +01:00
|
|
|
</span>
|
2021-02-12 12:23:39 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2021-02-17 17:39:07 +01:00
|
|
|
<!-- When item is not selected then show only the pages (first level) -->
|
|
|
|
<!-- <ng-container *ngIf="tocEntryIsChildOf(itemSelected,parentLink) || (!itemSelected && parentLink?.subEntriesType == tocEntryType.Page)"> -->
|
2021-03-04 13:38:46 +01:00
|
|
|
<!-- [ngClass]="{'border-left-active':itemSelected?.id == parentLink?.id, 'pl-1':itemSelected?.id == parentLink?.id, 'pb-4': isDragging && (parentLink?.type!= tocEntryType.FieldSet) && (parentLink?.id != draggingItemId) }" -->
|
2021-03-01 10:28:27 +01:00
|
|
|
<div dragula="TABLEDRAG" class="ml-2"
|
2021-03-04 13:38:46 +01:00
|
|
|
[ngClass]="{'border-left-active':itemSelected?.id == parentLink?.id, 'ml-1':itemSelected?.id == parentLink?.id, 'pb-4': isDragging && (parentLink?.type!= tocEntryType.FieldSet) && (parentLink?.id != draggingItemId) }"
|
2021-03-01 10:28:27 +01:00
|
|
|
[hidden]="!((parentLink?.subEntriesType!= tocEntryType.FieldSet) || selectedItemInLinks || parentLink?.id === itemSelected?.id || dragHoveringOver ||isDragging)"
|
2021-02-19 15:35:14 +01:00
|
|
|
class="cdk-link-list"
|
2021-02-24 15:56:14 +01:00
|
|
|
[id]="parentLink.id"
|
2021-03-01 10:28:27 +01:00
|
|
|
[ngStyle]="{'border': overContainerId === parentLink?.id? '1px solid #129D99': '', 'min-height': ((!links?.length||(links.length ==1) ) && (parentLink?.type != tocEntryType.FieldSet) && (isDragging) && (draggingItemId != parentLink?.id)) ? '3em':'inherit'}"
|
2021-02-19 15:35:14 +01:00
|
|
|
>
|
2021-03-01 10:28:27 +01:00
|
|
|
<ng-container *ngIf="draggingItemId != parentLink?.id">
|
2021-02-24 15:56:14 +01:00
|
|
|
|
2021-03-01 10:28:27 +01:00
|
|
|
<div *ngFor="let link of links; last as isLast"
|
|
|
|
[ngClass]="{'mb-3': link.type === tocEntryType.Page}"
|
|
|
|
[id]="DRAGULA_ITEM_ID_PREFIX + link.id"
|
|
|
|
>
|
|
|
|
<div class="docs-link mt-0">
|
|
|
|
<!-- <div class="link-name"> -->
|
|
|
|
|
|
|
|
<!-- <div class="table-item row">
|
|
|
|
<div class="col link-info">
|
|
|
|
<span style="cursor: pointer;" [ngClass]="{'active': itemSelected?.id == link.id}" (click)="itemClicked(link)" >
|
|
|
|
{{link.numbering}} {{link.label? link.label : 'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="table-item-actions col-auto" *ngIf="!viewOnly">
|
|
|
|
<button class="mat-button" (click)="deleteEntry(link)"><mat-icon>delete</mat-icon></button>
|
|
|
|
</div>
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- For dev purposes -->
|
|
|
|
<!-- <ng-container [ngSwitch]="link.type">
|
|
|
|
<div *ngSwitchCase="tocEntryType.FieldSet">
|
|
|
|
<span style="background-color: yellow;"> Fieldset</span>
|
|
|
|
</div>
|
|
|
|
<div *ngSwitchCase="tocEntryType.Page">
|
|
|
|
<span style="background-color: lightblue;"> Page</span>
|
|
|
|
</div>
|
|
|
|
<div *ngSwitchCase="tocEntryType.Section">
|
|
|
|
<span style="background-color: lightgreen;"> Section</span>
|
|
|
|
</div>
|
|
|
|
</ng-container> -->
|
|
|
|
<!-- </div> -->
|
|
|
|
<!-- <button cdkDragHandle>drab</button> -->
|
2021-03-04 13:38:46 +01:00
|
|
|
<div [ngClass]="{'ml-3': link.type != tocEntryType.Page }">
|
2021-03-01 10:28:27 +01:00
|
|
|
<app-dataset-profile-table-of-contents-internal-section
|
|
|
|
[links]="link.subEntries"
|
|
|
|
(itemClick)="itemClicked($event)"
|
|
|
|
(removeEntry)="deleteEntry($event)"
|
|
|
|
[parentLink]="link"
|
|
|
|
[itemSelected] = "itemSelected"
|
|
|
|
(createFooEntry)="createNewEntry($event)"
|
|
|
|
[viewOnly]="viewOnly"
|
|
|
|
(dataNeedsRefresh)="onDataNeedsRefresh()"
|
|
|
|
[dropListGroup]="dropListGroup"
|
|
|
|
[dragHoveringOver]="dragHoveringOver"
|
|
|
|
[depth]="depth+1"
|
|
|
|
[DRAGULA_ITEM_ID_PREFIX]="DRAGULA_ITEM_ID_PREFIX"
|
|
|
|
[overContainerId]="overContainerId"
|
|
|
|
[isDragging]="isDragging"
|
|
|
|
[draggingItemId]="draggingItemId"
|
2021-03-12 17:19:51 +01:00
|
|
|
[parentRootId]="parentRootId"
|
|
|
|
[colorizeInvalid]="colorizeInvalid">
|
2021-03-01 10:28:27 +01:00
|
|
|
</app-dataset-profile-table-of-contents-internal-section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ng-container *ngIf="!isDragging">
|
|
|
|
|
|
|
|
<!-- <div *ngIf="links && !viewOnly && !(parentLink?.subEntriesType == tocEntryType.Page) " > -->
|
|
|
|
<ng-container *ngIf="selectedItemInLinks && (link.type != tocEntryType.Page) && isLast && (!viewOnly) &&(link.type != tocEntryType.FieldSet)">
|
|
|
|
<button class="mat-button add-new-entry" style="padding-left: 0px;" (click)="createNewEntry({childType:link.type,parent:parentLink})">
|
|
|
|
<!-- <mat-icon>add</mat-icon> -->
|
|
|
|
<ng-container [ngSwitch]="link.type">
|
|
|
|
<ng-container *ngSwitchCase="tocEntryType.Section">
|
2021-03-04 13:38:46 +01:00
|
|
|
<div class="d-flex" style="align-items: center;" >
|
|
|
|
<mat-icon color="accent" style="font-size: 1.6em;margin-left: -0.3em;">add</mat-icon>
|
|
|
|
<!-- Create new subsection -->
|
|
|
|
{{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-NEW-SUBSECTION' |translate}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Subsection + -->
|
2021-03-01 10:28:27 +01:00
|
|
|
</ng-container>
|
|
|
|
<!-- <ng-container *ngSwitchCase="tocEntryType.Page">
|
|
|
|
Section
|
|
|
|
</ng-container> -->
|
|
|
|
<ng-container *ngSwitchCase="tocEntryType.FieldSet">
|
|
|
|
Field +
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
</ng-container>
|
|
|
|
</button>
|
|
|
|
<!-- <button (click)="showDroplists()">show droplist</button> -->
|
2021-02-19 15:35:14 +01:00
|
|
|
</ng-container>
|
2021-03-01 10:28:27 +01:00
|
|
|
<!-- </div> -->
|
2021-02-19 15:35:14 +01:00
|
|
|
</ng-container>
|
2021-03-01 10:28:27 +01:00
|
|
|
</div>
|
2021-02-17 17:39:07 +01:00
|
|
|
</div>
|
2021-02-12 12:23:39 +01:00
|
|
|
|
2021-03-01 10:28:27 +01:00
|
|
|
</div> <!-- END OF LOOP-->
|
|
|
|
|
|
|
|
</ng-container>
|
2021-02-18 16:13:56 +01:00
|
|
|
|
|
|
|
</div>
|
2021-03-01 10:28:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
<ng-container *ngIf="!isDragging">
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-17 17:39:07 +01:00
|
|
|
<!-- BUILD SUBENTRIES IF THEY DONT EXIST -- CURRENT ITEM DOES HAVE CHILDREN -->
|
|
|
|
<div *ngIf="(!links && parentLink.type!= tocEntryType.FieldSet) && !viewOnly &&parentLink?.id == itemSelected?.id" class="docs-link mt-0">
|
2021-02-19 15:35:14 +01:00
|
|
|
<div class="ml-3">
|
2021-02-17 17:39:07 +01:00
|
|
|
|
|
|
|
<!-- Give option to generate section -->
|
|
|
|
<button class="mat-button" style="padding-left: 0px; display: block;" (click)="createNewEntry({childType:tocEntryType.Section,parent:parentLink})">
|
2021-02-24 15:56:14 +01:00
|
|
|
<!-- <mat-icon>add</mat-icon> -->
|
2021-03-04 13:38:46 +01:00
|
|
|
<!-- Subsection + -->
|
|
|
|
|
|
|
|
<div class="d-flex" style="align-items: center;" >
|
|
|
|
<mat-icon color="accent" style="font-size: 1.6em;margin-left: -0.3em;">add</mat-icon>
|
|
|
|
<!-- Create new subsection -->
|
|
|
|
{{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-NEW-SUBSECTION' |translate}}
|
|
|
|
</div>
|
|
|
|
|
2021-02-17 17:39:07 +01:00
|
|
|
</button>
|
|
|
|
|
|
|
|
|
2021-02-19 15:35:14 +01:00
|
|
|
<!-- Give option to generate fieldset (only if parent is section) -->
|
2021-02-24 15:56:14 +01:00
|
|
|
<!-- <button *ngIf="parentLink.type == tocEntryType.Section" class="mat-button" style="padding-left: 0px;" (click)="createNewEntry({childType:tocEntryType.FieldSet,parent:parentLink})">
|
|
|
|
|
|
|
|
Field +
|
|
|
|
</button> -->
|
2021-02-17 17:39:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
</div>
|
2021-02-12 12:23:39 +01:00
|
|
|
</div>
|
|
|
|
|
2021-02-17 17:39:07 +01:00
|
|
|
<!-- BUILD TYPE OF SAME LEVEL AS LINK OF LINKS -->
|
2021-02-19 15:35:14 +01:00
|
|
|
<!-- <div *ngIf="links && !viewOnly && !(parentLink?.subEntriesType == tocEntryType.Page) " >
|
|
|
|
<ng-container >
|
2021-02-17 17:39:07 +01:00
|
|
|
<button class="mat-button" style="padding-left: 0px;" (click)="createNewEntry({childType:parentLink.subEntriesType,parent:parentLink})">
|
|
|
|
<mat-icon>add</mat-icon>
|
|
|
|
<ng-container [ngSwitch]="parentLink?.subEntriesType">
|
|
|
|
<ng-container *ngSwitchCase="tocEntryType.Section">
|
|
|
|
Subsection
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngSwitchCase="tocEntryType.Page">
|
|
|
|
Section
|
|
|
|
</ng-container>
|
2021-02-19 15:35:14 +01:00
|
|
|
<ng-container *ngSwitchCase="tocEntryType.FieldSet">
|
2021-02-17 17:39:07 +01:00
|
|
|
Fieldset
|
2021-02-19 15:35:14 +01:00
|
|
|
</ng-container>
|
2021-02-17 17:39:07 +01:00
|
|
|
|
|
|
|
</ng-container>
|
|
|
|
</button>
|
2021-02-12 12:23:39 +01:00
|
|
|
</ng-container>
|
2021-02-19 15:35:14 +01:00
|
|
|
</div> -->
|
2021-03-01 10:28:27 +01:00
|
|
|
<!-- </ng-container> -->
|
|
|
|
|
|
|
|
<!-- Only for the page -->
|
2021-03-04 13:38:46 +01:00
|
|
|
<!-- style="margin-left: -0.5em;" -->
|
|
|
|
<div *ngIf="parentLink?.subEntriesType == tocEntryType.Page && !viewOnly" >
|
|
|
|
<button class="mat-button mt-2" (click)="createNewEntry({childType:parentLink.subEntriesType,parent:parentLink})" style="padding-left:0px">
|
2021-03-01 10:28:27 +01:00
|
|
|
<!-- <mat-icon>add</mat-icon> -->
|
2021-03-04 13:38:46 +01:00
|
|
|
<div class="d-flex" style="align-items: center;" >
|
|
|
|
<mat-icon color="accent" style="font-size: 1.6em;margin-left: -0.3em;">add</mat-icon>
|
|
|
|
<ng-container *ngIf="!links?.length else createsection">
|
|
|
|
{{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-FIRST-SECTION'| translate}}
|
|
|
|
<!-- Create the first section -->
|
|
|
|
</ng-container>
|
|
|
|
<ng-template #createsection>
|
|
|
|
{{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.ACTIONS.CREATE-NEW-SECTION'| translate}}
|
|
|
|
<!-- Create new section -->
|
|
|
|
</ng-template>
|
|
|
|
</div>
|
2021-03-01 10:28:27 +01:00
|
|
|
</button>
|
|
|
|
<!-- <button (click)="showDroplists()">show droplist</button>
|
|
|
|
<button (click)="showStructs()">structs</button> -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</ng-container>
|