[ACS-9158] Remove 'View Details' button from node Details page (#4351)

* [ACS-9158] Remove 'View Details' button from node Details page

* [ACS-9158] remove redundant onDestroy$

* cr fix
This commit is contained in:
Mykyta Maliarchuk
2025-02-21 14:53:22 +01:00
committed by GitHub
parent c799049790
commit 4751dcd12c
8 changed files with 43 additions and 70 deletions

View File

@@ -1412,16 +1412,19 @@ describe('app.evaluators', () => {
expect(app.canShowInfoDrawer(context)).toBeFalse();
});
it('should return false when user is in libraries or trashcan', () => {
it('should return false when user is in libraries or trashcan or details', () => {
context.selection.isEmpty = false;
context.navigation.url = '/trashcan/test';
expect(app.canShowInfoDrawer(context)).toBeFalse();
context.navigation.url = '/test/libraries';
expect(app.canShowInfoDrawer(context)).toBeFalse();
context.navigation.url = '/test/details';
expect(app.canShowInfoDrawer(context)).toBeFalse();
});
it('should return true when selection exists and user is not in trashcan or libraries', () => {
it('should return true when selection exists and user is not in trashcan, libraries or details', () => {
context.navigation.url = '/personal-files/test';
context.selection.isEmpty = false;
expect(app.canShowInfoDrawer(context)).toBeTrue();

View File

@@ -247,6 +247,28 @@ describe('navigation.evaluators', () => {
});
});
describe('isNotDetails', () => {
it('should return true if url does not include `/details`', () => {
const context: any = {
navigation: {
url: '/path'
}
};
expect(app.isNotDetails(context)).toBe(true);
});
it('should return false if url includes `/details`', () => {
const context: any = {
navigation: {
url: 'personal-files/details/path'
}
};
expect(app.isNotDetails(context)).toBe(false);
});
});
describe('isRecentFiles', () => {
it('should return [true] if url starts with `/recent-files`', () => {
const context: any = {

View File

@@ -115,6 +115,12 @@ export function isDetails(context: RuleContext): boolean {
return url?.includes('/details');
}
/**
* Checks if the activated route is not **Details**.
* JSON ref: `app.navigation.isNotDetails`
*/
export const isNotDetails = (context: RuleContext): boolean => !isDetails(context);
/**
* Checks if the activated route is neither **Libraries** nor **Library Search Results**.
* JSON ref: `app.navigation.isNotLibraries`