Skip to content
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

[dashboard] Additional fetch pinned workspace #4523

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.

## June 2021

- Fix active workspace list in dashboard (show also older pinned workspaces) ([#4523](https://github.com/gitpod-io/gitpod/pull/4523))
- Adding `ItemsList` component as a more maintainable and consistent way to render a list of workspaces, git integrations, environment variables, etc. ([#4454](https://github.com/gitpod-io/gitpod/pull/4454))
- Improve backup stability when pods get evicted ([#4405](https://github.com/gitpod-io/gitpod/pull/4405))
- Fix text color in workspaces list for dark theme ([#4410](https://github.com/gitpod-io/gitpod/pull/4410))
Expand Down
18 changes: 14 additions & 4 deletions components/dashboard/src/workspaces/workspace-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ export class WorkspaceModel implements Disposable, Partial<GitpodClient> {
limit: this.internalLimit
}).then( infos => {
this.updateMap(infos);
this.notifyWorkpaces();
// Additional fetch pinned workspaces
// see also: https://github.com/gitpod-io/gitpod/issues/4488
getGitpodService().server.getWorkspaces({
limit: this.internalLimit,
pinnedOnly: true,
}).then(infos => {
this.updateMap(infos);
this.notifyWorkpaces();
});
});
this.disposables.push(getGitpodService().registerClient(this));
}
Expand Down Expand Up @@ -121,12 +129,14 @@ export class WorkspaceModel implements Disposable, Partial<GitpodClient> {
infos = infos.sort((a,b) => {
return WorkspaceInfo.lastActiveISODate(b).localeCompare(WorkspaceInfo.lastActiveISODate(a));
});
this.setWorkspaces(infos);
this.setWorkspaces(infos.slice(0, this.internalLimit));
}

protected isActive(info: WorkspaceInfo): boolean {
return info.workspace.pinned ||
(!!info.latestInstance && !['stopping', 'stopped'].includes(info.latestInstance.status?.phase));
return (
info.workspace.pinned ||
(!!info.latestInstance && info.latestInstance.status?.phase !== 'stopped')
) && !info.workspace.softDeleted;
}

public getAllFetchedWorkspaces(): Map<string, WorkspaceInfo> {
Expand Down