Skip to content

Commit

Permalink
Repository form authz groups (#134)
Browse files Browse the repository at this point in the history
* Adding repository groups from company

* Adding repository creation groups inital value
  • Loading branch information
nathannascimentozup authored Nov 17, 2020
1 parent 1445845 commit b7ff02a
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface Props {
const AddRepository: React.FC<Props> = ({ isVisible, onCancel, onConfirm }) => {
const { t } = useTranslation();
const { colors } = useTheme();
const { companyID } = getCurrentCompany();
const { companyID, authzAdmin, authzMember } = getCurrentCompany();
const { dispatchMessage } = useResponseMessage();
const { showSuccessFlash } = useFlashMessage();

Expand All @@ -50,17 +50,17 @@ const AddRepository: React.FC<Props> = ({ isVisible, onCancel, onConfirm }) => {

const [adminGroup, setAdminGroup] = useState<Field>({
isValid: false,
value: '',
value: authzAdmin,
});

const [supervisorGroup, setSupervisorGroup] = useState<Field>({
isValid: false,
value: '',
value: authzAdmin,
});

const [userGroup, setUserGroup] = useState<Field>({
isValid: false,
value: '',
value: authzMember,
});

const resetFields = () => {
Expand Down Expand Up @@ -140,6 +140,7 @@ const AddRepository: React.FC<Props> = ({ isVisible, onCancel, onConfirm }) => {
<Input
label={t('REPOSITORIES_SCREEN.GROUP_NAME')}
onChangeValue={(field: Field) => setAdminGroup(field)}
initialValue={adminGroup.value}
name="adminGroup"
type="text"
width="100%"
Expand All @@ -152,6 +153,7 @@ const AddRepository: React.FC<Props> = ({ isVisible, onCancel, onConfirm }) => {
<Input
label={t('REPOSITORIES_SCREEN.GROUP_NAME')}
onChangeValue={(field: Field) => setSupervisorGroup(field)}
initialValue={supervisorGroup.value}
name="supervisorGroup"
type="text"
width="100%"
Expand All @@ -164,6 +166,7 @@ const AddRepository: React.FC<Props> = ({ isVisible, onCancel, onConfirm }) => {
<Input
label={t('REPOSITORIES_SCREEN.GROUP_NAME')}
onChangeValue={(field: Field) => setUserGroup(field)}
initialValue={userGroup.value}
name="userGroup"
type="text"
width="100%"
Expand Down

0 comments on commit b7ff02a

Please sign in to comment.