mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACS-5645] Property Panel Feature (#3477)
* [ACS-5540] changes for edit aspect button * added aspect edit button * [ACS-5540]fixed unit test cases and added unit test cases * [ACS-5540] Modified changes * [ACS-5540] fixed file lock issue * [ACS-5645]Implemented changes as per review comments * [ACS-5540]Modified the test case title * [ACS-5645] changes for aspect icon * [ACS-5645] fixed aspect lock issue in small screen * [ACS-5540] modified the aspect button changes * [ACS-5540] modified the changes * [ACS-5645] added unit test cases * [ACS-5540] removed unwanted code * [ACS-5540] fixed lock-file bug * [ACS-5540] revert the unwanted changes * [ACS-5540] modified changes * [ACS-5540]Implemented the changes as per the review comments * [ACS-5540] added group lock changes * [ACS-5540] added tooltip * [ACS-5540] Implemented the review comments * [ACS-5540] added tooltips * [ACS-5540] Added styles * [ACS-5540]Added focus * [ACS-5551]updated property panel design * [ACS-5551]added null checks * [ACS-5551] update style * [ACS-5540] changes for edit aspect button * added aspect edit button * [ACS-5540]fixed unit test cases and added unit test cases * [ACS-5540] Modified changes * [ACS-5645]Implemented changes as per review comments * [ACS-5645] changes for aspect icon * [ACS-5540] modified the aspect button changes * [ACS-5540] modified the changes * [ACS-5540] revert the unwanted changes * [ACS-5540] added group lock changes * [ACS-5551]updated property panel design * [ACS-5551]added null checks * [ACS-5551] update style * [ACS-5551] name updated * [ACS-5551] unit test fix * [ACS-5551] header issue fixed * [ACS-5645] style updated * [ACS-5645] border updated * [ACS-6117] fixed aspect dispaly issue * [ACS-5645] different node open issu fixed * [ACS-5645] unit test issue fix * [ACS-5645] unit test fix * [ACS-5645] tabs design modify * [ACS-5645] dependency updated * [link-adf:ACS-564 5-property-panel-feature] test linking * "[link-adf:ACS-5645-property-panel-feature]" * [ACS-5645] revert adf linking changes * add adf configs to libs * fix issue with empty paths * try using adf target * [link-adf:ACS-5645-property-panel-feature] fix core mapping * [link-adf:ACS-5645-property-panel-feature] revert target changes * remove useless styles * remove css hacks * cleanup useless properties * remove useless properties * remove useless code * [ACS-5645] added missing code * [ACS-5654] add icon for full screen * [ACS-5654] nodei con methods moved to thumbnail * [ACS-5654] unit test added and code refactor * [ACS-5645] unit test added * [ACS-5645] panel issue fix * [ACS-5645] removed unit test for editable property * [ACS-5645] removed unused unit test * [ACS-5645] unit test updated * [ACS-5645] updated the unit test * Modified the unit test cases for getNodeIcon * Upsteam ADF-6.6.0-7287333895, Js-api-7.5.0-7287333895 version * Fix failing test cases * Fix failing e2e --------- Co-authored-by: Yasa-Nataliya <yasa.nataliya@globallogic.com> Co-authored-by: pkundu <priyanka.kundu@hyland.com> Co-authored-by: Denys Vuika <denys.vuika@gmail.com> Co-authored-by: rbahirsheth <raviraj.bahirsheth@globallogic.com>
This commit is contained in:
@@ -8,18 +8,21 @@
|
||||
<div class="aca-details-container">
|
||||
<div class="aca-details-title">
|
||||
<div class="aca-details-breadcrumb" role="heading" aria-level="2" *ngIf="node">
|
||||
<span class="aca-details-breadcrumb-library"> {{ node.name }} </span>
|
||||
-
|
||||
<span class="aca-details-breadcrumb-item">{{ 'APP.INFO_DRAWER.TITLE' | translate }}</span>
|
||||
<span class="aca-details-breadcrumb-library">
|
||||
<img class="aca-details-breadcrumb-icon" alt="{{ 'APP.INFO_DRAWER.ICON' | translate }}" src="{{ nodeIcon }}">
|
||||
{{ 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">
|
||||
|
@@ -1,19 +1,18 @@
|
||||
app-details-manager {
|
||||
.aca-close-details-button {
|
||||
margin-right: 15px;
|
||||
margin-top: 2px;
|
||||
outline: none;
|
||||
border-radius: 4px;
|
||||
.acs-details-buttons {
|
||||
display: flex;
|
||||
|
||||
&:focus {
|
||||
background-color: var(--theme-selected-background-color);
|
||||
outline: 2px solid var(--theme-blue-button-color);
|
||||
.aca-close-details-button {
|
||||
margin-right: 15px;
|
||||
margin-top: 12px;
|
||||
outline: none;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
&:focus-visible {
|
||||
outline: 2px solid var(--theme-blue-button-color);
|
||||
border-radius: 4px;
|
||||
&:focus {
|
||||
background-color: var(--theme-selected-background-color);
|
||||
outline: 2px solid var(--theme-blue-button-color);
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,14 +24,23 @@ app-details-manager {
|
||||
|
||||
.aca-details-tabs {
|
||||
margin-top: 40px;
|
||||
height: calc(100% - 80px);
|
||||
height: calc(100% - 136px);
|
||||
|
||||
.mat-tab-body-wrapper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
mat-tab-header {
|
||||
text-transform: uppercase;
|
||||
.mat-tab-list {
|
||||
margin-left: 50px;
|
||||
|
||||
.mat-tab-labels {
|
||||
.mat-tab-label {
|
||||
padding: 0 12px;
|
||||
min-width: 95px;
|
||||
letter-spacing: 0.25px;
|
||||
height: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,17 +49,24 @@ app-details-manager {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: var(--theme-metadata-property-panel-title-color);
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.aca-details-breadcrumb {
|
||||
font-size: 18px;
|
||||
margin-left: 20px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
&-library {
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
&-item {
|
||||
font-weight: 100;
|
||||
&-icon {
|
||||
display: inline-block;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
}
|
||||
|
@@ -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';
|
||||
@@ -34,13 +34,15 @@ import { STORE_INITIAL_APP_DATA, SetSelectedNodesAction, NavigateToFolder } from
|
||||
import { NodeEntry, PathElement } from '@alfresco/js-api';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { AuthenticationService, PageTitleService } from '@alfresco/adf-core';
|
||||
import { BreadcrumbComponent, SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { BreadcrumbComponent, ContentService, SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
|
||||
describe('DetailsComponent', () => {
|
||||
let component: DetailsComponent;
|
||||
let fixture: ComponentFixture<DetailsComponent>;
|
||||
let contentApiService: ContentApiService;
|
||||
let contentService: ContentService;
|
||||
let store: Store;
|
||||
let node: NodeEntry;
|
||||
|
||||
@@ -50,6 +52,15 @@ describe('DetailsComponent', () => {
|
||||
select: () => mockStream
|
||||
};
|
||||
|
||||
const extensionsServiceMock = {
|
||||
getAllowedSidebarActions: jasmine.createSpy('getAllowedSidebarActions')
|
||||
};
|
||||
|
||||
const mockAspectActions: ContentActionRef[] = [];
|
||||
|
||||
const mockAspectActionsSubject$ = new BehaviorSubject(mockAspectActions);
|
||||
extensionsServiceMock.getAllowedSidebarActions.and.returnValue(mockAspectActionsSubject$.asObservable());
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, DetailsComponent],
|
||||
@@ -87,6 +98,7 @@ describe('DetailsComponent', () => {
|
||||
fixture = TestBed.createComponent(DetailsComponent);
|
||||
component = fixture.componentInstance;
|
||||
contentApiService = TestBed.inject(ContentApiService);
|
||||
contentService = TestBed.inject(ContentService);
|
||||
store = TestBed.inject(Store);
|
||||
|
||||
node = {
|
||||
@@ -140,4 +152,53 @@ describe('DetailsComponent', () => {
|
||||
fixture.detectChanges();
|
||||
expect(store.dispatch).toHaveBeenCalledWith(new SetSelectedNodesAction([node]));
|
||||
});
|
||||
|
||||
it('should set aspectActions from extensions', async () => {
|
||||
extensionsServiceMock.getAllowedSidebarActions.and.returnValue(of(mockAspectActions));
|
||||
fixture.detectChanges();
|
||||
await 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(contentService, 'getNodeIcon').and.returnValue(expectedIcon);
|
||||
fixture.detectChanges();
|
||||
component.ngOnInit();
|
||||
expect(contentService.getNodeIcon).toHaveBeenCalled();
|
||||
expect(component.nodeIcon).toContain(expectedIcon);
|
||||
});
|
||||
|
||||
it('should set aspectActions from extension mock', () => {
|
||||
const extensionMock = {
|
||||
getAllowedSidebarActions: () =>
|
||||
of([
|
||||
{
|
||||
id: 'app.sidebar.close',
|
||||
order: 100,
|
||||
title: 'close',
|
||||
icon: 'highlight_off'
|
||||
}
|
||||
])
|
||||
};
|
||||
|
||||
extensionsServiceMock.getAllowedSidebarActions.and.returnValue(of(extensionMock));
|
||||
fixture.detectChanges();
|
||||
fixture
|
||||
.whenStable()
|
||||
.then(() => {
|
||||
expect(component.aspectActions).toEqual([
|
||||
{
|
||||
id: 'app.sidebar.close',
|
||||
order: 100,
|
||||
title: 'close',
|
||||
icon: 'highlight_off'
|
||||
} as ContentActionRef
|
||||
]);
|
||||
})
|
||||
.catch((error) => {
|
||||
fail(`An error occurred: ${error}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -27,7 +27,7 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { ContentApiService, PageComponent, PageLayoutComponent, ToolbarComponent } from '@alfresco/aca-shared';
|
||||
import { NavigateToFolder, NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
||||
import { Subject } from 'rxjs';
|
||||
import { BreadcrumbModule, PermissionManagerModule } from '@alfresco/adf-content-services';
|
||||
import { BreadcrumbModule, ContentService, PermissionManagerModule } from '@alfresco/adf-content-services';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@@ -37,6 +37,8 @@ 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 { NodeEntry, PathElement } from '@alfresco/js-api';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@@ -64,8 +66,10 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy
|
||||
isLoading: boolean;
|
||||
onDestroy$ = new Subject<boolean>();
|
||||
activeTab = 1;
|
||||
aspectActions: Array<ContentActionRef> = [];
|
||||
nodeIcon: string;
|
||||
|
||||
constructor(private route: ActivatedRoute, private contentApi: ContentApiService) {
|
||||
constructor(private route: ActivatedRoute, private contentApi: ContentApiService, private contentService: ContentService) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -84,8 +88,15 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy
|
||||
this.node = node.entry;
|
||||
this.isLoading = false;
|
||||
this.store.dispatch(new SetSelectedNodesAction([{ entry: this.node }]));
|
||||
this.nodeIcon = this.contentService.getNodeIcon(this.node);
|
||||
});
|
||||
});
|
||||
this.extensions
|
||||
.getAllowedSidebarActions()
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe((aspectActions) => {
|
||||
this.aspectActions = aspectActions;
|
||||
});
|
||||
}
|
||||
|
||||
setActiveTab(tabName: string) {
|
||||
|
Reference in New Issue
Block a user