-
Notifications
You must be signed in to change notification settings - Fork 21
Fix/develop bugs #1072
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
base: develop
Are you sure you want to change the base?
Fix/develop bugs #1072
Changes from 3 commits
655708c
6866899
f61db01
dc68910
8a87585
8645b60
16fbb4e
52fd1c5
733cc9c
526365a
2897d6d
2f6011e
a05d63e
135453c
6c80405
75abbbf
40e1e4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,3 +14,6 @@ output/**/*.* | |
|
|
||
| .env | ||
| .history/ | ||
|
|
||
| # Local JWT secret used only for development | ||
| bbbeasy-backend/tmp/jwt.secret | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ approvedGitRepositories: | |
|
|
||
| enableScripts: true | ||
|
|
||
| nodeLinker: node-modules | ||
| nodeLinker: pnp | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Yarn runtime path not tracked Frontend config switches to nodeLinker: pnp while yarnPath points to .yarn/releases/yarn-4.16.0.cjs, but .gitignore ignores .yarn/*, so fresh clones/CI can fail to run Yarn unless that runtime is provisioned out-of-band. This PR increases the likelihood of install/build failures by changing the linker mode without ensuring the configured Yarn runtime path is available. Agent Prompt
|
||
|
|
||
| npmMinimalAgeGate: 0 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,9 +53,10 @@ interface IProps { | |
| } | ||
|
|
||
| const App: React.FC<IProps> = ({ routes, isSider, logs }) => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| const [currentUser, setCurrentUser] = React.useState<UserType | null>(null); | ||
| const [currentSession, setCurrentSession] = React.useState<SessionType | null>(null); | ||
| const [isLogged, setIsLogged] = React.useState<boolean>(false); | ||
| const [currentUser, setCurrentUser] = React.useState<UserType | null>(() => AuthService.getCurrentUser()); | ||
| const [currentSession, setCurrentSession] = React.useState<SessionType | null>(() => AuthService.getCurrentSession()); | ||
| const [isLogged, setIsLogged] = React.useState<boolean>(() => Boolean(AuthService.getCurrentUser() && AuthService.getCurrentSession())); | ||
| const isAuthenticated = Boolean(AuthService.getCurrentUser() && AuthService.getCurrentSession()); | ||
|
|
||
| const [dataRooms, setDataRooms] = React.useState<RoomType[]>([]); | ||
| const [dataLabels, setDataLabels] = React.useState<LabelType[]>([]); | ||
|
|
@@ -70,6 +71,7 @@ const App: React.FC<IProps> = ({ routes, isSider, logs }) => { | |
| () => ({ isLogged, setIsLogged, currentUser, setCurrentUser, currentSession, setCurrentSession }), | ||
| [isLogged, currentUser, currentSession] | ||
| ); | ||
| const authViewKey = isLogged ? 'authenticated' : 'anonymous'; | ||
|
|
||
| const customTheme = { | ||
| token: { | ||
|
|
@@ -125,7 +127,7 @@ const App: React.FC<IProps> = ({ routes, isSider, logs }) => { | |
| setCurrentSession(session); | ||
| setIsLogged(true); | ||
|
|
||
| const allowedGroups = Object.keys(user.permissions); | ||
| const allowedGroups = Object.keys(user.permissions ?? {}); | ||
| if (allowedGroups.length > 0) { | ||
| if (AuthService.isAllowedGroup(allowedGroups, 'logs')) { | ||
| Logger.info(logs); | ||
|
|
@@ -152,9 +154,9 @@ const App: React.FC<IProps> = ({ routes, isSider, logs }) => { | |
| direction={LocaleService.direction} | ||
| componentSize="large" | ||
| > | ||
| <UserContext.Provider value={userProvider}> | ||
| <UserContext.Provider key={authViewKey} value={userProvider}> | ||
| <DataContext.Provider value={dataProvider}> | ||
| {isLogged && isSider && <AppSider presets={dataPresets} />} | ||
| {isAuthenticated && isSider && <AppSider presets={dataPresets} />} | ||
| <Layout className="page-layout-body"> | ||
| <AppHeader /> | ||
| <Content className="site-content"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,10 +111,19 @@ | |
| const [isModalVisible, setIsModalVisible] = React.useState<boolean>(false); | ||
| const [isEditing, setIsEditing] = useState<boolean>(false); | ||
| const [errorsEdit, setErrorsEdit] = React.useState({}); | ||
| const [originalPreset, setOriginalPreset] = React.useState<MyPresetType | null>(null); | ||
|
Check warning on line 114 in bbbeasy-frontend/src/components/Presets.tsx
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| const isDefault = preset['name'] == 'default'; | ||
| const deleteEnabled = deleteClickHandler != null && !isDefault; | ||
| const { token } = theme.useToken(); | ||
|
|
||
| const clonePreset = (presetToClone: MyPresetType): MyPresetType => ({ | ||
| ...presetToClone, | ||
| categories: presetToClone.categories.map((category) => ({ | ||
| ...category, | ||
| subcategories: category.subcategories.map((subCategory) => ({ ...subCategory })), | ||
| })), | ||
| }); | ||
|
|
||
| const props = { | ||
| beforeUpload: (file) => { | ||
| const isPNG = file.type === 'image/png' || file.type === 'image/jpeg' || file.type === 'image/jpg'; | ||
|
|
@@ -153,7 +162,10 @@ | |
| const showModal = (title: string, _titleTrans: string, content: SubCategoryType[]) => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Preset changes still ignored Preset edits can still incorrectly show “no_changes” because editPreset returns early when the preset name is unchanged, ignoring category/subcategory config updates. The new originalPreset snapshot added in showModal is never used to fix this comparison, so the user-facing bug this PR targets remains reproducible. Agent Prompt
|
||
| setIsModalVisible(true); | ||
| setModalTitle(title); | ||
| setModalContent(content); | ||
| setOriginalPreset(clonePreset(preset)); | ||
| setModalContent(content.map((item) => ({ ...item }))); | ||
| setFile(null); | ||
| setFileList(null); | ||
|
|
||
| const indexLogo = content.findIndex((item) => item.type === 'file'); | ||
| if (indexLogo > -1 && content[indexLogo].value != '') { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ const AppSider = (props: Props) => { | |
|
|
||
| useEffect(() => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| const user: UserType = AuthService.getCurrentUser(); | ||
| const menuSider = MenuService.getMenuSider(user.permissions); | ||
| const menuSider = MenuService.getMenuSider(user?.permissions ?? {}); | ||
|
|
||
| setMenuItems(menuSider.items); | ||
| setNewMenuItems(menuSider.news); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Null session user indexing
🐞 Bug☼ ReliabilityStartTest/ViewTest now index into $currentUser['id'] without verifying the session returned an array, which can trigger warnings/failures when no user is loaded into the session. Session::get('user') explicitly returns null when currentUser is not set.Agent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools