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-5540] Moved Aspects icons top of properties panel #3414

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 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
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
7 changes: 4 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,15 @@
},
"INFO_DRAWER": {
"TITLE": "Details",
"CLOSE": "Close",
"REDUCE_PANEL": "Reduce panel",
"DATA_LOADING": "Data is loading",
"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 @@ -12,14 +12,17 @@
-
<span class="acs-details-breadcrumb-item">{{ 'APP.INFO_DRAWER.TITLE' | translate }}</span>
</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 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>
</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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Some focus styling are not working as expected
Zrzut ekranu 2023-09-29 o 12 04 21
Zrzut ekranu 2023-09-29 o 12 04 36
Zrzut ekranu 2023-09-29 o 12 04 51

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for close and save buttons for each section

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have fixed the focus issue.

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 Down
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,15 @@ describe('DetailsComponent', () => {
select: () => mockStream
};

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

const mockAspectActions = [];

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

beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule, DetailsComponent],
Expand Down Expand Up @@ -128,4 +137,12 @@ 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);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ 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';

@Component({
standalone: true,
Expand Down Expand Up @@ -63,6 +65,7 @@ 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) {
super();
Expand All @@ -85,6 +88,12 @@ 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;
});
}

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 = {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you avoid using any?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will update this once ADF upstream PR merges.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok please correct it after ADF upstream PR is merged and before you merge that ACA PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { Store } from '@ngrx/store';
import { NodeEntry } from '@alfresco/js-api';
import { DownloadNodesAction, EditOfflineAction, SnackbarErrorAction } from '@alfresco/aca-shared/store';
import { AppTestingModule } from '../../../testing/app-testing.module';
import { AppExtensionService } from '@alfresco/aca-shared';

describe('ToggleEditOfflineComponent', () => {
let fixture: ComponentFixture<ToggleEditOfflineComponent>;
Expand All @@ -38,6 +39,10 @@ describe('ToggleEditOfflineComponent', () => {
let selectSpy: jasmine.Spy;
let selection: any;

const extensionsMock = {
updateSidebarActions: jasmine.createSpy('updateSidebarActions')
};

beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppTestingModule, ToggleEditOfflineComponent],
Expand All @@ -48,6 +53,10 @@ describe('ToggleEditOfflineComponent', () => {
select: () => {},
dispatch: () => {}
}
},
{
provide: AppExtensionService,
useValue: extensionsMock
}
]
});
Expand Down Expand Up @@ -133,4 +142,14 @@ describe('ToggleEditOfflineComponent', () => {
})
]);
});

it('should call updateSidebarActions on click', async () => {
selectSpy.and.returnValue(of(selection));
fixture.detectChanges();

await component.onClick();
fixture.detectChanges();

expect(extensionsMock.updateSidebarActions).toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import { NodeEntry, SharedLinkEntry, Node, NodesApi } from '@alfresco/js-api';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Store } from '@ngrx/store';
import { isLocked } from '@alfresco/aca-shared';
import { AppExtensionService, isLocked } from '@alfresco/aca-shared';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
Expand All @@ -59,7 +59,7 @@ export class ToggleEditOfflineComponent implements OnInit {
nodeTitle = '';
isNodeLocked = false;

constructor(private store: Store<AppStore>, private alfrescoApiService: AlfrescoApiService) {
constructor(private store: Store<AppStore>, private alfrescoApiService: AlfrescoApiService, private extensions: AppExtensionService) {
this.nodesApi = new NodesApi(this.alfrescoApiService.getInstance());
}

Expand All @@ -73,6 +73,7 @@ export class ToggleEditOfflineComponent implements OnInit {

async onClick() {
await this.toggleLock(this.selection);
this.extensions.updateSidebarActions();
}

private async toggleLock(node: NodeEntry | SharedLinkEntry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,34 @@
}
}
}

.adf-info-drawer-layout-content .app-metadata-tab .adf-metadata-properties .mat-expansion-panel {
border: 1px solid var(--theme-metadata-property-panel-border-color);
border-radius: 12px;
margin-bottom: 12px;

.mat-expansion-panel-header {
border-radius: 12px;
}
}

.acs-details-container {
.mat-tab-body-content {
.adf-metadata-properties {
.mat-expansion-panel {
width: 755px;
border: 1px solid var(--theme-metadata-property-panel-border-color);
margin: 24px;
border-radius: 12px;

.mat-expansion-panel-header {
border-radius: 12px;
}

.adf-metadata-properties-group-title {
width: 548px;
}
}
}
}
}
8 changes: 7 additions & 1 deletion projects/aca-content/src/lib/ui/variables/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ $page-layout-header-background-color: #fff;
$search-chip-icon-color: #757575;
$disabled-chip-background-color: #f5f5f5;
$contrast-gray: #646569;
$metadata-property-panel-border-color: rgba(0, 0, 0, 0.12);
$metadata-buttons-background-color: rgba(33, 33, 33, 0.05);
$metadata-action-button-clear-color: #212328b2;

// CSS Variables
$defaults: (
Expand Down Expand Up @@ -76,7 +79,10 @@ $defaults: (
--theme-page-layout-header-background-color: $page-layout-header-background-color,
--theme-search-chip-icon-color: $search-chip-icon-color,
--theme-disabled-chip-background-color: $disabled-chip-background-color,
--theme-contrast-gray: $contrast-gray
--theme-contrast-gray: $contrast-gray,
--theme-metadata-property-panel-border-color: $metadata-property-panel-border-color,
--theme-metadata-buttons-background-color: $metadata-buttons-background-color,
--theme-metadata-action-button-clear-color: $metadata-action-button-clear-color
);

// propagates SCSS variables into the CSS variables scope
Expand Down
Loading
Loading