Skip to content

Commit

Permalink
Change Password Requirement for IEC Security
Browse files Browse the repository at this point in the history
  • Loading branch information
sude-dewi committed Aug 12, 2024
1 parent fa2d847 commit 085ac3d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
3 changes: 0 additions & 3 deletions packages/react-components/src/Accounts/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const Accounts: React.FC<UserGroupProps> = ({ host, token, userGroupsDefaultSele
const [deletedDialog, setDeletedDialog] = useState(false);
const [deleteRow, setDeleteRow] = useState({});
const [filteringColumnExtensions, setFilteringColumnExtensions] = useState([]);
const [error, setError] = useState(false);
const [errorMessage, setErrorMessage] = useState('');
const getRowId = (row) => row.id;

Expand Down Expand Up @@ -145,7 +144,6 @@ const Accounts: React.FC<UserGroupProps> = ({ host, token, userGroupsDefaultSele
fetchData();
},
(error) => {
setError(true);
setErrorMessage('Passwords must be at least 7 characters');
console.log('Update Account: ', error);
}
Expand Down Expand Up @@ -206,7 +204,6 @@ const Accounts: React.FC<UserGroupProps> = ({ host, token, userGroupsDefaultSele
onSave={handleSubmit}
hasPassword
userGroupsDefaultSelected={userGroupsDefaultSelected}
errorAccount={error}
errorMessage={errorMessage}
/>
<Toolbar />
Expand Down
5 changes: 2 additions & 3 deletions packages/react-components/src/common/Table/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const Popup: React.FC<PopupProps> = ({
hasPassword,
userGroupsDefaultSelected,
errorMessage,
errorAccount,
}) => {
const [error, setError] = useState<boolean>(false);
const [passwordStrengthColor, setPasswordStrengthColor] = useState('red');
Expand Down Expand Up @@ -143,7 +142,7 @@ const Popup: React.FC<PopupProps> = ({
variant="standard"
required={isNew}
value={row.password || ''}
error={!passwordValid || errorAccount}
error={!passwordValid || errorMessage!==''}
helperText={errorMessage}
InputProps={{ endAdornment }}
onChange={onChange}
Expand All @@ -159,7 +158,7 @@ const Popup: React.FC<PopupProps> = ({
required={isNew}
label="Repeat Password"
value={row.repeatPassword || ''}
error={!passwordValid || errorAccount}
error={!passwordValid || errorMessage!==''}
onChange={onChange}
helperText={
(!passwordValid && 'Passwords do not match') ||
Expand Down
4 changes: 1 addition & 3 deletions packages/react-components/src/common/Table/PopupEditing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const PopupEditing = React.memo(
onSave,
hasPassword,
userGroupsDefaultSelected,
errorAccount,
errorMessage,
}: PopupEditingProps) => (
<Plugin>
Expand Down Expand Up @@ -143,7 +142,7 @@ const PopupEditing = React.memo(
}
};

const open = editingRowIds.length > 0 || isNew || errorAccount;
const open = editingRowIds.length > 0 || isNew || errorMessage!=='';

return (
<Popup
Expand All @@ -163,7 +162,6 @@ const PopupEditing = React.memo(
hasPassword={hasPassword}
userGroupsDefaultSelected={userGroupsDefaultSelected}
errorMessage={errorMessage}
errorAccount={errorAccount}
/>
);
}}
Expand Down
2 changes: 0 additions & 2 deletions packages/react-components/src/common/Table/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export interface PopupEditingProps {
* Set User Groups default list when creating a new Account
*/
userGroupsDefaultSelected?: string[];
errorAccount?: boolean;
errorMessage?: string;
}

Expand Down Expand Up @@ -144,7 +143,6 @@ export interface PopupProps {
* Set User Groups default list when creating a new Account
*/
userGroupsDefaultSelected?: string[];
errorAccount?: boolean;
errorMessage?: string;
}

Expand Down

0 comments on commit 085ac3d

Please sign in to comment.