Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
266 commits
Select commit Hold shift + click to select a range
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
4ad2821
Add staff users and staff roles pages to ui-staff user management sec…
May 13, 2026
564144a
update tests
ttrang-nguyen May 13, 2026
c37714e
chore: update protobufjs to resolved snyk issue
May 13, 2026
9128a02
Merge branch 'rohit-r-kumar/issue214' of https://github.com/CellixJs/…
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
c04be87
fix: downgrade packageManager to pnpm@10.30.1
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
8ec3195
merge #214 and resolve merge conflicts
ttrang-nguyen 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
58a06ef
Pull from main
May 18, 2026
25a16ea
Pull from branch/214
May 18, 2026
fef6d15
add staff user creation ad role management components
ttrang-nguyen May 18, 2026
67fe8f8
fix knip issues
ttrang-nguyen May 18, 2026
065fbb8
remove mock store and update components
ttrang-nguyen May 19, 2026
f7481c4
Fix Snyk issue
ttrang-nguyen May 19, 2026
5938260
feat: add staff role management features
May 19, 2026
ebfe6c5
Resolve conflicts
May 19, 2026
eb52cd2
feat: enhance staff role management with enterprise app roles and per…
May 19, 2026
a2968d8
fix Snyk issue
ttrang-nguyen May 19, 2026
96913bd
feat: implement staff role update functionality with edit capabilities
May 19, 2026
1a46208
Merge branch 'rohit-r-kumar/issue250' of https://github.com/CellixJs/…
May 19, 2026
21a74d1
Added GraphQL queries and mutations for staff user creation and role …
ttrang-nguyen May 19, 2026
0462af0
fix knip and test coverage issues; added users management page access…
ttrang-nguyen May 20, 2026
9b45e4e
feat: add staff role listing and updating features
May 20, 2026
397b659
Disable self-assigning role functionality and make read-only; replace…
ttrang-nguyen May 20, 2026
45331f6
Merge branch 'rohit-r-kumar/issue250' of github.com:CellixJs/cellixjs…
ttrang-nguyen May 20, 2026
ea14967
feat: enhance staff role creation tests with permissions type validation
May 20, 2026
78fe27f
Merge branch 'rohit-r-kumar/issue250' of github.com:CellixJs/cellixjs…
ttrang-nguyen May 20, 2026
3d405d9
feat: add staff user listing feature and tests
May 20, 2026
23da639
merge from main
ttrang-nguyen May 20, 2026
c14eb9c
merge from main
ttrang-nguyen May 20, 2026
3689105
add staff user role csv file
ttrang-nguyen May 21, 2026
1e4ae8b
fix: correct script name from clear to clean in package.json
ttrang-nguyen May 21, 2026
1e5ae34
Refactor permission sets
ttrang-nguyen May 21, 2026
c42d0d4
fix build and knip issue
ttrang-nguyen May 21, 2026
454044a
remove staff user creation functionality
ttrang-nguyen May 21, 2026
44d60f6
add permission hierachy and change label to staff role
ttrang-nguyen May 22, 2026
473c344
Add save functionality and update selection handling
ttrang-nguyen May 22, 2026
116ab44
Implement activity logging for staff user actions and enhance role as…
May 22, 2026
05b5cb6
Merge branch 'rohit-r-kumar/issue250' of https://github.com/CellixJs/…
May 22, 2026
fc44a4e
replaced activity detail with activity log, refactor activityDescription
ttrang-nguyen May 22, 2026
2c4caf4
added more test cases
ttrang-nguyen May 22, 2026
5f9313a
fix lint issue and refactor staff role create
ttrang-nguyen May 22, 2026
b0dee5f
fix snyk issue
ttrang-nguyen May 22, 2026
c59fd50
add test cases
ttrang-nguyen May 22, 2026
d193099
fix build issue
ttrang-nguyen May 22, 2026
8600271
Update staff user role CSV file
May 25, 2026
9a81820
Resolve conflicts
May 28, 2026
a375abb
Remove unused exports from local-settings in index.ts
May 28, 2026
4a581c8
Resolve knip issue
May 28, 2026
89340a8
merge from main and resolve conflicts
ttrang-nguyen May 28, 2026
364664c
fix: update environment variable names for community and staff portals
ttrang-nguyen May 28, 2026
23b4378
feat: add staff context step definitions
ttrang-nguyen May 29, 2026
69cd123
Refactor test assertions to use dot notation for permissions
May 29, 2026
ec6e140
Add activity log feature to StaffUserDetail component
May 29, 2026
23854af
Refactor test cases
May 29, 2026
8116629
add more test cases
ttrang-nguyen May 29, 2026
bea9109
add staff context definitions
ttrang-nguyen May 29, 2026
3fda574
Add staff context step definitions for Cucumber tests
May 29, 2026
d7408d9
Add staff context step definitions for Cucumber tests
May 29, 2026
77e7fd2
add test cases
ttrang-nguyen May 29, 2026
d2907fc
feat: implement staff user management features and update community m…
ttrang-nguyen May 29, 2026
7fd630f
upgrade axios version
ttrang-nguyen May 29, 2026
d5fe680
Increase UI initialization timeout from 30 seconds to 60 seconds
Jun 1, 2026
a7a6e17
Update axios version from 1.15.2 to 1.16.0 in pnpm-lock.yaml
Jun 1, 2026
8d28c53
feat: add Storybook stories for RequireRole and SectionLayoutContaine…
ttrang-nguyen Jun 1, 2026
2b824df
upgrade vitest browser version to 4.1.6
ttrang-nguyen Jun 1, 2026
28937f6
Update axios version from 1.15.2 to 1.16.0 in pnpm-lock.yaml and pnpm…
Jun 1, 2026
57e60fb
upgrade vitest browser playright to 4.1.6
ttrang-nguyen Jun 1, 2026
755a380
Resolve The vulnerability affects of @vitest/browser
Jun 1, 2026
7aaac0a
update vitest
ttrang-nguyen Jun 1, 2026
abcc9c4
Resolve The vulnerability affects of @vitest/browser
Jun 1, 2026
7d0297c
Update @vitest/browser version pnpm-lock.yaml, and pnpm-workspace.yaml
Jun 1, 2026
59417e0
fix: update @vitest/browser dependency to use catalog version
ttrang-nguyen Jun 1, 2026
a99d8fa
Update @vitest/browser version to 4.1.2 and adjust related dependenci…
Jun 1, 2026
2211756
Update vitest/browser vulnerability entry in .snyk to reflect removal…
Jun 1, 2026
a92cb88
fix: update @vitest/browser dependency to use catalog version
Jun 1, 2026
e6981ca
update vitest browser dependency to version 4.1.6 in pnpm workspace
Jun 1, 2026
324297e
chore: add '@vitest/browser-playwright' version 4.1.6 to pnpm workspa…
ttrang-nguyen Jun 1, 2026
0990777
Update @vitest/browser version
Jun 1, 2026
60e635d
chore: add '@vitest/browser-playwright' version 4.1.6 to pnpm workspa…
ttrang-nguyen Jun 1, 2026
bddd30e
Merge branch with issue214
Jun 2, 2026
27485f1
Upgrade Storybook 9 → 10 across UI packages, apps, and the shared tes…
Jun 2, 2026
794c257
fix: update storybook-addon-apollo-client path resolution
Jun 2, 2026
198aac1
feat: add patch for storybook-addon-apollo-client v10 and update pnpm…
Jun 2, 2026
249c642
remove addon-apollo-client version 10; change react to react-vite; up…
ttrang-nguyen Jun 2, 2026
6ff316b
fix: update @storybook/addon-vitest dependency to use catalog specifier
ttrang-nguyen Jun 2, 2026
5f84489
fix: update imports from '@storybook/react-vite' to '@storybook/react'
Jun 3, 2026
7b9401c
Merge branch 'main' of https://github.com/CellixJs/cellixjs into rohi…
Jun 3, 2026
d859109
refactor: remove unused environment variable settings for ui-communit…
Jun 3, 2026
782e728
Undo removal of uiCommunitySettings and uiStaffSettings;update react…
ttrang-nguyen Jun 3, 2026
0f8197a
update docusarus and update react-router and react-router-dom; replac…
ttrang-nguyen Jun 3, 2026
45816c4
update docusarus packages
ttrang-nguyen Jun 3, 2026
020d9de
merge from main and resolve merge conflicts
ttrang-nguyen Jun 3, 2026
05aec2e
fix: downgrade react-router-dom to version 7.12.0
ttrang-nguyen Jun 4, 2026
a28ce9d
remove react-router override and upgrade react-router-dom version
ttrang-nguyen Jun 4, 2026
fd042fc
Done: formatting code
Jun 5, 2026
b709533
comment out Azure Functions Core Tools cache and installation tasks
ttrang-nguyen Jun 5, 2026
6ba61b1
Merge branch 'rohit-r-kumar/issue268' of https://github.com/CellixJs/…
ttrang-nguyen Jun 5, 2026
0cbe760
undo changes to monorepo yml
ttrang-nguyen Jun 5, 2026
88bb4ee
Merge branch 'main' of https://github.com/CellixJs/cellixjs into tran…
ttrang-nguyen Jun 5, 2026
304595a
Implement cohesive Storybook structure for UI components across commu…
ttrang-nguyen Jun 5, 2026
9d15431
merge and resolve conflicts
ttrang-nguyen Jun 8, 2026
66c7274
chore: add @testing-library/react as a dependency
ttrang-nguyen Jun 8, 2026
6b004d3
fix build issue
ttrang-nguyen Jun 8, 2026
dc0a553
refactor staff-role and staff-user graphql and staff-user resolvers
ttrang-nguyen Jun 9, 2026
1927a7b
resolve merge conflicts
ttrang-nguyen Jun 9, 2026
08c49fe
remove project annotations setup
ttrang-nguyen Jun 9, 2026
b4f9612
add staff-role resolvers
ttrang-nguyen Jun 9, 2026
b089e88
Update pnpm-lock.yaml file
Jun 10, 2026
f7265e7
remove vitest setup
ttrang-nguyen Jun 10, 2026
d9a49de
fix knip issues
ttrang-nguyen Jun 10, 2026
a187a92
Update sonar coverage exclusions to include UI route files
ttrang-nguyen Jun 10, 2026
fe11746
revert change to sonar coverage
ttrang-nguyen Jun 10, 2026
82656eb
refactor staff-role and staff-user graphql and resolvers; refactor as…
ttrang-nguyen Jun 11, 2026
151f0c8
override for @grpc/grpc-js
ttrang-nguyen Jun 11, 2026
e33855a
add image size to snyk exception
ttrang-nguyen Jun 11, 2026
c3d1fd8
resolve merge conflicts
ttrang-nguyen Jun 11, 2026
841eac0
format
ttrang-nguyen Jun 11, 2026
6184666
add stories to pages
ttrang-nguyen Jun 11, 2026
8221b72
remove unnecessary user permission field on staff role for canAssignS…
Jun 12, 2026
9b88982
fix snyk issue
ttrang-nguyen Jun 12, 2026
a65ed1f
Add providers decorator and update Storybook configuration for UI com…
ttrang-nguyen Jun 12, 2026
3046390
merge nad resolve merge conflicts
ttrang-nguyen Jun 12, 2026
e3440a9
added shared helper, refactor assigned role, and reverse the order of…
ttrang-nguyen Jun 15, 2026
7df5ff6
upgrade esbuild version
ttrang-nguyen Jun 15, 2026
9e45099
upgrade esbuild and fix knip issue
ttrang-nguyen Jun 15, 2026
183c09d
Fix: esbuild build issue
Jun 15, 2026
4e2ca62
fix snyk issue
ttrang-nguyen Jun 15, 2026
e469d9f
upgrade protobufjs
ttrang-nguyen Jun 15, 2026
a1125da
resolve snyk issues
ttrang-nguyen Jun 15, 2026
1055743
add joi to override
ttrang-nguyen Jun 15, 2026
e3fb546
remove the unnecessary helper for isNotFoundError
Jun 16, 2026
866850a
add storybook/react to catalog
ttrang-nguyen Jun 16, 2026
a18e1bc
Update undefined condtion for staff role
Jun 16, 2026
ba141cf
Merge branch 'rohit-r-kumar/issue250' of https://github.com/CellixJs/…
Jun 16, 2026
9268639
update @vitest/browser version to 4.1.8; refactor staff-role and clea…
ttrang-nguyen Jun 16, 2026
93f7558
fix snyk isssues
ttrang-nguyen Jun 16, 2026
55ee7f7
add js-yaml to snyk exception
ttrang-nguyen Jun 16, 2026
ab8a297
throw error when not equal to NotFoundError
Jun 17, 2026
777ce54
upgrade dependencies
ttrang-nguyen Jun 17, 2026
6269695
remove react-router and update react-douter-dom
ttrang-nguyen Jun 17, 2026
5e9a9ed
upgrade dependencies
ttrang-nguyen Jun 17, 2026
5833861
fix snyk issue
ttrang-nguyen Jun 17, 2026
0863b98
Implement cohesive Storybook for staff UI portal application package …
Jun 17, 2026
530eafe
Merge branch 'main' of https://github.com/CellixJs/cellixjs into rohi…
Jun 17, 2026
43c9ea7
Merge branch with rohit-r-kumar/issue250
Jun 17, 2026
01d3f37
Add '@babel/core' and 'launch-editor' to catalog in pnpm-workspace.yaml
Jun 17, 2026
d7346fd
add apollo mocks for LoggedInUser and update Storybook config
ttrang-nguyen Jun 17, 2026
53c32e6
merge and resolve conflicts
ttrang-nguyen Jun 17, 2026
d049d55
chore: update package overrides for Babel and launch-editor versions
Jun 17, 2026
5410d86
Merge branch 'rohit-r-kumar/issue266' of https://github.com/CellixJs/…
ttrang-nguyen Jun 17, 2026
33a2c74
feat: integrate Storybook for staff UI components and update dependen…
Jun 18, 2026
8920a67
Merge branch 'rohit-r-kumar/issue266' of https://github.com/CellixJs/…
Jun 18, 2026
8b89a5b
feat: update Storybook configurations and improve routing for staff m…
Jun 18, 2026
c3ec803
Comment out ui-shared from storybook path
ttrang-nguyen Jun 18, 2026
660dc10
feat: update Storybook titles for staff management components to impr…
Jun 19, 2026
a133ad6
Merge branch 'rohit-r-kumar/issue266' of https://github.com/CellixJs/…
Jun 19, 2026
03b856b
Upgrade vitest and related dependencies to 4.1.8
ttrang-nguyen Jun 22, 2026
ff11920
feat: update Storybook configurations and improve routing for various…
Jun 22, 2026
cc7baeb
Merge branch 'rohit-r-kumar/issue266' of https://github.com/CellixJs/…
Jun 22, 2026
98f1fab
update @vitest/coverage-istanbul to version 4.1.8 in pnpm-workspace.y…
Jun 22, 2026
7ecd11d
feat: refactor storybook components to use Admin layout and improve r…
Jun 22, 2026
9960d26
feat: update dependencies and remove deprecated Storybook packages
Jun 22, 2026
996b545
Fix conflicts
Jun 22, 2026
46d559f
Update Staff-Role storybook
Jun 23, 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
5 changes: 5 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ ignore:
reason: 'Transitive dependency in vitest@4.1.6; not exploitable in current usage.'
expires: '2026-07-11T00:00:00.000Z'
created: '2026-06-11T10:00:00.000Z'
'SNYK-JS-JSYAML-17342520':
- '* > js-yaml':
reason: 'Transitive dependency in Docusaurus; not exploitable in current usage.'
expires: '2026-07-28T00:00:00.000Z'
created: '2026-06-17T16:06:00.000Z'
1 change: 1 addition & 0 deletions apps/ui-community/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lerna-debug.log*
node_modules
dist
dist-ssr
storybook-static
*.local
tsconfig.tsbuildinfo

Expand Down
12 changes: 12 additions & 0 deletions apps/ui-community/.storybook/apollo-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AccountsCommunityListContainerMembersForCurrentEndUserDocument,
AccountsUserInfoContainerCurrentEndUserAndCreateIfNotExistsDocument,
} from '../../../packages/ocom/ui-community-route-accounts/src/generated';
import { LoggedInUserRootContainerCurrentEndUserAndCreateIfNotExistsDocument } from '../../../packages/ocom/ui-shared/src/generated.tsx';

// Mock data for communities
const mockCommunities = [
Expand Down Expand Up @@ -113,4 +114,15 @@ export const apolloMocks = [
},
},
},
{
request: {
query: LoggedInUserRootContainerCurrentEndUserAndCreateIfNotExistsDocument,
variables: {},
},
result: {
data: {
currentEndUserAndCreateIfNotExists: mockCurrentEndUser,
},
},
},
];
6 changes: 5 additions & 1 deletion apps/ui-community/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ function getAbsolutePath(value: string) {
return dirname(require.resolve(join(value, 'package.json')));
}
const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: [
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
//'../../../packages/ocom/ui-shared/src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
'../../../packages/ocom/ui-community-*/src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
getAbsolutePath('@chromatic-com/storybook'),
getAbsolutePath('@storybook/addon-docs'),
Expand Down
6 changes: 3 additions & 3 deletions apps/ui-community/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { apolloMocks } from './apollo-mocks.ts';
const mockOidcConfig = {
authority: 'https://mock-authority.com',
client_id: 'mock-client-id',
redirect_uri: 'http://localhost:6006/auth-redirect',
redirect_uri: `http://localhost:6006/auth-redirect`,
code_verifier: false,
nonce: false,
response_type: 'code',
Expand All @@ -29,7 +29,7 @@ export const decorators: Decorator[] = [
const mocks = apolloParams.mocks ?? apolloMocks;
const { defaultOptions } = apolloParams;

return (
return (
<HelmetProvider>
<AuthProvider {...mockOidcConfig}>
<ThemeProvider>
Expand Down Expand Up @@ -69,7 +69,7 @@ export const parameters: Parameters = {

options: {
storySort: {
order: ['Pages', 'Components', 'App'],
order: ['Pages', 'Components'],
},
},

Expand Down
3 changes: 1 addition & 2 deletions apps/ui-community/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test": "vitest run --silent --reporter=dot",
"test:coverage": "vitest run --coverage --silent --reporter=dot",
"test:watch": "vitest",
"storybook": "storybook dev -p 6008",
"storybook": "storybook dev --config-dir ./.storybook -p 6008",
"build-storybook": "storybook build"
},
"dependencies": {
Expand Down Expand Up @@ -45,7 +45,6 @@
"@storybook/addon-vitest": "catalog:",
"@storybook/react": "10.4.2",
"@storybook/react-vite": "catalog:",
"@testing-library/jest-dom": "^6.6.4",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react": "^6.0.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/ui-community/src/App.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Object.defineProperty(import.meta, 'env', {
});

const meta = {
title: 'App/Main Application',
title: 'Pages/Community/Main Application',
component: App,
parameters: {
layout: 'fullscreen',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { expect } from 'storybook/test';
import { AuthLanding } from './index.tsx';

const meta = {
title: 'Components/UI/Molecules/AuthLanding',
title: 'Components/Community/Auth Landing',
component: AuthLanding,
parameters: {
layout: 'fullscreen',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ try {
}

const meta = {
title: 'Components/UI/Organisms/ApolloConnection/Apollo Client Links',
title: 'Components/Community/Apollo Connection/Apollo Client Links',
parameters: {
layout: 'fullscreen',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Object.defineProperty(import.meta, 'env', {
});

const meta = {
title: 'Components/UI/Organisms/ApolloConnection',
title: 'Components/Community/Apollo Connection',
component: ApolloConnection,
parameters: {
layout: 'fullscreen',
Expand Down
3 changes: 3 additions & 0 deletions apps/ui-staff/.storybook/apollo-mocks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Staff Storybook - Apollo Client global fallback mocks.
// Individual stories supply their own mocks via story-level decorators.
export const apolloMocks: never[] = [];
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@ import type { StorybookConfig } from '@storybook/react-vite';
const require = createRequire(import.meta.url);

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
* Resolves the absolute path of a package.
* Required for monorepo setups and Yarn PnP.
*/
function getAbsolutePath(value: string) {
return dirname(require.resolve(join(value, 'package.json')));
}

const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)', '../../../packages/ocom/ui-shared/src/**/*.stories.@(js|jsx|mjs|ts|tsx)', '../../../packages/ocom/ui-staff-*/src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@chromatic-com/storybook'),
getAbsolutePath('@storybook/addon-docs'),
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@storybook/addon-vitest'),
getAbsolutePath('storybook-addon-apollo-client'),
'storybook-addon-apollo-client',
],
framework: {
name: getAbsolutePath('@storybook/react-vite'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
// Global preview for Storybook in @apps/ui-staff
// Import Ant Design base styles so components render correctly
import { MockedProvider } from '@apollo/client/testing';
import { HelmetProvider } from '@dr.pogodin/react-helmet';
import type { Decorator, Parameters, Preview } from '@storybook/react';
import type { Decorator, Parameters } from '@storybook/react';
import 'antd/dist/reset.css';
import { AuthProvider } from 'react-oidc-context';
import { ThemeProvider } from '../src/contexts/theme-context.tsx';
import { apolloMocks } from './apollo-mocks.ts';

// Mock OIDC configuration for stories
const mockOidcConfig = {
authority: 'https://mock-authority.com',
client_id: 'mock-client-id',
redirect_uri: 'http://localhost:6006/auth-redirect',
redirect_uri: 'http://localhost:6009/auth-redirect',
code_verifier: false,
nonce: false,
response_type: 'code',
scope: 'openid profile',
onSigninCallback: () => {},
onSigninCallback: () => {
console.log('Mock signin callback');
},
};

export const decorators: Decorator[] = [
(Story, context) => {
const apolloParams = context.parameters?.apolloClient ?? {};
const mocks = apolloParams.mocks ?? [];
const mocks = apolloParams.mocks ?? apolloMocks;
const { defaultOptions } = apolloParams;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Merging Apollo defaultOptions overwrites any existing watchQuery/query options from stories.

In MockedProvider, the current spread:

defaultOptions={{
  ...defaultOptions,
  watchQuery: { fetchPolicy: 'network-only' },
  query: { fetchPolicy: 'network-only' },
}}

overwrites any watchQuery/query options from parameters.apolloClient.defaultOptions (e.g. errorPolicy, pollInterval). To preserve those while enforcing the fetch policy, deep-merge the sub-objects instead:

defaultOptions={{
  ...defaultOptions,
  watchQuery: { ...(defaultOptions?.watchQuery ?? {}), fetchPolicy: 'network-only' },
  query: { ...(defaultOptions?.query ?? {}), fetchPolicy: 'network-only' },
}}


return (
<HelmetProvider>
<AuthProvider {...mockOidcConfig}>
<MockedProvider
key={context.id}
mocks={mocks}
defaultOptions={{
...defaultOptions,
watchQuery: { fetchPolicy: 'network-only' },
query: { fetchPolicy: 'network-only' },
}}
>
<Story />
</MockedProvider>
<ThemeProvider>
<MockedProvider
key={context.id}
mocks={mocks}
defaultOptions={{
...defaultOptions,
watchQuery: { fetchPolicy: 'network-only' },
query: { fetchPolicy: 'network-only' },
}}
>
<Story />
</MockedProvider>
</ThemeProvider>
</AuthProvider>
</HelmetProvider>
);
Expand All @@ -56,17 +65,16 @@ export const parameters: Parameters = {
MockedProvider,
},

options: {
storySort: {
order: ['Pages', 'Components'],
},
},

a11y: {
// 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations
// 'off' - skip a11y checks entirely
test: 'todo',
Comment on lines +74 to +78

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (bug_risk): Use of a11y.test option may not align with addon-a11y’s expected configuration.

The a11y block is using test: 'todo', but @storybook/addon-a11y doesn’t expose a test option—its config is usually via config, manual, etc. Unless you have custom wiring that consumes a11y.test, this setting will be ignored and you won’t get the intended “todo/error/off” behavior. Please verify the addon’s current API and either update this config or add an adapter that maps 'todo' | 'error' | 'off' to the real addon options.

},
};

const preview: Preview = {
decorators,
parameters,
};

export default preview;
16 changes: 15 additions & 1 deletion apps/ui-staff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"preview": "vite preview",
"test": "vitest run --silent --reporter=dot",
"test:coverage": "vitest run --coverage --silent --reporter=dot",
"test:watch": "vitest"
"test:watch": "vitest",
"storybook": "storybook dev --config-dir ./.storybook -p 6009",
"build-storybook": "storybook build",
"chromatic": "chromatic"
},
"dependencies": {
"@apollo/client": "^3.13.9",
Expand All @@ -39,13 +42,24 @@
"devDependencies": {
"@cellix/config-typescript": "workspace:*",
"@cellix/config-vitest": "workspace:*",
"@chromatic-com/storybook": "^5.2.1",
"@storybook/addon-a11y": "catalog:",
"@storybook/addon-docs": "catalog:",
"@storybook/addon-onboarding": "catalog:",
"@storybook/addon-vitest": "catalog:",
"@storybook/react": "10.4.2",
"@storybook/react-vite": "catalog:",
"@testing-library/jest-dom": "^6.6.4",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react": "^6.0.1",
"chromatic": "^11.0.0",
"rollup-plugin-visualizer": "^6.0.5",
"@vitest/coverage-istanbul": "catalog:",
"esbuild": "catalog:",
"jsdom": "^26.1.0",
"storybook": "catalog:",
"storybook-addon-apollo-client": "^9.0.0",
"tailwindcss": "^3.4.17",
"typescript": "catalog:",
"vite": "catalog:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ vi.mock('@cellix/ui-core', () => ({
RequireAuth: ({ children }: { children: React.ReactNode }) => React.createElement(React.Fragment, {}, children),
}));

// Mock StaffAuthProvider so tests don't need package implementation
vi.mock('@ocom/ui-staff-shared', () => ({
StaffAuthProvider: ({ children }: { children: React.ReactNode }) => React.createElement(React.Fragment, {}, children),
// Mock useStaffPermissions so StaffSection bypasses Apollo query during SSR and grants all permissions
vi.mock('./hooks/use-staff-permissions.ts', () => ({
useStaffPermissions: () => ({
loading: false,
permissions: {
canManageCommunities: true,
canManageUsers: true,
canManageFinance: true,
canManageTechAdmin: true,
},
user: undefined,
error: undefined,
}),
}));

// Mock route packages used by App to render simple identifiable markup
Expand Down Expand Up @@ -67,13 +77,15 @@ describe('App', () => {
expect(html).toContain('Unauthorized');
});

it('navigates to staff index and renders RootSection', () => {
it('navigates to staff index without throwing (index redirects via Navigate)', () => {
// React renderToString does not follow Navigate redirects synchronously,
// so the output may be empty - this verifies the render does not throw.
const html = renderToString(
<MemoryRouter initialEntries={['/staff']}>
<App />
</MemoryRouter>,
);
expect(html).toContain('RootSection');
expect(typeof html).toBe('string');
});

it('navigates to staff/community-management and renders CommunityManagement', () => {
Expand Down
16 changes: 12 additions & 4 deletions apps/ui-staff/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,17 @@ function StaffRoutes() {
const auth = useContext(StaffAuthContext);
const perms = auth?.permissions;
const canManageCommunities = perms?.canManageCommunities === true;
const canManageStaffRolesAndPermissions = perms?.canManageStaffRolesAndPermissions === true;
const canManageUsers = perms?.canManageUsers === true;
const canAssignStaffRoles = perms?.canAssignStaffRoles === true;
const canViewStaffUsers = perms?.canViewStaffUsers === true;
const canManageFinance = perms?.canManageFinance === true;
const canManageTechAdmin = perms?.canManageTechAdmin === true;
const canViewRoles = perms?.canViewRoles === true;
const canAddRole = perms?.canAddRole === true;
const canEditRole = perms?.canEditRole === true;
const canRemoveRole = perms?.canRemoveRole === true;
const canAccessUserManagement = canManageUsers || canAssignStaffRoles || canViewStaffUsers || canManageStaffRolesAndPermissions || canViewRoles || canAddRole || canEditRole || canRemoveRole || canManageTechAdmin;

let defaultStaffRoute = '/unauthorized';
if (canManageTechAdmin) {
Expand All @@ -32,7 +40,7 @@ function StaffRoutes() {
defaultStaffRoute = '/staff/finance';
} else if (canManageCommunities) {
defaultStaffRoute = '/staff/community-management';
} else if (canManageUsers) {
} else if (canAccessUserManagement) {
defaultStaffRoute = '/staff/user-management';
}

Expand All @@ -53,7 +61,7 @@ function StaffRoutes() {
element={<CommunityManagement />}
/>
)}
{canManageUsers && (
{(canAccessUserManagement || canManageFinance) && (
<Route
path="user-management/*"
element={<UserManagement />}
Expand Down Expand Up @@ -134,7 +142,7 @@ export default function App() {
}

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

if (loading) {
return (
Expand All @@ -145,7 +153,7 @@ function StaffSection({ identity }: { identity: Parameters<typeof StaffAuthProvi
}

return (
<StaffAuthProvider value={{ ...identity, permissions, name: user?.displayName, email: user?.email }}>
<StaffAuthProvider value={{ ...identity, permissions, enterpriseAppRole, name: user?.displayName, email: user?.email }}>
<StaffRoutes />
</StaffAuthProvider>
);
Expand Down
Loading
Loading