Skip to content
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

107 bulk enroll um user #177

Merged

Conversation

chrisrrowland
Copy link
Contributor

Closes #107

Depends on #108 for completion.

UX for adding UM users, complete up until actually submitting to the backend.

Includes new single section creation component and a section selection component that supports single and multi select. Single select is used in this feature.

chrisrrowland and others added 30 commits July 9, 2021 09:46
Disable submit while processing.
validate uniqnames and roles
to login id per requirement change

no longer applying uniqname regex
Comment on lines +167 to +172
const isValidLoginID = (loginID: string): boolean => {
// return uniqname.match(UNIQNAME_REGEX) !== null
// Don't apply any validation here, just pass anything through
// Flag this function for deletion in 3.. 2.. 1...
return true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this code be removed? since it just returning true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure the reviewers will vote yes. I left it there b/c it seemed reasonable that we might want to do some validation of the text.. I had been applying the aforementioned uniqname regex. Maybe there is nothing to do here ever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any value that is absolutely 100% always illegal every single time in the client?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be removed if we are not validating anything. We can added it back if it is needed in future since all the validation is happening in BE

@chrisrrowland
Copy link
Contributor Author

chrisrrowland commented Aug 30, 2021

Screen.Recording.2021-08-30.at.2.27.48.PM.mov

The swaggerUI button should be place very bottom, currently it is conflicting with user section.

I'm sure I'm doing something incorrect CSS wise here. I'm looking into it but its not obvious to me.

Addressed it. Not sure if it was the right fix but it works.

}
}

export class CanvaCoursesSectionNameValidator {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisrrowland This is nice addition, that you are checking if the section name you created already exist or not. I did not think about this use case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I misspelled it 🤦‍♂️

If there are other client side validations to be done they should be easy to add.

@pushyamig
Copy link
Contributor

Screen Shot 2021-08-31 at 9 25 16 AM

I think the pop should suggest a sample section name , but currently it is repeat of what show on label. That doesn't help. below is the suggested from wireframe
Screen Shot 2021-08-30 at 2 36 09 PM

@pushyamig
Copy link
Contributor

@chrisrrowland Nice work, this is lot of code and I like the way you modularized the code with create section widget and select section widget and that made the AddUMUser file not too big.

ccm_web/client/src/pages/AddUMUsers.tsx Show resolved Hide resolved
import ValidationErrorTable, { ValidationError } from '../components/ValidationErrorTable'

const USER_ROLE_TEXT = 'Role'
const USER_ID_TEXT = 'Login ID'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 constants can go inside AddUMUsers function since these are not used anywhere else other than in the AddUMUsers

const [file, setFile] = useState<File|undefined>(undefined)
const [enrollments, setEnrollments] = useState<IAddUMUserEnrollment[]|undefined>(undefined)
const [errors, setErrors] = useState<ValidationError[]|undefined>(undefined)
const [isAddingEnrollments, setIsAddingEnrollments] = useState<boolean>(false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see red wiggle line, this will probably go away when we start integrating UI with BE. should we leave this for now for temporarily disable it? I don't know what have been followed in the past.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to disable the wiggle line until the FE/BE integrate or you want to leave it like that?

}
}).catch(e => {
// TODO Not sure how to produce this error in real life
console.log('error parsing file')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this case be handled in case of error? I see that you did handled it in bulk create section case https://github.com/tl-its-umich-edu/canvas-course-manager-next/blob/main/ccm_web/client/src/pages/BulkSectionCreate.tsx#L337

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisrrowland in case of parsing error i feel this should be handled and give a valid message to user. you are already doing that with Bulk create sections case

Comment on lines +167 to +172
const isValidLoginID = (loginID: string): boolean => {
// return uniqname.match(UNIQNAME_REGEX) !== null
// Don't apply any validation here, just pass anything through
// Flag this function for deletion in 3.. 2.. 1...
return true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be removed if we are not validating anything. We can added it back if it is needed in future since all the validation is happening in BE

(
<div className={classes.swaggerLink}>
<Link href={`/swagger?csrfToken=${String(getCSRFToken())}`}>Swagger UI</Link>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The swagger link is looking better now. Thanks for the fix!

@chrisrrowland
Copy link
Contributor Author

Screen Shot 2021-08-31 at 9 25 16 AM

I think the pop should suggest a sample section name , but currently it is repeat of what show on label. That doesn't help. below is the suggested from wireframe
Screen Shot 2021-08-30 at 2 36 09 PM

@chrisrrowland chrisrrowland merged commit 8985c84 into tl-its-umich-edu:main Aug 31, 2021
@chrisrrowland chrisrrowland deleted the 107_bulk_enroll_um_user branch August 31, 2021 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Work on the UI for bulk enroll user
3 participants