File tree Expand file tree Collapse file tree
src/custom/Workspaces/hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,13 +14,15 @@ interface useDesignAssignmentProps {
1414 useGetDesignsOfWorkspaceQuery : any ;
1515 useAssignDesignToWorkspaceMutation : any ;
1616 useUnassignDesignFromWorkspaceMutation : any ;
17+ isDesignsVisible ?: boolean ;
1718}
1819
1920const useDesignAssignment = ( {
2021 workspaceId,
2122 useGetDesignsOfWorkspaceQuery,
2223 useAssignDesignToWorkspaceMutation,
23- useUnassignDesignFromWorkspaceMutation
24+ useUnassignDesignFromWorkspaceMutation,
25+ isDesignsVisible
2426} : useDesignAssignmentProps ) : AssignmentHookResult < Pattern > => {
2527 const [ designsPage , setDesignsPage ] = useState < number > ( 0 ) ;
2628 const [ designsData , setDesignsData ] = useState < Pattern [ ] > ( [ ] ) ;
@@ -40,7 +42,7 @@ const useDesignAssignment = ({
4042 filter : '{"assigned":false}'
4143 } ) ,
4244 {
43- skip : skipDesigns
45+ skip : skipDesigns || ! isDesignsVisible
4446 }
4547 ) ;
4648
@@ -51,7 +53,7 @@ const useDesignAssignment = ({
5153 pagesize : designsPageSize
5254 } ) ,
5355 {
54- skip : skipDesigns
56+ skip : skipDesigns || ! isDesignsVisible
5557 }
5658 ) ;
5759
Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ interface UseEnvironmentAssignmentProps {
88 useGetEnvironmentsOfWorkspaceQuery : any ;
99 useAssignEnvironmentToWorkspaceMutation : any ;
1010 useUnassignEnvironmentFromWorkspaceMutation : any ;
11+ isEnvironmentsVisible ?: boolean ;
1112}
1213
1314const useEnvironmentAssignment = ( {
1415 workspaceId,
1516 useGetEnvironmentsOfWorkspaceQuery,
1617 useAssignEnvironmentToWorkspaceMutation,
17- useUnassignEnvironmentFromWorkspaceMutation
18+ useUnassignEnvironmentFromWorkspaceMutation,
19+ isEnvironmentsVisible
1820} : UseEnvironmentAssignmentProps ) : AssignmentHookResult < Environment > => {
1921 const [ environmentsPage , setEnvironmentsPage ] = useState < number > ( 0 ) ;
2022 const [ environmentsData , setEnvironmentsData ] = useState < Environment [ ] > ( [ ] ) ;
@@ -34,7 +36,7 @@ const useEnvironmentAssignment = ({
3436 filter : '{"assigned":false}'
3537 } ) ,
3638 {
37- skip : skipEnvironments
39+ skip : skipEnvironments || ! isEnvironmentsVisible
3840 }
3941 ) ;
4042
@@ -45,7 +47,7 @@ const useEnvironmentAssignment = ({
4547 pagesize : environmentsPageSize
4648 } ) ,
4749 {
48- skip : skipEnvironments
50+ skip : skipEnvironments || ! isEnvironmentsVisible
4951 }
5052 ) ;
5153
Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ interface UseTeamAssignmentProps {
88 useGetTeamsOfWorkspaceQuery : any ;
99 useAssignTeamToWorkspaceMutation : any ;
1010 useUnassignTeamFromWorkspaceMutation : any ;
11+ isTeamsVisible ?: boolean ;
1112}
1213
1314const useTeamAssignment = ( {
1415 workspaceId,
1516 useGetTeamsOfWorkspaceQuery,
1617 useAssignTeamToWorkspaceMutation,
17- useUnassignTeamFromWorkspaceMutation
18+ useUnassignTeamFromWorkspaceMutation,
19+ isTeamsVisible
1820} : UseTeamAssignmentProps ) : AssignmentHookResult < Team > => {
1921 const [ teamsPage , setTeamsPage ] = useState < number > ( 0 ) ;
2022 const [ teamsData , setTeamsData ] = useState < Team [ ] > ( [ ] ) ;
@@ -36,7 +38,7 @@ const useTeamAssignment = ({
3638 filter : '{"assigned":false}'
3739 } ) ,
3840 {
39- skip : skipTeams
41+ skip : skipTeams || ! isTeamsVisible
4042 }
4143 ) ;
4244
@@ -47,7 +49,7 @@ const useTeamAssignment = ({
4749 pagesize : teamsPageSize
4850 } ) ,
4951 {
50- skip : skipTeams
52+ skip : skipTeams || ! isTeamsVisible
5153 }
5254 ) ;
5355
Original file line number Diff line number Diff line change @@ -14,13 +14,15 @@ interface useViewAssignmentProps {
1414 useGetViewsOfWorkspaceQuery : any ;
1515 useAssignViewToWorkspaceMutation : any ;
1616 useUnassignViewFromWorkspaceMutation : any ;
17+ isEnvironmentsVisible ?: boolean ;
1718}
1819
1920const useViewAssignment = ( {
2021 workspaceId,
2122 useGetViewsOfWorkspaceQuery,
2223 useAssignViewToWorkspaceMutation,
23- useUnassignViewFromWorkspaceMutation
24+ useUnassignViewFromWorkspaceMutation,
25+ isEnvironmentsVisible
2426} : useViewAssignmentProps ) : AssignmentHookResult < Pattern > => {
2527 const [ viewsPage , setviewsPage ] = useState < number > ( 0 ) ;
2628 const [ viewsData , setviewsData ] = useState < Pattern [ ] > ( [ ] ) ;
@@ -40,7 +42,7 @@ const useViewAssignment = ({
4042 filter : '{"assigned":false}'
4143 } ) ,
4244 {
43- skip : skipviews
45+ skip : skipviews || ! isEnvironmentsVisible
4446 }
4547 ) ;
4648
@@ -51,7 +53,7 @@ const useViewAssignment = ({
5153 pagesize : viewsPageSize
5254 } ) ,
5355 {
54- skip : skipviews
56+ skip : skipviews || ! isEnvironmentsVisible
5557 }
5658 ) ;
5759
You can’t perform that action at this time.
0 commit comments