mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
modified changes
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: rgba(33, 33, 33, 0.05);
|
background: background: var(--adf-metadata-tags-background-color);
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
-6
@@ -467,12 +467,6 @@ describe('CategoriesManagementComponent', () => {
|
|||||||
expect(component.categories.length).toBe(0);
|
expect(component.categories.length).toBe(0);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should hide categoryNameControl and emit event', fakeAsync(() => {
|
|
||||||
component.hideNameInput();
|
|
||||||
expect(component.categoryNameControlVisible).toBe(false);
|
|
||||||
expect(component.existingCategoriesPanelVisible).toBe(false);
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('should toggle categoryNameControl visibility', () => {
|
it('should toggle categoryNameControl visibility', () => {
|
||||||
component.categoryNameControlVisible = true;
|
component.categoryNameControlVisible = true;
|
||||||
expect(component.categoryNameControlVisible).toBe(true);
|
expect(component.categoryNameControlVisible).toBe(true);
|
||||||
|
|||||||
+2
-2
@@ -148,10 +148,10 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="adf-metadata-action-buttons" *ngIf="group.editable">
|
<div class="adf-metadata-action-buttons" *ngIf="group.editable">
|
||||||
<button mat-icon-button (click)="cancelChanges(group, $event)" data-automation-id="reset-metadata">
|
<button mat-icon-button (click)="cancelGroupChanges(group, $event)" data-automation-id="reset-metadata">
|
||||||
<mat-icon>clear</mat-icon>
|
<mat-icon>clear</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button mat-icon-button (click)="saveChanges(group, $event)" color="primary" data-automation-id="save-metadata"
|
<button mat-icon-button (click)="saveGroupChanges(group, $event)" color="primary" data-automation-id="save-metadata"
|
||||||
[disabled]="!hasMetadataChanged">
|
[disabled]="!hasMetadataChanged">
|
||||||
<mat-icon>check</mat-icon>
|
<mat-icon>check</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
+23
-43
@@ -238,10 +238,10 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
* Called after clicking save button. It confirms all changes done for metadata and hides both category and tag name controls.
|
* Called after clicking save button. It confirms all changes done for metadata and hides both category and tag name controls.
|
||||||
* Before clicking on that button they are not saved.
|
* Before clicking on that button they are not saved.
|
||||||
*/
|
*/
|
||||||
saveChanges(group:any, event: Event) {
|
|
||||||
|
saveChanges(event: Event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this._saving = true;
|
this._saving = true;
|
||||||
group.editable = !group.editable;
|
|
||||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
if (this.hasContentTypeChanged(this.changedProperties)) {
|
||||||
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
||||||
this.updateNode();
|
this.updateNode();
|
||||||
@@ -251,45 +251,27 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveGroupChanges(group: any, event: Event) {
|
||||||
|
this.saveChanges(event);
|
||||||
|
group.editable = !group.editable;
|
||||||
|
}
|
||||||
|
|
||||||
saveGeneralInfoChanges(event: Event) {
|
saveGeneralInfoChanges(event: Event) {
|
||||||
event.stopPropagation();
|
this.saveChanges(event);
|
||||||
this._saving = true;
|
|
||||||
this.editableGeneralInfo = !this.editableGeneralInfo;
|
this.editableGeneralInfo = !this.editableGeneralInfo;
|
||||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
|
||||||
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
|
||||||
this.updateNode();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.updateNode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
saveTagsChanges(event: Event) {
|
saveTagsChanges(event: Event) {
|
||||||
event.stopPropagation();
|
this.saveChanges(event);
|
||||||
this._saving = true;
|
|
||||||
this.tagNameControlVisible = false;
|
this.tagNameControlVisible = false;
|
||||||
this.editableTags = !this.editableTags;
|
this.editableTags = !this.editableTags;
|
||||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
|
||||||
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
|
||||||
this.updateNode();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.updateNode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
saveCategoriesChanges(event: Event) {
|
saveCategoriesChanges(event: Event) {
|
||||||
event.stopPropagation();
|
this.saveChanges(event);
|
||||||
this._saving = true;
|
|
||||||
this.editableCategories = !this.editableCategories;
|
|
||||||
this.categoryControlVisible = false;
|
this.categoryControlVisible = false;
|
||||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
this.editableCategories = !this.editableCategories;
|
||||||
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
|
||||||
this.updateNode();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.updateNode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -319,32 +301,30 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
this.hasMetadataChanged = false;
|
this.hasMetadataChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelChanges(group: any, event: Event) {
|
cancelChanges(event: Event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.revertChanges();
|
this.revertChanges();
|
||||||
this.loadProperties(this.node);
|
this.loadProperties(this.node);
|
||||||
|
}
|
||||||
|
|
||||||
|
cancelGroupChanges(group: any, event: Event) {
|
||||||
|
this.cancelChanges(event);
|
||||||
group.editable = !group.editable;
|
group.editable = !group.editable;
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelGeneralInfoChanges(event: Event) {
|
cancelGeneralInfoChanges(event: Event) {
|
||||||
event.stopPropagation();
|
this.cancelChanges(event);
|
||||||
this.revertChanges();
|
|
||||||
this.loadProperties(this.node);
|
|
||||||
this.editableGeneralInfo = !this.editableGeneralInfo;
|
this.editableGeneralInfo = !this.editableGeneralInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
CancelTagsChanges(event: Event) {
|
CancelTagsChanges(event: Event) {
|
||||||
event.stopPropagation();
|
this.cancelChanges(event);
|
||||||
this.revertChanges();
|
|
||||||
this.loadProperties(this.node);
|
|
||||||
this.editableTags = !this.editableTags;
|
this.editableTags = !this.editableTags;
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelCategoriesChanges(event: Event) {
|
cancelCategoriesChanges(event: Event) {
|
||||||
event.stopPropagation();
|
this.cancelChanges(event);
|
||||||
this.revertChanges();
|
this.editableCategories = !this.editableCategories;
|
||||||
this.loadProperties(this.node);
|
|
||||||
this.editableCategories = !this.editableCategories
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showGroup(group: CardViewGroup): boolean {
|
showGroup(group: CardViewGroup): boolean {
|
||||||
@@ -494,7 +474,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.editableGeneralInfo = !this.editableGeneralInfo;
|
this.editableGeneralInfo = !this.editableGeneralInfo;
|
||||||
if (!this.panel.expanded) {
|
if (!this.panel.expanded) {
|
||||||
this.panel.open(); // Expand the panel if it's collapsed
|
this.panel.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,7 +506,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
expandePanel(group:any) {
|
expandePanel(group: any) {
|
||||||
group.expanded = true;
|
group.expanded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user