Skip to content

Commit

Permalink
PR review comments - added groupsOption check for no options
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpzx committed Jun 21, 2024
1 parent 16bd5d4 commit 95a8512
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const DashboardImportForm = (props) => {
dashboardId: values.dashboardId,
environmentUri: values.environment.environmentUri,
description: values.description,
SamlAdminGroupName: values.SamlAdminGroupName,
SamlGroupName: values.SamlAdminGroupName,
tags: values.tags,
terms: values.terms.nodes
? values.terms.nodes.map((t) => t.nodeUri)
Expand Down
50 changes: 35 additions & 15 deletions frontend/src/modules/Notebooks/views/NotebookCreateForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@mui/material';
import { Formik } from 'formik';
import { useSnackbar } from 'notistack';
import { useCallback, useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { Helmet } from 'react-helmet-async';
import { Link as RouterLink, useNavigate } from 'react-router-dom';
import * as Yup from 'yup';
Expand Down Expand Up @@ -486,21 +486,41 @@ const NotebookCreateForm = (props) => {
}
}}
renderInput={(params) => (
<TextField
{...params}
fullWidth
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
<Box>
{groupOptions.length > 0 ? (
<TextField
{...params}
fullWidth
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
label="Team"
onChange={handleChange}
variant="outlined"
/>
) : (
<TextField
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
fullWidth
disabled
label="Team"
value="No teams found for this environment"
variant="outlined"
/>
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
label="Team"
onChange={handleChange}
variant="outlined"
/>
</Box>
)}
/>
</CardContent>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/Omics/views/OmicsRunCreateForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const OmicsRunCreateForm = (props) => {
workflowUri: omicsWorkflow.workflowUri,
parameterTemplate: values.parameterTemplate,
SamlAdminGroupName: values.SamlAdminGroupName,
dataset: values.dataset
destination: values.dataset
})
);
setStatus({ success: true });
Expand Down
90 changes: 66 additions & 24 deletions frontend/src/modules/S3_Datasets/views/DatasetCreateForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,21 +517,41 @@ const DatasetCreateForm = (props) => {
}
}}
renderInput={(params) => (
<TextField
{...params}
fullWidth
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
<Box>
{groupOptions.length > 0 ? (
<TextField
{...params}
fullWidth
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
label="Team"
onChange={handleChange}
variant="outlined"
/>
) : (
<TextField
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
fullWidth
disabled
label="Team"
value="No teams found for this environment"
variant="outlined"
/>
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
label="Team"
onChange={handleChange}
variant="outlined"
/>
</Box>
)}
/>
</CardContent>
Expand All @@ -548,17 +568,39 @@ const DatasetCreateForm = (props) => {
}
}}
renderInput={(params) => (
<TextField
{...params}
fullWidth
error={Boolean(
touched.stewards && errors.stewards
<Box>
{groupOptions.length > 0 ? (
<TextField
{...params}
fullWidth
error={Boolean(
touched.stewards && errors.stewards
)}
helperText={
touched.stewards && errors.stewards
}
label="Stewards"
onChange={handleChange}
variant="outlined"
/>
) : (
<TextField
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
fullWidth
disabled
label="Stewards"
value="No teams found for this environment"
variant="outlined"
/>
)}
helperText={touched.stewards && errors.stewards}
label="Stewards"
onChange={handleChange}
variant="outlined"
/>
</Box>
)}
/>
</CardContent>
Expand Down
88 changes: 64 additions & 24 deletions frontend/src/modules/S3_Datasets/views/DatasetImportForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,21 +581,41 @@ const DatasetImportForm = (props) => {
}
}}
renderInput={(params) => (
<TextField
{...params}
fullWidth
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
<Box>
{groupOptions.length > 0 ? (
<TextField
{...params}
fullWidth
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
label="Team"
onChange={handleChange}
variant="outlined"
/>
) : (
<TextField
error={Boolean(
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
fullWidth
disabled
label="Team"
value="No teams found for this environment"
variant="outlined"
/>
)}
helperText={
touched.SamlAdminGroupName &&
errors.SamlAdminGroupName
}
label="Team"
onChange={handleChange}
variant="outlined"
/>
</Box>
)}
/>
</CardContent>
Expand All @@ -612,17 +632,37 @@ const DatasetImportForm = (props) => {
}
}}
renderInput={(params) => (
<TextField
{...params}
fullWidth
error={Boolean(
touched.stewards && errors.stewards
<Box>
{groupOptions.length > 0 ? (
<TextField
{...params}
fullWidth
error={Boolean(
touched.stewards && errors.stewards
)}
helperText={
touched.stewards && errors.stewards
}
label="Stewards"
onChange={handleChange}
variant="outlined"
/>
) : (
<TextField
error={Boolean(
touched.stewards && errors.stewards
)}
helperText={
touched.stewards && errors.stewards
}
fullWidth
disabled
label="Stewards"
value="No teams found for this environment"
variant="outlined"
/>
)}
helperText={touched.stewards && errors.stewards}
label="Stewards"
onChange={handleChange}
variant="outlined"
/>
</Box>
)}
/>
</CardContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,37 @@ export const EnvironmentTeamDatasetsDropdown = (props) => {
}
}}
renderInput={(params) => (
<TextField
{...params}
fullWidth
error={Boolean(
touched.SamlAdminGroupName && errors.SamlAdminGroupName
<Box>
{groupOptions.length > 0 ? (
<TextField
{...params}
fullWidth
error={Boolean(
touched.SamlAdminGroupName && errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName && errors.SamlAdminGroupName
}
label="Team"
onChange={handleChange}
variant="outlined"
/>
) : (
<TextField
error={Boolean(
touched.SamlAdminGroupName && errors.SamlAdminGroupName
)}
helperText={
touched.SamlAdminGroupName && errors.SamlAdminGroupName
}
fullWidth
disabled
label="Team"
value="No teams found for this environment"
variant="outlined"
/>
)}
helperText={
touched.SamlAdminGroupName && errors.SamlAdminGroupName
}
label="Team"
onChange={handleChange}
variant="outlined"
/>
</Box>
)}
/>
</CardContent>
Expand All @@ -222,15 +240,29 @@ export const EnvironmentTeamDatasetsDropdown = (props) => {
}
}}
renderInput={(params) => (
<TextField
{...params}
fullWidth
error={Boolean(touched.dataset && errors.dataset)}
helperText={touched.dataset && errors.dataset}
label="Select S3 Output Dataset"
onChange={handleChange}
variant="outlined"
/>
<Box>
{datasetOptions.length > 0 ? (
<TextField
{...params}
fullWidth
error={Boolean(touched.dataset && errors.dataset)}
helperText={touched.dataset && errors.dataset}
label="Select S3 Output Dataset"
onChange={handleChange}
variant="outlined"
/>
) : (
<TextField
error={Boolean(touched.dataset && errors.dataset)}
helperText={touched.dataset && errors.dataset}
fullWidth
disabled
label="Select S3 Output Dataset"
value="No datasets found for this team in this environment"
variant="outlined"
/>
)}
</Box>
)}
/>
</CardContent>
Expand Down
Loading

0 comments on commit 95a8512

Please sign in to comment.