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

Feature/817 - workspace folder icon callback + fix public workspace in my accounts #853

Merged
merged 3 commits into from
Dec 21, 2023
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
20 changes: 18 additions & 2 deletions applications/osb-portal/src/pages/UserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ export const UserPage = (props: any) => {
return
}

const openWorkspaceUrl = (workspaceId: number) => {
navigate(`/workspace/${workspaceId}`);
};

const canEdit =
currentUser && (currentUser.id === user.id || currentUser.isAdmin);
return (
Expand Down Expand Up @@ -723,7 +727,13 @@ export const UserPage = (props: any) => {
lg={4}
xl={3}
>
<WorkspaceCard workspace={ws} user={currentUser} />
<WorkspaceCard
workspace={ws}
user={currentUser}
handleWorkspaceClick={(workspace: Workspace) =>
openWorkspaceUrl(workspace.id)
}
/>
</Grid>
);
})}
Expand All @@ -744,7 +754,13 @@ export const UserPage = (props: any) => {
lg={4}
xl={3}
>
<WorkspaceCard workspace={ws} user={currentUser} />
<WorkspaceCard
workspace={ws}
user={currentUser}
handleWorkspaceClick={(workspace: Workspace) =>
openWorkspaceUrl(workspace.id)
}
/>
</Grid>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ def filter_by_user_and_fieldkey(self, filter, user_id, show_all, q_base):
else:
# No logged in user, show only public (in case was not specified)
q_base = q_base.filter(WorkspaceEntity.publicable == True)

# if filter has user_id, then filter it with the user_id
if filter and any(field for field, condition, value in filter if field.key == "user_id"):
q_base = q_base.filter(
*[self._create_filter(*f) for f in filter if (f[0].key == "user_id")])
return q_base

def filter_by_tags(self, tags, q_base):
Expand Down
Loading