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] Work streams admin UI #12483

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion api/app/Policies/WorkStreamPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function viewAny(?User $user): bool
*/
public function view(?User $user, WorkStream $workStream): bool
{
return false;
return true;
}

/**
Expand Down
1 change: 1 addition & 0 deletions api/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@ type Query {
team(id: UUID! @eq): Team @find @canQuery(ability: "view")
teams: [Team]! @all @canModel(ability: "viewAny")
roles: [Role]! @all @canModel(ability: "viewAny")
workStream(id: UUID! @eq): WorkStream @find @canQuery(ability: "view")
workStreams: [WorkStream]! @all @canModel(ability: "viewAny")

notifications(
Expand Down
1 change: 1 addition & 0 deletions api/storage/app/lighthouse-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ type Query {
team(id: UUID!): Team
teams: [Team]!
roles: [Role]!
workStream(id: UUID!): WorkStream
workStreams: [WorkStream]!
sitewideAnnouncement: SitewideAnnouncement
trainingOpportunity(id: UUID!): TrainingOpportunity
Expand Down
34 changes: 34 additions & 0 deletions apps/web/src/components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,40 @@ const createRoute = (locale: Locales) =>
lazy: () =>
import("../pages/AnnouncementsPage/AnnouncementsPage"),
},
{
path: "work-streams",
children: [
{
index: true,
lazy: () =>
import("../pages/WorkStreams/IndexWorkStreamPage"),
},
{
path: "create",
lazy: () =>
import("../pages/WorkStreams/CreateWorkStreamPage"),
},
{
path: ":workStreamId",
children: [
{
index: true,
lazy: () =>
import(
"../pages/WorkStreams/ViewWorkStreamsPage"
),
},
{
path: "edit",
lazy: () =>
import(
"../pages/WorkStreams/UpdateWorkStreamPage"
),
},
],
},
],
},
],
},
{
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/hooks/useRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ const getRoutes = (lang: Locales) => {
"/",
),

// Admin - Work Streams
workStreamTable: () => [adminUrl, "settings", "work-streams"].join("/"),
workStreamCreate: () =>
[adminUrl, "settings", "work-streams", "create"].join("/"),
workStreamView: (id: string) => `${adminUrl}/settings/work-streams/${id}`,
workStreamUpdate: (workStreamId: string) =>
[adminUrl, "settings", "work-streams", workStreamId, "edit"].join("/"),

/**
* Deprecated
*
Expand Down
5 changes: 5 additions & 0 deletions apps/web/src/messages/pageTitles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@ export default defineMessages({
description:
"Title for the page showing list of job advertisement templates",
},
workStreams: {
defaultMessage: "Work streams",
id: "uK9/a4",
description: "Title for the index work streams page",
},
});
5 changes: 5 additions & 0 deletions apps/web/src/pages/AdminDashboardPage/AdminDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ export const DashboardPage = ({ currentUser }: DashboardPageProps) => {
ROLE_NAME.PlatformAdmin,
],
},
{
label: intl.formatMessage(pageTitles.workStreams),
href: adminRoutes.workStreamTable(),
roles: [ROLE_NAME.PlatformAdmin],
},
];
const administrationCollectionFiltered = administrationCollection.filter(
(item) => hasRolesHandleNoRolesRequired(item.roles, roleAssignments),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ export const DashboardPage = ({ currentUser }: DashboardPageProps) => {
ROLE_NAME.PlatformAdmin,
],
},
{
label: intl.formatMessage(pageTitles.workStreams),
href: adminRoutes.workStreamTable(),
roles: [ROLE_NAME.PlatformAdmin],
},
];
const administrationCollectionFiltered = administrationCollection.filter(
(item) => hasRolesHandleNoRolesRequired(item.roles, roleAssignments),
Expand Down
Loading
Loading