Skip to content

Commit

Permalink
fix: fix Clara comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriel-Sautron committed Feb 6, 2025
1 parent fba611b commit 3222572
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions front/src/common/UserSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ const UserSettings = () => {
{
// TODO PACEDTRAIN: Remove switch after development pacedTrain feature
isSuperUser && (
<div className="mt-3 d-flex align-items-center mt-2">
<div className="d-flex align-items-center mt-2">
<SwitchSNCF
id="paced-train-switch"
type="switch"
name={t('operationalStudies/scenario:pacedTrain.pacedTrain')}
checked={userPreferences.pacedTrain}
checked={userPreferences.showPacedTrains}
onChange={() =>
dispatch(
updateUserPreferences({
...userPreferences,
pacedTrain: !userPreferences.pacedTrain,
showPacedTrains: !userPreferences.showPacedTrains,
})
)
}
Expand Down
6 changes: 3 additions & 3 deletions front/src/reducers/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface UserState {
loginError?: ApiError;
username: string;
// TODO PACEDTRAIN: Remove pacedTrain after development pacedTrain feature
userPreferences: { safeWord: string; pacedTrain?: boolean };
userPreferences: { safeWord: string; showPacedTrains?: boolean };
userRoles: BuiltinRole[];
account: Record<string, string>;
}
Expand All @@ -18,7 +18,7 @@ export const userInitialState: UserState = {
loginError: undefined,
username: '',
// TODO PACEDTRAIN: Remove pacedTrain after development pacedTrain feature
userPreferences: { safeWord: '', pacedTrain: false },
userPreferences: { safeWord: '', showPacedTrains: false },
userRoles: [],
account: {},
};
Expand Down Expand Up @@ -50,7 +50,7 @@ export const userSlice = createSlice({
updateUserPreferences(
state,
// TODO PACEDTRAIN: Remove pacedTrain after development pacedTrain feature
action: PayloadAction<{ safeWord: string; pacedTrain?: boolean }>
action: PayloadAction<{ safeWord: string; showPacedTrains?: boolean }>
) {
state.userPreferences = action.payload;
},
Expand Down
3 changes: 3 additions & 0 deletions front/src/reducers/user/userSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export const getUsername = makeUserSelector('username');
export const getUserRoles = makeUserSelector('userRoles');
export const getIsSuperUser = (state: RootState) => getUserRoles(state).includes('Superuser');

// TODO PACEDTRAIN: Remove pacedTrain after development pacedTrain feature
export const getShowPacedTrains = makeUserPreferencesSelector('showPacedTrains');

const makeUserHasAllRequiredRolesSelector =
(requiredRoles: BuiltinRole[]) => (state: RootState) => {
const userRoles = getUserRoles(state);
Expand Down

0 comments on commit 3222572

Please sign in to comment.