Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-5551] Property Panel Design Update #3415

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3064c0f
[ACS-5540] changes for edit aspect button
Yasa-Nataliya Aug 31, 2023
6a7f8b5
added aspect edit button
Yasa-Nataliya Sep 1, 2023
3e435be
[ACS-5540]fixed unit test cases and added unit test cases
Yasa-Nataliya Sep 1, 2023
bcd2d1c
[ACS-5540] Modified changes
Yasa-Nataliya Sep 5, 2023
7aefddf
[ACS-5540]added theme
Yasa-Nataliya Sep 5, 2023
6a00c3e
[ACS-5540] fixed file lock issue
Yasa-Nataliya Sep 7, 2023
b018336
[ACS-5645]Implemented changes as per review comments
Yasa-Nataliya Sep 7, 2023
c97e4e8
[ACS-5540]Modified the test case title
Yasa-Nataliya Sep 7, 2023
3d5ec7a
[ACS-5645] changes for aspect icon
Yasa-Nataliya Sep 11, 2023
9c2ad83
[ACS-5645] fixed aspect lock issue in small screen
Yasa-Nataliya Sep 11, 2023
afc65c4
[ACS-5540] modified the aspect button changes
Yasa-Nataliya Sep 13, 2023
5121ad0
[ACS-5540] modified the changes
Yasa-Nataliya Sep 13, 2023
341d7c4
[ACS-5645] added unit test cases
Yasa-Nataliya Sep 18, 2023
28c4151
[ACS-5540] removed unwanted code
Yasa-Nataliya Sep 19, 2023
9ed9fcc
[ACS-5540] fixed lock-file bug
Yasa-Nataliya Sep 20, 2023
3d75506
[ACS-5540] revert the unwanted changes
Yasa-Nataliya Sep 21, 2023
1815570
[ACS-5540] modified changes
Yasa-Nataliya Sep 21, 2023
ed561bc
[ACS-5540]Implemented the changes as per the review comments
Yasa-Nataliya Sep 22, 2023
c38a046
[ACS-5540] added group lock changes
Yasa-Nataliya Sep 22, 2023
f400575
[ACS-5540] added tooltip
Yasa-Nataliya Sep 25, 2023
1116dfd
[ACS-5540] Implemented the review comments
Yasa-Nataliya Sep 28, 2023
fab07b9
[ACS-5540] added tooltips
Yasa-Nataliya Sep 28, 2023
627c953
[ACS-5540] Added styles
Yasa-Nataliya Oct 3, 2023
0559405
[ACS-5540]Added focus
Yasa-Nataliya Oct 4, 2023
8d492e6
[AAE-14484] fix peerdepend (#3471)
eromano Oct 10, 2023
f92a2b1
[ACS-4130] Added autocomplete to folder rules 'Has Category' conditio…
swapnil-verma-gl Oct 11, 2023
7183326
[ACS-5551]updated property panel design
AnukritiGL Sep 6, 2023
7866c40
[ACS-5551]added null checks
pkunduGL Sep 9, 2023
500d8e5
[ACS-5551] update style
AnukritiGL Oct 12, 2023
1484721
[ACS-5540] changes for edit aspect button
Yasa-Nataliya Aug 31, 2023
cb78cd6
added aspect edit button
Yasa-Nataliya Sep 1, 2023
4e0a596
[ACS-5540]fixed unit test cases and added unit test cases
Yasa-Nataliya Sep 1, 2023
4a90172
[ACS-5540] Modified changes
Yasa-Nataliya Sep 5, 2023
a335390
[ACS-5540]added theme
Yasa-Nataliya Sep 5, 2023
02a061a
[ACS-5540] fixed file lock issue
Yasa-Nataliya Sep 7, 2023
a84f80f
[ACS-5645]Implemented changes as per review comments
Yasa-Nataliya Sep 7, 2023
736169d
[ACS-5540]Modified the test case title
Yasa-Nataliya Sep 7, 2023
f81a9ee
[ACS-5645] changes for aspect icon
Yasa-Nataliya Sep 11, 2023
4fca88d
[ACS-5645] fixed aspect lock issue in small screen
Yasa-Nataliya Sep 11, 2023
6c8167e
[ACS-5540] modified the aspect button changes
Yasa-Nataliya Sep 13, 2023
a1c5d8b
[ACS-5540] modified the changes
Yasa-Nataliya Sep 13, 2023
1ba838d
[ACS-5645] added unit test cases
Yasa-Nataliya Sep 18, 2023
dda9f41
[ACS-5540] removed unwanted code
Yasa-Nataliya Sep 19, 2023
177fbdc
[ACS-5540] fixed lock-file bug
Yasa-Nataliya Sep 20, 2023
eb488bc
[ACS-5540] revert the unwanted changes
Yasa-Nataliya Sep 21, 2023
9b1cf28
[ACS-5540] modified changes
Yasa-Nataliya Sep 21, 2023
cdbffb2
[ACS-5540]Implemented the changes as per the review comments
Yasa-Nataliya Sep 22, 2023
7ff38f6
[ACS-5540] added group lock changes
Yasa-Nataliya Sep 22, 2023
638bdde
[ACS-5540] added tooltip
Yasa-Nataliya Sep 25, 2023
77dff82
[ACS-5540] Implemented the review comments
Yasa-Nataliya Sep 28, 2023
ccb340d
[ACS-5540] added tooltips
Yasa-Nataliya Sep 28, 2023
4ccbb71
[ACS-5540] Added styles
Yasa-Nataliya Oct 3, 2023
1d3ec3e
[ACS-5540]Added focus
Yasa-Nataliya Oct 4, 2023
4ebacdc
[ACS-5551]updated property panel design
AnukritiGL Sep 6, 2023
83cde6a
[ACS-5551]added null checks
pkunduGL Sep 9, 2023
958b307
[ACS-5551] update style
AnukritiGL Oct 12, 2023
2ebcef2
[ACS-5551] name updated
AnukritiGL Oct 12, 2023
05f4c36
[ACS-5551] change case of text
AnukritiGL Oct 12, 2023
74ecdf0
Merge branch 'ACS-5551-Property-panel-style' of https://github.com/Al…
pkunduGL Oct 12, 2023
bf24141
[ACS-5551] unit test fix
AnukritiGL Oct 12, 2023
9dc0900
[ACS-5551] header issue fixed
AnukritiGL Oct 12, 2023
8771725
Merge branch 'ACS-5551-Property-panel-style' of https://github.com/Al…
pkunduGL Oct 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion projects/aca-content/assets/app.extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,18 @@
"visible": "showInfoSelectionButton"
}
},
{
"id": "app.toolbar.aspects",
"order": 160,
"title": "APP.ACTIONS.ADD_ASPECTS",
"icon": "playlist_add",
"actions": {
"click": "ASPECT_LIST"
},
"rules": {
"visible": "canEditAspects"
}
},
{
"id": "app.sidebar.expand",
"order": 200,
Expand All @@ -1249,7 +1261,7 @@
"click": "EXPAND_INFO_DRAWER"
},
"rules": {
"visible": "app.navigation.isNotLibraries"
"visible": "canShowExpand"
}
}
],
Expand Down
8 changes: 5 additions & 3 deletions projects/aca-content/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@
"LEAVE": "Leave Library",
"EDIT_OFFLINE": "Edit Offline",
"EDIT_OFFLINE_CANCEL": "Cancel Editing",
"CHANGE_ASPECT": "Edit Aspects"
"CHANGE_ASPECT": "Edit Aspects",
"ADD_ASPECTS": "Add Aspects"
},
"DIALOGS": {
"CONFIRM_PURGE": {
Expand Down Expand Up @@ -394,15 +395,16 @@
},
"INFO_DRAWER": {
"TITLE": "Details",
"CLOSE": "Close",
"REDUCE_PANEL": "Reduce panel",
"DATA_LOADING": "Data is loading",
"ICON": "Node Icon",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be a duplication, I've already seen that in the ADF PR

"TABS": {
"PROPERTIES": "Properties",
"LIBRARY_PROPERTIES": "About",
"VERSIONS": "Versions",
"COMMENTS": "Comments",
"PERMISSIONS": "Permissions",
"EXPAND": "Expand"
"EXPAND": "Expand panel"
}
},
"TOOLTIPS": {
Expand Down
1 change: 1 addition & 0 deletions projects/aca-content/src/lib/aca-content.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export class ContentServiceExtensionModule {
canToggleFavorite: rules.canToggleFavorite,
isLibraryManager: rules.isLibraryManager,
canEditAspects: rules.canEditAspects,
canShowExpand: rules.canShowExpand,
canInfoPreview: rules.canInfoPreview,
showInfoSelectionButton: rules.showInfoSelectionButton,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
<div class="acs-details-container">
<div class="acs-details-title">
<div class="acs-details-breadcrumb" role="heading" aria-level="2" *ngIf="node">
<span class="acs-details-breadcrumb-library"> {{ node.name }} </span>
-
<span class="acs-details-breadcrumb-item">{{ 'APP.INFO_DRAWER.TITLE' | translate }}</span>
<span class="acs-details-breadcrumb-library">
<img class="acs-details-breadcrumb-icon" alt="{{ 'APP.INFO_DRAWER.ICON' | translate }}" src="{{ getNodeIcon(node) }}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be a duplication, I've already seen that in the ADF PR

{{ node.name }} </span>
</div>
<div class="acs-details-buttons">
<aca-toolbar [items]="aspectActions" info-drawer-buttons></aca-toolbar>
<button
class="aca-close-details-button"
mat-icon-button
data-automation-id="close-library"
title="{{ 'APP.INFO_DRAWER.REDUCE_PANEL' | translate }}"
(click)="goBack()">
<mat-icon>fullscreen_exit</mat-icon>
</button>
</div>
<button
class="aca-close-details-button"
mat-icon-button
data-automation-id="close-library"
title="{{ 'APP.INFO_DRAWER.CLOSE' | translate }}"
(click)="goBack()">
<mat-icon>fullscreen_exit</mat-icon>
</button>
</div>

<mat-tab-group [selectedIndex]="activeTab" class="aca-details-tabs" animationDuration="0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
app-details-manager {
.aca-close-details-button {
margin-right: 15px;
margin-top: 2px;
outline: none;
border-radius: 4px;

&:focus {
background-color: var(--theme-selected-background-color);
outline: 2px solid var(--theme-blue-button-color);
border-radius: 4px;
}
.acs-details-buttons {
display: flex;

&:focus-visible {
outline: 2px solid var(--theme-blue-button-color);
.aca-close-details-button {
margin-right: 15px;
margin-top: 12px;
outline: none;
border-radius: 4px;

&:focus {
background-color: var(--theme-selected-background-color);
outline: 2px solid var(--theme-blue-button-color);
border-radius: 4px;
}

&:focus-visible {
outline: 2px solid var(--theme-blue-button-color);
border-radius: 4px;
margin-top: 12px;

&:focus-visible {
outline: 2px solid var(--theme-blue-button-color);
border-radius: 4px;
}
}
}
}
}
Expand All @@ -24,34 +34,33 @@ app-details-manager {
}

.aca-details-tabs {
margin-top: 40px;
height: calc(100% - 80px);

.mat-tab-body-wrapper {
height: 100%;
}

.mat-tab-labels {
text-transform: uppercase;
}
}

.acs-details-title {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
color: var(--theme-metadata-property-panel-title-color);
text-overflow: ellipsis;
white-space: normal;
}

.acs-details-breadcrumb {
font-size: 18px;
font-size: 20px;
margin-left: 20px;

.acs-details-breadcrumb-library {
font-weight: 900;
font-weight: 400;
}

.acs-details-breadcrumb-item {
font-weight: 100;
.acs-details-breadcrumb-icon {
display: inline-block;
vertical-align: text-bottom;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppTestingModule } from '../../testing/app-testing.module';
import { DetailsComponent } from './details.component';
import { ActivatedRoute } from '@angular/router';
import { of, Subject } from 'rxjs';
import { BehaviorSubject, of, Subject } from 'rxjs';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { Store } from '@ngrx/store';
import { ContentApiService } from '@alfresco/aca-shared';
Expand All @@ -49,6 +49,47 @@ describe('DetailsComponent', () => {
select: () => mockStream
};

const extensionsServiceMock = {
getAllowedSidebarActions: jasmine.createSpy('getAllowedSidebarActions')
};

const mockAspectActions = [];

const mockObservable = new BehaviorSubject(mockAspectActions);
extensionsServiceMock.getAllowedSidebarActions.and.returnValue(mockObservable);

const mockNode = {
isFile: false,
createdByUser: { id: 'admin', displayName: 'Administrator' },
modifiedAt: new Date('2017-05-24T15:08:55.640Z'),
nodeType: 'cm:content',
content: {
mimeType: 'application/rtf',
mimeTypeName: 'Rich Text Format',
sizeInBytes: 14530,
encoding: 'UTF-8'
},
parentId: 'd124de26-6ba0-4f40-8d98-4907da2d337a',
createdAt: new Date('2017-05-24T15:08:55.640Z'),
path: {
name: '/Company Home/Guest Home',
isComplete: true,
elements: [
{
id: '94acfc73-7014-4475-9bd9-93a2162f0f8c',
name: 'Company Home'
},
{ id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' }
]
},
isFolder: true,
modifiedByUser: { id: 'admin', displayName: 'Administrator' },
name: 'b_txt_file.rtf',
id: '70e1cc6a-6918-468a-b84a-1048093b06fd',
properties: { 'cm:versionLabel': '1.0', 'cm:versionType': 'MAJOR' },
allowableOperations: ['delete', 'update']
};

beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule, DetailsComponent],
Expand Down Expand Up @@ -128,4 +169,20 @@ describe('DetailsComponent', () => {
fixture.detectChanges();
expect(store.dispatch).toHaveBeenCalledWith(new SetSelectedNodesAction([node]));
});

it('should set aspectActions from extensions', () => {
extensionsServiceMock.getAllowedSidebarActions.and.returnValue(of(mockAspectActions));
fixture.detectChanges();
fixture.whenStable().then(() => {
expect(component.aspectActions).toEqual(mockAspectActions);
});
});

it('should return the icon when getNodeIcon is called', () => {
const expectedIcon = 'assets/images/ft_ic_folder';
spyOn(component['nodeActionsService'], 'getNodeIcon').and.returnValue(expectedIcon);
fixture.detectChanges();
const result = component.getNodeIcon(mockNode);
expect(result).toContain(expectedIcon);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatButtonModule } from '@angular/material/button';
import { MetadataTabComponent } from '../info-drawer/metadata-tab/metadata-tab.component';
import { CommentsTabComponent } from '../info-drawer/comments-tab/comments-tab.component';
import { takeUntil } from 'rxjs/operators';
import { ContentActionRef } from '@alfresco/adf-extensions';
import { NodeActionsService } from '../../services/node-actions.service';
import { Node } from '@alfresco/js-api';

@Component({
standalone: true,
Expand Down Expand Up @@ -63,8 +67,9 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy
isLoading: boolean;
onDestroy$ = new Subject<boolean>();
activeTab = 1;
aspectActions: Array<ContentActionRef> = [];

constructor(private route: ActivatedRoute, private contentApi: ContentApiService) {
constructor(private route: ActivatedRoute, private contentApi: ContentApiService, private nodeActionsService: NodeActionsService) {
super();
}

Expand All @@ -85,6 +90,16 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy
this.store.dispatch(new SetSelectedNodesAction([{ entry: this.node }]));
});
});
this.extensions
.getAllowedSidebarActions()
.pipe(takeUntil(this.onDestroy$))
.subscribe((aspectActions) => {
this.aspectActions = aspectActions;
});
}

getNodeIcon(node: Node): string {
return this.nodeActionsService.getNodeIcon(node);
}

setActiveTab(tabName: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ describe('MetadataTabComponent', () => {
});

it('show pass empty when store is in initial state', () => {
const initialState = fixture.debugElement.query(By.css('adf-content-metadata-card'));
const initialState = fixture.debugElement.query(By.css('adf-content-metadata'));
expect(initialState.componentInstance.displayAspect).toBeFalsy();
});

Expand All @@ -266,7 +266,7 @@ describe('MetadataTabComponent', () => {
expect(aspect).toBe('EXIF');
});
fixture.detectChanges();
const initialState = fixture.debugElement.query(By.css('adf-content-metadata-card'));
const initialState = fixture.debugElement.query(By.css('adf-content-metadata'));
expect(initialState.componentInstance.displayAspect).toBe('EXIF');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,36 @@ import { Actions, ofType } from '@ngrx/effects';
imports: [CommonModule, ContentMetadataModule],
selector: 'app-metadata-tab',
template: `
<adf-content-metadata-card
<adf-content-metadata
[readOnly]="!canUpdateNode"
[preset]="'custom'"
[node]="node"
[displayAspect]="displayAspect$ | async"
[displayTags]="true"
[displayCategories]="true"
[(editable)]="editable"
[(editableTags)]="editableTags"
[(editableCategories)]="editableCategories"
[(group)]="group"
>
</adf-content-metadata-card>
</adf-content-metadata>
`,
encapsulation: ViewEncapsulation.None,
host: { class: 'app-metadata-tab' }
})
export class MetadataTabComponent implements OnInit, OnDestroy {
protected onDestroy$ = new Subject<boolean>();

@Input()
node: Node;

displayAspect$: Observable<string>;
canUpdateNode = false;
editable = false;
editableTags = false;
editableCategories = false;
group: any = {
editable: false
};

constructor(
private permission: NodePermissionService,
Expand Down Expand Up @@ -91,6 +100,9 @@ export class MetadataTabComponent implements OnInit, OnDestroy {
this.checkIfNodeIsUpdatable(updatedNode?.payload.entry);
if (!this.canUpdateNode) {
this.editable = false;
this.editableTags = false;
this.editableCategories = false;
this.group.editable = false;
}
});
}
Expand Down
Loading
Loading