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-5645] Property Panel Feature #3477

Merged
merged 77 commits into from
Dec 27, 2023
Merged

Conversation

AnukritiGL
Copy link
Contributor

@AnukritiGL AnukritiGL commented Oct 13, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)
In the property panel, there is an aspect icon at the bottom.
The design of the Property Panel appears outdated, and the title in the InfoDrawer is generic, labeled as "Details."

What is the new behaviour?
The Property Panel design has been revamped for both small and large screens. Additionally, the InfoDrawer now displays file titles with accompanying icons instead of the generic label "Details."
In accordance with the design, we removed the footer of the property panel and moved the edit aspect icon to the top.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:
https://alfresco.atlassian.net/browse/ACS-5645

Based on requirements, updated the below points:

Title and Icon in property Panel: In the collapsed and expanded mode now displays file titles with accompanying icons instead of the generic label "Details."

Edit and Clear Button: As per design edit and clear button has been removed from the property panel fields.
Improved Styles: Worked on the styles of property panel. Panels now have a more appealing look, tailored to match figma design.

Dependent PR's
ADF: Alfresco/alfresco-ng2-components#8995
ADW: https://github.com/Alfresco/alfresco-applications/pull/459

ui-property.webm

@MichalKinas
Copy link
Contributor

Please fix the circular dependency build issue as without it this PR and ADF part cannot be tested by reviewers

@AnukritiGL AnukritiGL force-pushed the ACS-5645-property-panel-feature branch from c0aa651 to 646175b Compare October 17, 2023 13:53
@AnukritiGL
Copy link
Contributor Author

Please fix the circular dependency build issue as without it this PR and ADF part cannot be tested by reviewers

I have fixed the circular dependency issue.

@AnukritiGL
Copy link
Contributor Author

Build is passing locally after adding core and content-services from ADF

image

@AnukritiGL AnukritiGL force-pushed the ACS-5645-property-panel-feature branch 2 times, most recently from fa76268 to 969ee6b Compare October 19, 2023 09:40
@rbahirsheth rbahirsheth marked this pull request as ready for review October 19, 2023 14:38
@rbahirsheth rbahirsheth requested a review from eromano as a code owner October 19, 2023 14:38
@DenysVuika DenysVuika self-assigned this Oct 21, 2023
@@ -76,7 +81,13 @@ $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,
Copy link
Contributor

Choose a reason for hiding this comment

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

this is already in the ADF, should not be redefining here

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

@@ -36,6 +36,11 @@ $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);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is already defined in ADF

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

@@ -361,4 +361,50 @@ export class ContentApiService {
requestVersionDirectAccessUrl(nodeId: string, versionId: string): Observable<DirectAccessUrlEntry> {
return from(this.versionsApi.requestDirectAccessUrl(nodeId, versionId));
}

getNodeIcon(node: Node): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

this whole method is a wrapper for thumbnail service, it should be moved to thumbnail service instead

Copy link
Contributor

Choose a reason for hiding this comment

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

Done.

@@ -111,6 +105,6 @@ export class MetadataTabComponent implements OnInit, OnDestroy {
}

private checkIfNodeIsUpdatable(node: Node) {
this.canUpdateNode = node && !isLocked({ entry: node }) ? this.permission.check(node, ['update']) : false;
this.readOnly = !(node && !isLocked({ entry: node }) ? this.permission.check(node, ['update']) : false);
Copy link
Contributor

Choose a reason for hiding this comment

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

should be moved to metadata component where it checks for allowable operations

Copy link
Contributor

Choose a reason for hiding this comment

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

Denys has changed this code. Not getting where should we move this exactly.

border-radius: 4px;
margin-top: 12px;

&:focus-visible {
Copy link
Contributor

Choose a reason for hiding this comment

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

nested focus-visible is strange, what is it for?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done.

class="aca-close-details-button"
mat-icon-button
data-automation-id="close-library"
title="{{ 'APP.INFO_DRAWER.REDUCE_PANEL' | translate }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure that this button title should say reduce panel? In fact it's closing the panel so it sounds misleading

Copy link
Contributor

@rbahirsheth rbahirsheth Nov 29, 2023

Choose a reason for hiding this comment

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

@MichalKinas
Shane suggested the title should be 'Reduce Panel' so that we use the key with the same name.
Either we can change the key and keep the value same as Shane suggested. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

If that title is fine with Shane it's okay for me as well

getAllowedSidebarActions: jasmine.createSpy('getAllowedSidebarActions')
};

const mockAspectActions = [];
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 add the type here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done


const mockAspectActions = [];

const mockObservable = new BehaviorSubject(mockAspectActions);
Copy link
Contributor

Choose a reason for hiding this comment

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

Name of this variable doesn't sound correct, is suggests observable but in fact you're assigning the subject

Copy link
Contributor

Choose a reason for hiding this comment

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

Also should not name be finished with $ as it is Subject?

Copy link
Contributor

Choose a reason for hiding this comment

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

Changed.

const mockAspectActions = [];

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

Choose a reason for hiding this comment

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

Are you sure this is correct? getAllowedSidebarActions expects Observable<Array<ContentActionRef>> instead of a subject

Copy link
Contributor

Choose a reason for hiding this comment

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

Updated.

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

const mockNode = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you use all mocked properties? Also I think we should we use mocked node ids not real ones

Copy link
Contributor

Choose a reason for hiding this comment

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

Updated.

@@ -511,6 +511,16 @@ export const canEditAspects = (context: RuleContext): boolean =>
repository.isMajorVersionAvailable(context, '7')
].every(Boolean);

export const editAspects = (context: RuleContext): boolean =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that unit tested?

Copy link
Contributor

Choose a reason for hiding this comment

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

Added unit test case.

@@ -57,6 +57,38 @@ describe('InfoDrawerComponent', () => {
])
};

const mockNode = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for node ids and usage of defined properties

Copy link
Contributor

Choose a reason for hiding this comment

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

Updated.

let thumbnailService: ThumbnailService;
let service: any;

const mockNode = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for mocked node

Copy link
Contributor

Choose a reason for hiding this comment

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

done


describe('Info Drawer header Icon', () => {
let thumbnailService: ThumbnailService;
let service: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why any here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

});

it('should resolve fallback file icon for unknown node', () => {
spyOn(thumbnailService, 'getDefaultMimeTypeIcon').and.returnValue(`assets/images/ft_ic_miscellaneous.svg`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it use testNodeIcon as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

@AnukritiGL AnukritiGL force-pushed the ACS-5645-property-panel-feature branch from dddb6ec to a31664e Compare December 26, 2023 06:35
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@AnukritiGL AnukritiGL merged commit 90c69b2 into develop Dec 27, 2023
25 checks passed
@AnukritiGL AnukritiGL deleted the ACS-5645-property-panel-feature branch December 27, 2023 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants