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;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
background: rgba(33, 33, 33, 0.05);
|
||||
background: background: var(--adf-metadata-tags-background-color);
|
||||
height: 32px;
|
||||
border-radius: 12px;
|
||||
align-items: center;
|
||||
|
||||
-6
@@ -467,12 +467,6 @@ describe('CategoriesManagementComponent', () => {
|
||||
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', () => {
|
||||
component.categoryNameControlVisible = true;
|
||||
expect(component.categoryNameControlVisible).toBe(true);
|
||||
|
||||
+2
-2
@@ -148,10 +148,10 @@
|
||||
</button>
|
||||
</div>
|
||||
<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>
|
||||
</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">
|
||||
<mat-icon>check</mat-icon>
|
||||
</button>
|
||||
|
||||
+24
-44
@@ -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.
|
||||
* Before clicking on that button they are not saved.
|
||||
*/
|
||||
saveChanges(group:any, event: Event) {
|
||||
|
||||
saveChanges(event: Event) {
|
||||
event.stopPropagation();
|
||||
this._saving = true;
|
||||
group.editable = !group.editable;
|
||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
||||
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
||||
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) {
|
||||
event.stopPropagation();
|
||||
this._saving = true;
|
||||
this.saveChanges(event);
|
||||
this.editableGeneralInfo = !this.editableGeneralInfo;
|
||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
||||
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
||||
this.updateNode();
|
||||
});
|
||||
} else {
|
||||
this.updateNode();
|
||||
}
|
||||
}
|
||||
|
||||
saveTagsChanges(event: Event) {
|
||||
event.stopPropagation();
|
||||
this._saving = true;
|
||||
this.saveChanges(event);
|
||||
this.tagNameControlVisible = false;
|
||||
this.editableTags = !this.editableTags;
|
||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
||||
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
||||
this.updateNode();
|
||||
});
|
||||
} else {
|
||||
this.updateNode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
saveCategoriesChanges(event: Event) {
|
||||
event.stopPropagation();
|
||||
this._saving = true;
|
||||
this.editableCategories = !this.editableCategories;
|
||||
this.saveChanges(event);
|
||||
this.categoryControlVisible = false;
|
||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
||||
this.contentMetadataService.openConfirmDialog(this.changedProperties).subscribe(() => {
|
||||
this.updateNode();
|
||||
});
|
||||
} else {
|
||||
this.updateNode();
|
||||
}
|
||||
this.editableCategories = !this.editableCategories;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -319,32 +301,30 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this.hasMetadataChanged = false;
|
||||
}
|
||||
|
||||
cancelChanges(group: any, event: Event) {
|
||||
cancelChanges(event: Event) {
|
||||
event.stopPropagation();
|
||||
this.revertChanges();
|
||||
this.loadProperties(this.node);
|
||||
}
|
||||
|
||||
cancelGroupChanges(group: any, event: Event) {
|
||||
this.cancelChanges(event);
|
||||
group.editable = !group.editable;
|
||||
}
|
||||
|
||||
cancelGeneralInfoChanges(event: Event) {
|
||||
event.stopPropagation();
|
||||
this.revertChanges();
|
||||
this.loadProperties(this.node);
|
||||
this.cancelChanges(event);
|
||||
this.editableGeneralInfo = !this.editableGeneralInfo;
|
||||
}
|
||||
|
||||
CancelTagsChanges(event: Event) {
|
||||
event.stopPropagation();
|
||||
this.revertChanges();
|
||||
this.loadProperties(this.node);
|
||||
this.cancelChanges(event);
|
||||
this.editableTags = !this.editableTags;
|
||||
}
|
||||
|
||||
cancelCategoriesChanges(event: Event) {
|
||||
event.stopPropagation();
|
||||
this.revertChanges();
|
||||
this.loadProperties(this.node);
|
||||
this.editableCategories = !this.editableCategories
|
||||
this.cancelChanges(event);
|
||||
this.editableCategories = !this.editableCategories;
|
||||
}
|
||||
|
||||
showGroup(group: CardViewGroup): boolean {
|
||||
@@ -494,7 +474,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
||||
event.stopPropagation();
|
||||
this.editableGeneralInfo = !this.editableGeneralInfo;
|
||||
if (!this.panel.expanded) {
|
||||
this.panel.open(); // Expand the panel if it's collapsed
|
||||
this.panel.open();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,14 +506,14 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
expandePanel(group:any) {
|
||||
expandePanel(group: any) {
|
||||
group.expanded = true;
|
||||
}
|
||||
|
||||
onPanelOpened(group: any): void {
|
||||
group.aspectPanelstate = true;
|
||||
}
|
||||
onPanelClosed(group: any): void {
|
||||
onPanelClosed(group: any): void {
|
||||
group.aspectPanelstate = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user