-
Notifications
You must be signed in to change notification settings - Fork 150
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-5133] view details button is inactive in expanded view #3603
Changes from 4 commits
dab77bd
dd21933
14daeaa
737f6ba
4a346a8
11e292b
581b94d
f435a55
cc91475
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,10 @@ | |
*/ | ||
|
||
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { ActivatedRoute, NavigationStart } 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 { merge, Subject } from 'rxjs'; | ||
import { BreadcrumbModule, ContentService, PermissionManagerModule } from '@alfresco/adf-content-services'; | ||
import { CommonModule } from '@angular/common'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
|
@@ -37,7 +37,7 @@ 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 { filter, first, takeUntil } from 'rxjs/operators'; | ||
import { ContentActionRef } from '@alfresco/adf-extensions'; | ||
|
||
@Component({ | ||
|
@@ -99,6 +99,22 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy | |
.subscribe((aspectActions) => { | ||
this.aspectActions = aspectActions; | ||
}); | ||
this.infoDrawerOpened$ | ||
.pipe( | ||
filter((opened) => !opened), | ||
first(), | ||
takeUntil( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that you don't need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes but what in case if somebody will exit page before any value will be emitted? Then first won't be executed but still we would need to cancel subscription There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right good point since |
||
merge( | ||
this.onDestroy$, | ||
this.router.events.pipe( | ||
filter((event) => event instanceof NavigationStart), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same points here for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same answer like above |
||
first(), | ||
takeUntil(this.onDestroy$) | ||
) | ||
) | ||
) | ||
) | ||
.subscribe(() => this.goBack()); | ||
} | ||
|
||
setActiveTab(tabName: string) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
|
||
import { Actions, ofType, createEffect } from '@ngrx/effects'; | ||
import { Injectable } from '@angular/core'; | ||
import { map, take } from 'rxjs/operators'; | ||
import { filter, first, map, take } from 'rxjs/operators'; | ||
import { Store } from '@ngrx/store'; | ||
import { | ||
AppStore, | ||
|
@@ -50,12 +50,12 @@ import { | |
ExpandInfoDrawerAction, | ||
ManageRulesAction, | ||
ShowLoaderAction, | ||
ToggleInfoDrawerAction, | ||
SetInfoDrawerStateAction, | ||
NavigateUrlAction | ||
} from '@alfresco/aca-shared/store'; | ||
import { ContentManagementService } from '../../services/content-management.service'; | ||
import { RenditionService } from '@alfresco/adf-content-services'; | ||
import { Router } from '@angular/router'; | ||
import { NavigationEnd, Router } from '@angular/router'; | ||
|
||
@Injectable() | ||
export class NodeEffects { | ||
|
@@ -308,6 +308,12 @@ export class NodeEffects { | |
this.actions$.pipe( | ||
ofType<ExpandInfoDrawerAction>(NodeActionTypes.ExpandInfoDrawer), | ||
map((action) => { | ||
this.router.events | ||
.pipe( | ||
filter((event) => event instanceof NavigationEnd), | ||
first() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you don't have to use filter, in this case you could with something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point, done |
||
) | ||
.subscribe(() => this.store.dispatch(new SetInfoDrawerStateAction(true))); | ||
if (action?.payload) { | ||
const route = 'personal-files/details'; | ||
this.router.navigate([route, action.payload.entry.id], { | ||
|
@@ -330,7 +336,6 @@ export class NodeEffects { | |
} | ||
}); | ||
} | ||
this.store.dispatch(new ToggleInfoDrawerAction()); | ||
}) | ||
), | ||
{ dispatch: false } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, you can use only
first
to filterThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done