Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
216b93a
Create @apps/ui-staff bootstrap app and compose initial staff route p…
Apr 22, 2026
ccd8d38
fix build issue
Apr 22, 2026
1787b54
feat: add ui-staff route packages with basic structure and vitest con…
ttrang-nguyen Apr 22, 2026
f7e70f9
feat(ui-staff): update routing and authentication structure
ttrang-nguyen Apr 23, 2026
2c50239
add pnpm-lock.yaml
ttrang-nguyen Apr 23, 2026
cfa2563
feat: add uuid dependency to package.json and update pnpm-lock.yaml
ttrang-nguyen Apr 23, 2026
d92e935
feat: add AuthLanding component for navigation and Apollo client setup
ttrang-nguyen Apr 23, 2026
9256b16
fix: update ApolloConnectionProps interface
ttrang-nguyen Apr 23, 2026
cb0f452
Update Snyk ignore rules for UUID and adjust package versions for com…
ttrang-nguyen Apr 24, 2026
e7d8ae1
update snyke ignore
ttrang-nguyen Apr 24, 2026
19531b8
update layout and styling in ThemeProvider component
ttrang-nguyen Apr 27, 2026
c8d30de
fix: update dev script to use correct localhost domain
ttrang-nguyen Apr 27, 2026
2355bed
merge from main and resolve merge issue
ttrang-nguyen Apr 27, 2026
3385ed1
feat: integrate StaffAuthProvider for user identity management
ttrang-nguyen Apr 28, 2026
0a7817f
update OIDC configuration and add mock data for staff authentication
ttrang-nguyen Apr 29, 2026
0095df3
feat: implement login page and update routing for authentication
Apr 29, 2026
99e0148
fix merge conflicts
ttrang-nguyen Apr 29, 2026
7124050
fix build issue
ttrang-nguyen Apr 29, 2026
daac62c
chore: update TypeScript to 6.0.3 and add native-preview package; mod…
Apr 29, 2026
cdcdab1
chore: update TypeScript version to 6.0.3 in pnpm-lock.yaml
Apr 29, 2026
be5783e
refine login page and add logout functionality
ttrang-nguyen Apr 29, 2026
d01e0fc
Merge branch 'rohit-r-kumar/issue212' of github.com:CellixJs/cellixjs…
ttrang-nguyen Apr 29, 2026
49f66f8
remove dist files
ttrang-nguyen Apr 29, 2026
37ad0c1
refactor: restructure authentication flow and remove login page compo…
Apr 29, 2026
e6c5e31
remove .env from .gitignore
ttrang-nguyen Apr 29, 2026
78d2ac3
refactor: update build scripts to use tsgo and improve code formatting
ttrang-nguyen Apr 30, 2026
280a381
refactor: update package.json scripts and remove unused dependencies
Apr 30, 2026
7a40958
refactor: update entry points and project patterns in knip.json and p…
Apr 30, 2026
47c125e
refactor: remove unused dependencies from pnpm-lock.yaml
Apr 30, 2026
c204df3
fix: correct token property name in ThemeProvider and adjust children…
ttrang-nguyen Apr 30, 2026
fedc557
fix: correct typo in OIDCConfig type and instance from 'noonce' to 'n…
ttrang-nguyen Apr 30, 2026
29cdc6f
refactor: update environment variable references and improve type def…
ttrang-nguyen Apr 30, 2026
ba59183
format
ttrang-nguyen Apr 30, 2026
a67eb06
feat: integrate react-oidc-context for authentication in header compo…
ttrang-nguyen Apr 30, 2026
b4a3b77
Changes before error encountered
Copilot Apr 30, 2026
13b4897
test: add unit tests for resolver-builder module and mergeResolvers f…
May 1, 2026
93df96e
Renaming: ui-community-route-shared -> ui-community-shared
May 1, 2026
7767f71
fix: rename ui-community-route-shared to ui-community-shared in knip.…
May 1, 2026
8912120
fix: correct Biome formatting in resolver-builder.test.ts
Copilot May 1, 2026
27cb61e
feat(ui-staff): add Entra app-role route authorization (#214)
May 1, 2026
54d2f83
Merge branch 'main' of https://github.com/CellixJs/cellixjs into rohi…
May 4, 2026
ac69b4e
test(ui-staff): add route-authorization scenario tests for all 4 Entr…
May 4, 2026
440c022
chore(ui-staff-routes): remove unused deps flagged by knip
May 4, 2026
3bfe580
Revert package.json
May 4, 2026
f1e381a
test(ui-staff): add Playwright e2e tests for role-based route authori…
May 4, 2026
6396cd4
feat: update pnpm workspace and add new packages for Cucumber and Ser…
May 4, 2026
8bbf225
chore: remove react-dom version from pnpm-lock.yaml
May 4, 2026
08f44c3
Refactor code structure for improved readability and maintainability
May 5, 2026
a87bbfa
feat: implement theme storage functions and update theme context to u…
May 5, 2026
bf378d6
fix: refine theme context type and improve theme storage handling
May 5, 2026
085ed0f
fix: enhance theme context type and streamline theme storage handling
May 5, 2026
f51991e
fix: correct import order for theme storage functions in theme context
May 5, 2026
8f64ac2
feat: implement staff RBAC with backend user/role creation and permis…
May 5, 2026
d1b3d25
feat: add staff user query and permissions handling in community and …
May 6, 2026
a6f530f
feat: add staff user role csv file
ttrang-nguyen May 6, 2026
56755b5
Merge branch 'rohit-r-kumar/issue214' of github.com:CellixJs/cellixjs…
ttrang-nguyen May 6, 2026
9ce1e95
update staff role permissions and community list story
ttrang-nguyen May 6, 2026
063dda5
refactor: update community permissions structure and related queries
May 7, 2026
ff79094
refactor: improve staff role permissions test structure and enhance t…
May 7, 2026
b2f97f7
refactor: remove default roleType from StaffRoleSchema
ttrang-nguyen May 7, 2026
28ec3b6
Merge branch 'rohit-r-kumar/issue214' of github.com:CellixJs/cellixjs…
ttrang-nguyen May 7, 2026
17f83e1
add mongoose vulnerability exception with detailed reasoning
May 7, 2026
6a053ba
feat: Add staff user resolvers and tests for querying and creating st…
May 8, 2026
fceac8e
Merge Branch with Main
May 8, 2026
56324cb
refactor: Simplify function definitions and improve readability in tests
May 8, 2026
7a81701
Refactor code structure for improved readability and maintainability
May 8, 2026
9bcf52b
refactor: Remove unused imports from theme context
May 8, 2026
be4b476
feat: Update staff route management and authorization roles for commu…
ttrang-nguyen May 8, 2026
825c79a
feat: Implement role-based access control for staff routes and permis…
May 8, 2026
b9d03cc
feat: Implement role-based access control for staff routes and permis…
May 8, 2026
c0091c0
refactor: Rename VITE_FUNCTION_ENDPOINT to VITE_COMMON_API_ENDPOINT a…
May 11, 2026
fd13793
refactor: Rename VITE_FUNCTION_ENDPOINT to VITE_COMMON_API_ENDPOINT a…
May 11, 2026
a18025d
feat: Update dependencies for improved security and functionality
ttrang-nguyen May 11, 2026
53cdd3e
feat: Enhance role-based access control in staff routes and permissions
ttrang-nguyen May 11, 2026
2c6ff5e
Removed staff-user-role csv file, refactored createDefaultRoles, upda…
ttrang-nguyen May 12, 2026
7af12a2
fix snyk issue
ttrang-nguyen May 12, 2026
227fe04
e2e and acceptance-ui tests for staff
ttrang-nguyen May 12, 2026
564144a
update tests
ttrang-nguyen May 13, 2026
c37714e
chore: update protobufjs to resolved snyk issue
May 13, 2026
2134ac4
refactor: replace withScopedTransaction with withTransaction in staff…
May 13, 2026
5a492a6
feat: implement StaffUserUserPassport and update StaffUserPassport to…
May 13, 2026
6202fd1
Added TechAdmin permission to finance, community-management, and user…
ttrang-nguyen May 13, 2026
ef09d6d
downgrade packageManager to pnpm@10.30.1, add canManage permissions s…
ttrang-nguyen May 14, 2026
5b4b7e3
chore: update protobufjs to version 7.5.8
ttrang-nguyen May 14, 2026
3741499
feat: enhance staff role management by adding default role instances …
May 14, 2026
850330a
add query for fetching displayName
ttrang-nguyen May 14, 2026
7c8cac6
remove staff queries from ui-community route
ttrang-nguyen May 14, 2026
01559d7
Merge branch with main
May 14, 2026
daf83d3
Resolve conflicts
May 14, 2026
f0307ed
conflicts
ttrang-nguyen May 14, 2026
0aca918
merge conflicts
ttrang-nguyen May 14, 2026
3994cc7
undo and resolve conflicts
ttrang-nguyen May 14, 2026
c6457e5
update role names nad remove unused staff section permissions
ttrang-nguyen May 15, 2026
cb05fc9
Merge branches 'rohit-r-kumar/issue214' and 'rohit-r-kumar/issue214' …
May 15, 2026
5d0a3d1
feat(staff-role): add support for retrieving default roles by enterpr…
ttrang-nguyen May 15, 2026
1583df2
Merge branch 'rohit-r-kumar/issue214' of github.com:CellixJs/cellixjs…
ttrang-nguyen May 15, 2026
6973a3b
Revert "Merge branch 'rohit-r-kumar/issue214' of github.com:CellixJs/…
ttrang-nguyen May 15, 2026
de9ecf9
Fix knip issues
May 15, 2026
9cc7d56
Merge branch 'main' of https://github.com/CellixJs/cellixjs into rohi…
May 15, 2026
a287666
refactor: update staff role handling and remove unused queries in com…
May 15, 2026
ce38a55
remove uuid and add enterpriseAppRole for finance and techAdmin
ttrang-nguyen May 15, 2026
e2161c4
feat: add enterpriseAppRole handling in staff role tests and repository
May 18, 2026
7c69013
Resolve test coverage failure and add getDefaultRoleByEnterpriseAppRole
ttrang-nguyen May 18, 2026
0960b11
chore: update dependencies for snyk issue
ttrang-nguyen May 18, 2026
7ddca09
remove staffPermission from index.tsx
ttrang-nguyen May 18, 2026
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
15 changes: 15 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,18 @@ ignore:
reason: 'Transitive dependency in Docusaurus; not exploitable in current usage.'
expires: '2026-06-28T00:00:00.000Z'
created: '2026-05-11T10:00:00.000Z'
'SNYK-JS-AI-16734889':
- '* > ai@5.0.105':
reason: 'Transitive dependency in @docusaurus/preset-classic; not exploitable in current usage.'
expires: '2026-06-18T00:00:00.000Z'
created: '2026-05-18T11:04:00.000Z'
'SNYK-JS-AISDKPROVIDERUTILS-16734888':
- '* > @ai-sdk/provider-utils@3.0.18':
reason: 'Transitive dependency in @docusaurus/preset-classic; not exploitable in current usage.'
expires: '2026-06-18T00:00:00.000Z'
created: '2026-05-18T11:04:00.000Z'
'SNYK-JS-AISDKPROVIDERUTILS-16735288':
- '* > @ai-sdk/provider-utils@3.0.18':
reason: 'Transitive dependency in @docusaurus/preset-classic; not exploitable in current usage.'
expires: '2026-06-18T00:00:00.000Z'
created: '2026-05-18T11:04:00.000Z'
17 changes: 10 additions & 7 deletions apps/ui-community/src/contexts/theme-context.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { loadStoredTheme, saveStoredTheme } from '@cellix/ui-core';
import { Button, theme } from 'antd';
import type { SeedToken } from 'antd/lib/theme/interface/index.js';
import { createContext, type ReactNode, useCallback, useEffect, useState } from 'react';
Expand All @@ -15,7 +16,7 @@ interface ThemeContextType {
textColor: string | undefined;
backgroundColor: string | undefined;
};
type: string;
type: 'light' | 'dark' | 'custom';
}
| undefined;
setTheme: (tokens: Partial<SeedToken>, types: string) => void;
Expand Down Expand Up @@ -91,13 +92,15 @@ export const ThemeProvider = ({ children }: { children: ReactNode }) => {
type: 'custom',
};
}
localStorage.setItem('themeProp', JSON.stringify(valueToSet));
if (valueToSet) {
saveStoredTheme(valueToSet);
}
return valueToSet;
});
}, []);

useEffect(() => {
const extractFromLocal = JSON.parse(localStorage.getItem('themeProp') || '{}');
const extractFromLocal = loadStoredTheme();
if (extractFromLocal && extractFromLocal.type === 'dark') {
setTheme(
{
Expand All @@ -119,22 +122,22 @@ export const ThemeProvider = ({ children }: { children: ReactNode }) => {
} else if (extractFromLocal && extractFromLocal.type === 'custom') {
setTheme(
{
colorTextBase: extractFromLocal.hardCodedTokens.textColor,
colorBgBase: extractFromLocal.hardCodedTokens.backgroundColor,
colorTextBase: extractFromLocal.hardCodedTokens?.textColor,
colorBgBase: extractFromLocal.hardCodedTokens?.backgroundColor,
},
'custom',
);
return;
} else {
const valueToSet = {
type: 'light',
type: 'light' as const,
token: theme.defaultSeed,
hardCodedTokens: {
textColor: '#000000',
backgroundColor: '#ffffff',
},
};
localStorage.setItem('themeProp', JSON.stringify(valueToSet));
saveStoredTheme(valueToSet);
setTheme(theme.defaultSeed, 'light');
return;
}
Expand Down
130 changes: 95 additions & 35 deletions apps/ui-staff/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,89 @@ import { Root as Finance } from '@ocom/ui-staff-route-finance';
import { Root } from '@ocom/ui-staff-route-root';
import { Root as TechAdmin } from '@ocom/ui-staff-route-tech-admin';
import { Root as UserManagement } from '@ocom/ui-staff-route-user-management';
import { StaffAuthProvider } from '@ocom/ui-staff-shared';
import { StaffAuthContext, StaffAuthProvider } from '@ocom/ui-staff-shared';
import { Spin } from 'antd';
import { useContext } from 'react';
import { useAuth } from 'react-oidc-context';
import { Outlet, Route, Routes } from 'react-router-dom';
import { Navigate, Route, Routes } from 'react-router-dom';
import './App.css';
import { AuthLanding } from './components/ui/molecules/auth-landing/index.tsx';
import { client } from './components/ui/organisms/apollo-connection/apollo-client-links.tsx';
import { ApolloConnection } from './components/ui/organisms/apollo-connection/index.tsx';
import { useStaffPermissions } from './hooks/use-staff-permissions.ts';
import { Unauthorized } from './unauthorized.tsx';

function StaffRoutes() {
const auth = useContext(StaffAuthContext);
const perms = auth?.permissions;
const canManageCommunities = perms?.canManageCommunities === true;
const canManageUsers = perms?.canManageUsers === true;
const canManageFinance = perms?.canManageFinance === true;
const canManageTechAdmin = perms?.canManageTechAdmin === true;

let defaultStaffRoute = '/unauthorized';
if (canManageTechAdmin) {
defaultStaffRoute = '/staff/tech';
} else if (canManageFinance) {
defaultStaffRoute = '/staff/finance';
} else if (canManageCommunities) {
defaultStaffRoute = '/staff/community-management';
} else if (canManageUsers) {
defaultStaffRoute = '/staff/user-management';
}

return (
<Routes>
<Route
index
element={
<Navigate
to={defaultStaffRoute}
replace
/>
}
/>
{canManageCommunities && (
<Route
path="community-management/*"
element={<CommunityManagement />}
/>
)}
{canManageUsers && (
<Route
path="user-management/*"
element={<UserManagement />}
/>
)}
{canManageFinance && (
<Route
path="finance/*"
element={<Finance />}
/>
)}
{canManageTechAdmin && (
<Route
path="tech/*"
element={<TechAdmin />}
/>
)}
<Route
path="*"
element={
<Navigate
to="/unauthorized"
replace
/>
}
/>
</Routes>
);
}

export default function App() {
const rootSection = <Root />;
const auth = useAuth();

// Build a best-effort identity object to supply to shared placeholders

// Provide a best-effort raw profile to the shared staff shell. StaffRouteShell will
// attempt to extract display name and roles from this raw profile.
const identity = {
raw: (auth?.user?.profile as Record<string, unknown>) ?? undefined,
onLogout: () => HandleLogout(auth, client, globalThis.location.origin),
Expand All @@ -33,13 +99,9 @@ export default function App() {
</RequireAuth>
);

// Staff section acts as the parent route element and must render an Outlet so
// nested child routes declared in the top-level Routes are rendered in place.
const staffSectionElement = (
<RequireAuth forceLogin={false}>
<StaffAuthProvider value={identity}>
<Outlet />
</StaffAuthProvider>
<StaffSection identity={identity} />
</RequireAuth>
);

Expand All @@ -59,34 +121,32 @@ export default function App() {
element={<Unauthorized />}
/>

{/* Parent staff route: child routes must be declared as nested Route elements
so relative paths like "users/*" resolve against /staff. */}
{/* StaffSection renders StaffAuthProvider + StaffRoutes which handles all
authenticated sub-routes with permission guards. No nested Route children
are needed here because StaffRoutes defines its own Routes block. */}
<Route
path="/staff/*"
element={staffSectionElement}
>
<Route
index
element={<Root />}
/>
<Route
path="community-management/*"
element={<CommunityManagement />}
/>
<Route
path="user-management/*"
element={<UserManagement />}
/>
<Route
path="finance/*"
element={<Finance />}
/>
<Route
path="tech/*"
element={<TechAdmin />}
/>
</Route>
/>
</Routes>
</ApolloConnection>
);
}

function StaffSection({ identity }: { identity: Parameters<typeof StaffAuthProvider>[0]['value'] }) {
const { permissions, user, loading } = useStaffPermissions();

if (loading) {
return (
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}>
<Spin size="large" />
</div>
);
}

return (
<StaffAuthProvider value={{ ...identity, permissions, name: user?.displayName, email: user?.email }}>
<StaffRoutes />
</StaffAuthProvider>
);
}
39 changes: 38 additions & 1 deletion apps/ui-staff/src/components/ui/molecules/auth-landing/index.tsx
Comment thread
ttrang-nguyen marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
import { Spin } from 'antd';
import { Navigate } from 'react-router-dom';
import { useStaffPermissions } from '../../../../hooks/use-staff-permissions.ts';

export const AuthLanding: React.FC = () => {
return <Navigate to="/staff/community-management" />;
const { permissions, loading, error } = useStaffPermissions();

if (loading) {
return (
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}>
<Spin size="large" />
</div>
);
}

if (error) {
return (
<Navigate
to="/unauthorized"
replace
/>
);
}

let targetRoute = '/unauthorized';
if (permissions?.canManageTechAdmin) {
targetRoute = '/staff/tech';
} else if (permissions?.canManageFinance) {
targetRoute = '/staff/finance';
} else if (permissions?.canManageCommunities) {
targetRoute = '/staff/community-management';
} else if (permissions?.canManageUsers) {
targetRoute = '/staff/user-management';
}

return (
<Navigate
to={targetRoute}
replace
/>
);
};
3 changes: 2 additions & 1 deletion apps/ui-staff/src/contexts/theme-context.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { type StoredTheme } from '@cellix/ui-core';
import { Button, theme } from 'antd';
import type { SeedToken } from 'antd/lib/theme/interface/index.js';
import { createContext, type ReactNode, useCallback, useEffect, useState } from 'react';
Expand All @@ -10,7 +11,7 @@ interface ThemeContextType {
textColor: string | undefined;
backgroundColor: string | undefined;
};
type: string;
type: StoredTheme['type'];
}
| undefined;
setTheme: (tokens: Partial<SeedToken>, type: string) => void;
Expand Down
Loading
Loading