Skip to content

Commit

Permalink
Feature/cplp 3120/user bulk upload (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhigarg-bmw authored Aug 22, 2023
1 parent e716022 commit 7e7f814
Show file tree
Hide file tree
Showing 15 changed files with 766 additions and 8 deletions.
4 changes: 3 additions & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ npm/npmjs/-/p-locate/4.1.0, MIT, approved, clearlydefined
npm/npmjs/-/p-locate/5.0.0, MIT, approved, clearlydefined
npm/npmjs/-/p-retry/4.6.2, MIT, approved, clearlydefined
npm/npmjs/-/p-try/2.2.0, MIT, approved, clearlydefined
npm/npmjs/-/papaparse/5.4.1, MIT, approved, clearlydefined
npm/npmjs/-/param-case/3.0.4, MIT, approved, clearlydefined
npm/npmjs/-/parent-module/1.0.1, MIT, approved, clearlydefined
npm/npmjs/-/parse-json/5.2.0, MIT, approved, clearlydefined
Expand Down Expand Up @@ -1123,7 +1124,7 @@ npm/npmjs/@babel/template/7.22.5, MIT, approved, #9017
npm/npmjs/@babel/traverse/7.22.5, MIT, approved, #8954
npm/npmjs/@babel/types/7.22.5, MIT, approved, #8967
npm/npmjs/@bcoe/v8-coverage/0.2.3, ISC AND MIT, approved, clearlydefined
npm/npmjs/@catena-x/portal-shared-components/2.0.19, Apache-2.0 AND (BSD-3-Clause AND MIT), approved, #9187
npm/npmjs/@catena-x/portal-shared-components/2.0.22, Apache-2.0 AND (BSD-3-Clause AND MIT), approved, #9187
npm/npmjs/@csstools/normalize.css/12.0.0, CC0-1.0, approved, clearlydefined
npm/npmjs/@csstools/postcss-cascade-layers/1.1.1, CC0-1.0, approved, clearlydefined
npm/npmjs/@csstools/postcss-color-function/1.1.1, CC0-1.0 AND (MIT AND W3C-20150513) AND W3C-20150513 AND MIT, approved, #3022
Expand Down Expand Up @@ -1281,6 +1282,7 @@ npm/npmjs/@types/mime/1.3.2, MIT, approved, clearlydefined
npm/npmjs/@types/mime/3.0.1, MIT, approved, clearlydefined
npm/npmjs/@types/node/16.18.36, MIT, approved, #7082
npm/npmjs/@types/node/20.3.1, MIT, approved, clearlydefined
npm/npmjs/@types/papaparse/5.3.7, MIT, approved, clearlydefined
npm/npmjs/@types/parse-json/4.0.0, MIT, approved, clearlydefined
npm/npmjs/@types/prettier/2.7.3, MIT, approved, #9030
npm/npmjs/@types/prop-types/15.7.5, MIT, approved, clearlydefined
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
]
},
"dependencies": {
"@catena-x/portal-shared-components": "^2.0.19",
"@catena-x/portal-shared-components": "^2.0.22",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@hookform/error-message": "^2.0.1",
"@mui/icons-material": "^5.11.16",
"@mui/material": "^5.13.4",
"@react-hook/cache": "^1.1.1",
"@reduxjs/toolkit": "^1.9.5",
"@types/papaparse": "^5.3.7",
"axios": "^1.4.0",
"buffer": "^6.0.3",
"dayjs": "^1.11.8",
Expand All @@ -43,6 +44,7 @@
"lodash.debounce": "^4.0.8",
"lodash.uniq": "^4.5.0",
"nanoid": "^4.0.2",
"papaparse": "^5.4.1",
"qs": "^6.11.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
3 changes: 3 additions & 0 deletions public/user-bulk-load.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FirstName,LastName,Email
Clark1,Kent1,[email protected]
Clark2,Kent2,[email protected]
41 changes: 40 additions & 1 deletion src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@
"title": "User Liste",
"details": "Details",
"add": "User hinzufügen",
"addMultiple": "Add Multiple users",
"noRowsMsg": "No unassigned user available. All users have at least one app role assigned."
},
"appUserDetails": {
Expand Down Expand Up @@ -666,6 +667,43 @@
"subtitle": "The user cannot enter his account until he has set a new password."
}
},
"addMultipleUsers": {
"heading": "Add user account by bulk upload",
"intro": "Bulk upload process",
"step1": {
"heading": "Download this upload template by clicking the icon",
"buttonLabel": "Download template"
},
"step2": {
"heading": "Enter user data in upload form",
"linkText": "Guide on how to fill the template"
},
"step3": {
"heading": "Upload form by selecting the form file with the user data"
},
"fileSizeError": "Uploaded file is too big. Maximum 100KB is allowed",
"uploadedFile": {
"fileHeading": "Prepared for upload:",
"addUserRolesHeading": "Add user roles for all users in bulk upload:",
"usersToBeUpload": "users to be uploaded",
"note": "Note:",
"note1": "Only assign roles that apply to all users in the bulk upload file - individual roles can be applied individually later.",
"note2": "Roles for applications can be assigned after the user(s) have been successfully created.",
"note3": "We suggest to assign CX User initially to all bulk uploaded users and set specific user permissions separately.",
"availableRoles": "Available Roles: ",
"roleDesc": "Role Descriptions"
},
"success": {
"userUploaded": "Users successfully uploaded",
"userFailed": "User uploads failed",
"errorUsersLabel": "Errors have occured for the following usernames: <br/> Please check their entries in the upload file and try upload it again."
},
"error": {
"note": "Note:",
"description": "The upload failed due to technical issue. Please try it later once again or contact your administrator.",
"details": "Details: "
}
},
"technicalUser": {
"serviceaccount": "Technischer Benutzer",
"create": "Technischen Nutzer anlegen",
Expand Down Expand Up @@ -1652,7 +1690,8 @@
"next": "Next",
"success": "Success",
"error": "Error",
"retry": "Retry"
"retry": "Retry",
"exit": "exit"
},
"state": {
"enabled": "aktiv",
Expand Down
41 changes: 40 additions & 1 deletion src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@
"title": "User List",
"details": "Details",
"add": "Add user",
"addMultiple": "Add Multiple users",
"noRowsMsg": "No unassigned user available. All users have at least one app role assigned."
},
"appUserDetails": {
Expand Down Expand Up @@ -665,6 +666,43 @@
"subtitle": "The user cannot enter his account until he has set a new password."
}
},
"addMultipleUsers": {
"heading": "Add user account by bulk upload",
"intro": "Bulk upload process",
"step1": {
"heading": "Download this upload template by clicking the icon",
"buttonLabel": "Download template"
},
"step2": {
"heading": "Enter user data in upload form",
"linkText": "Guide on how to fill the template"
},
"step3": {
"heading": "Upload form by selecting the form file with the user data"
},
"fileSizeError": "Uploaded file is too big. Maximum 100KB is allowed",
"uploadedFile": {
"fileHeading": "Prepared for upload:",
"addUserRolesHeading": "Add user roles for all users in bulk upload:",
"usersToBeUpload": "users to be uploaded",
"note": "Note:",
"note1": "Only assign roles that apply to all users in the bulk upload file - individual roles can be applied individually later.",
"note2": "Roles for applications can be assigned after the user(s) have been successfully created.",
"note3": "We suggest to assign CX User initially to all bulk uploaded users and set specific user permissions separately.",
"availableRoles": "Available Roles: ",
"roleDesc": "Role Descriptions"
},
"success": {
"userUploaded": "Users successfully uploaded",
"userFailed": "User uploads failed",
"errorUsersLabel": "Errors have occured for the following usernames: <br/> Please check their entries in the upload file and try upload it again."
},
"error": {
"note": "Note:",
"description": "The upload failed due to technical issue. Please try it later once again or contact your administrator.",
"details": "Details: "
}
},
"technicalUser": {
"serviceaccount": "Service Account",
"create": "Create technical user",
Expand Down Expand Up @@ -1615,7 +1653,8 @@
"next": "Next",
"success": "Success",
"error": "Error",
"retry": "Retry"
"retry": "Retry",
"exit": "exit"
},
"state": {
"enabled": "enabled",
Expand Down
141 changes: 141 additions & 0 deletions src/components/overlays/AddMultipleUser/AddMultipleUser.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
.mb-20 {
margin-bottom: 20px !important;
}

.addMultipleUsers {
text-align: center !important;
margin: 0 auto;

.number {
border: 1px solid #0f71cb;
color: #0f71cb;
border-radius: 50%;
display: inline-block;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
font-size: 15px;
margin-bottom: 10px;
}

.secondStep {
margin: 30px;

.linkText {
width: 100%;
display: inline-block;
}

.editIcon {
color: #0f71cb;
cursor: pointer;
}
}
}

.uploadedFileMain {
.fileDetailsSection {
display: flex;

.documentMain {
display: flex;
width: 50%;

.documentIcon {
color: #0f71cb;
background-color: #dbe9f7;
height: 50px;
width: 50px;
border-radius: 5px;

.icon {
margin: 14px;
}
.number {
text-align: center;
line-height: 50px;
}
}

.documentName {
margin: 10px 20px;
}
}
}

.roleDescLink {
display: flex;
font-size: 14px;
text-decoration: none;
}

.rolesSection {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
}

.successSection {
.uploadedDetailsSection {
display: flex;

.userDetailsMain {
display: flex;
width: 50%;

.userSuccess {
color: #5bc785;
background-color: #f0f5d5;
height: 50px;
width: 50px;
border-radius: 5px;
}

.userError {
color: #e62722;
background-color: #fee7e2;
height: 50px;
width: 50px;
border-radius: 5px;
}

.number {
text-align: center;
line-height: 50px;
}

.detailLabel {
margin: 10px 20px;
}
}
}

.errorUsersLabel {
color: #da241e;
margin-left: 10px;
}

table {
max-height: 225px;
overflow: auto;
display: block;

tbody {
display: table;
width: 100%;
}
}

/* scrollbar width */
::-webkit-scrollbar {
width: 5px;
height: 10px;
}

/* scrollbar Handle */
::-webkit-scrollbar-thumb {
background: #4d73d5;
border-radius: 10px;
}
}
Loading

0 comments on commit 7e7f814

Please sign in to comment.