Skip to content

Commit

Permalink
Remove workspacesEnabledSubscription
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
Hailong-am committed Oct 18, 2023
1 parent dcb3a60 commit 7de3949
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/core/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export {
StringValidationRegex,
StringValidationRegexString,
WorkspaceObject,
WorkspaceAttribute,
} from '../types';

export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export class SavedObjectsTable extends Component<SavedObjectsTableProps, SavedOb
private _isMounted = false;
private currentWorkspaceIdSubscription?: Subscription;
private workspacesSubscription?: Subscription;
private workspacesEnabledSubscription?: Subscription;

constructor(props: SavedObjectsTableProps) {
super(props);
Expand Down Expand Up @@ -230,7 +229,6 @@ export class SavedObjectsTable extends Component<SavedObjectsTableProps, SavedOb
this.debouncedFetchObjects.cancel();
this.currentWorkspaceIdSubscription?.unsubscribe();
this.workspacesSubscription?.unsubscribe();
this.workspacesEnabledSubscription?.unsubscribe();
}

fetchCounts = async () => {
Expand Down Expand Up @@ -877,7 +875,7 @@ export class SavedObjectsTable extends Component<SavedObjectsTableProps, SavedOb
filteredItemCount,
isSearching,
savedObjectCounts,
availableWorkspaces: availableWorkspace,
availableWorkspaces,
workspaceEnabled,
currentWorkspaceId: workspaceId,
} = this.state;
Expand Down Expand Up @@ -931,9 +929,9 @@ export class SavedObjectsTable extends Component<SavedObjectsTableProps, SavedOb
}

// Add workspace filter
if (workspaceEnabled && availableWorkspace?.length) {
if (workspaceEnabled && availableWorkspaces?.length) {
const wsCounts = savedObjectCounts.workspaces || {};
const wsFilterOptions = availableWorkspace
const wsFilterOptions = availableWorkspaces
.filter((ws) => {
return this.workspaceIdQuery?.includes(ws.id);
})
Expand Down Expand Up @@ -1000,7 +998,7 @@ export class SavedObjectsTable extends Component<SavedObjectsTableProps, SavedOb
onShowRelationships={this.onShowRelationships}
canGoInApp={this.props.canGoInApp}
dateFormat={this.props.dateFormat}
availableWorkspaces={this.state.availableWorkspaces}
availableWorkspaces={availableWorkspaces}
/>
</RedirectAppLinks>
</EuiPageContent>
Expand Down

0 comments on commit 7de3949

Please sign in to comment.