@@ -6,13 +6,11 @@ import { Button } from 'primeng/button';
66import { Menu } from 'primeng/menu' ;
77import { Skeleton } from 'primeng/skeleton' ;
88
9- import { ChangeDetectionStrategy , Component , computed , inject , input } from '@angular/core' ;
9+ import { ChangeDetectionStrategy , Component , inject , input } from '@angular/core' ;
1010import { Router } from '@angular/router' ;
1111
12- import { UserSelectors } from '@core/store/user' ;
1312import { ContributorsListComponent , IconComponent , TruncatedTextComponent } from '@osf/shared/components' ;
1413import { ResourceType , UserPermissions } from '@osf/shared/enums' ;
15- import { hasViewOnlyParam } from '@osf/shared/helpers' ;
1614import { CustomDialogService , LoaderService } from '@osf/shared/services' ;
1715import { GetResourceWithChildren } from '@osf/shared/stores' ;
1816import { ComponentOverview } from '@shared/models' ;
@@ -36,16 +34,13 @@ export class OverviewComponentsComponent {
3634 canEdit = input . required < boolean > ( ) ;
3735 anonymous = input < boolean > ( false ) ;
3836
39- currentUser = select ( UserSelectors . getCurrentUser ) ;
40- currentUserId = computed ( ( ) => this . currentUser ( ) ?. id ) ;
4137 components = select ( ProjectOverviewSelectors . getComponents ) ;
4238 isComponentsLoading = select ( ProjectOverviewSelectors . getComponentsLoading ) ;
4339 project = select ( ProjectOverviewSelectors . getProject ) ;
44- hasViewOnly = computed ( ( ) => hasViewOnlyParam ( this . router ) ) ;
4540
46- actions = createDispatchMap ( {
47- getComponentsTree : GetResourceWithChildren ,
48- } ) ;
41+ actions = createDispatchMap ( { getComponentsTree : GetResourceWithChildren } ) ;
42+
43+ readonly UserPermissions = UserPermissions ;
4944
5045 readonly componentActionItems = ( component : ComponentOverview ) => {
5146 const baseItems = [
@@ -71,14 +66,6 @@ export class OverviewComponentsComponent {
7166
7267 return baseItems ;
7368 } ;
74- readonly UserPermissions = UserPermissions ;
75-
76- get isCurrentUserContributor ( ) {
77- return ( component : ComponentOverview ) => {
78- const userId = this . currentUserId ( ) ;
79- return userId ? component . contributors . some ( ( contributor ) => contributor . userId === userId ) : false ;
80- } ;
81- }
8269
8370 handleMenuAction ( action : string , componentId : string ) : void {
8471 switch ( action ) {
0 commit comments