Release v0.17.2 (#2030)

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2022-05-23 13:18:47 -05:00
committed by GitHub
parent 175b87c355
commit 17684f37d9
26 changed files with 85 additions and 80 deletions

View File

@@ -15,7 +15,7 @@ spec:
serviceAccountName: console-sa
containers:
- name: console
image: 'minio/console:v0.17.1'
image: 'minio/console:v0.17.2'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_OPERATOR_MODE

View File

@@ -32,7 +32,7 @@ spec:
spec:
containers:
- name: console
image: 'minio/console:v0.17.1'
image: 'minio/console:v0.17.2'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_MINIO_SERVER

View File

@@ -1,7 +1,7 @@
{
"files": {
"main.css": "./static/css/main.90d417ae.css",
"main.js": "./static/js/main.7801474b.js",
"main.js": "./static/js/main.55ef3067.js",
"static/js/2483.64c94bc6.chunk.js": "./static/js/2483.64c94bc6.chunk.js",
"static/js/6914.c9671304.chunk.js": "./static/js/6914.c9671304.chunk.js",
"static/js/4209.2b6438a1.chunk.js": "./static/js/4209.2b6438a1.chunk.js",
@@ -16,7 +16,7 @@
"static/js/9251.43d5879d.chunk.js": "./static/js/9251.43d5879d.chunk.js",
"static/js/2338.8430dcc6.chunk.js": "./static/js/2338.8430dcc6.chunk.js",
"static/js/4335.efdb7b8f.chunk.js": "./static/js/4335.efdb7b8f.chunk.js",
"static/js/3061.6f255655.chunk.js": "./static/js/3061.6f255655.chunk.js",
"static/js/3061.95077047.chunk.js": "./static/js/3061.95077047.chunk.js",
"static/js/6763.8e2c073b.chunk.js": "./static/js/6763.8e2c073b.chunk.js",
"static/js/3543.448be99d.chunk.js": "./static/js/3543.448be99d.chunk.js",
"static/js/4061.f26c1196.chunk.js": "./static/js/4061.f26c1196.chunk.js",
@@ -30,7 +30,7 @@
"static/js/7821.88351a18.chunk.js": "./static/js/7821.88351a18.chunk.js",
"static/css/2080.e60508f1.chunk.css": "./static/css/2080.e60508f1.chunk.css",
"static/js/2080.2ddaba07.chunk.js": "./static/js/2080.2ddaba07.chunk.js",
"static/js/1182.5865af16.chunk.js": "./static/js/1182.5865af16.chunk.js",
"static/js/1182.141b8e1c.chunk.js": "./static/js/1182.141b8e1c.chunk.js",
"static/css/9033.e60508f1.chunk.css": "./static/css/9033.e60508f1.chunk.css",
"static/js/9033.ff414eaf.chunk.js": "./static/js/9033.ff414eaf.chunk.js",
"static/css/6633.e60508f1.chunk.css": "./static/css/6633.e60508f1.chunk.css",
@@ -38,7 +38,7 @@
"static/css/2731.e60508f1.chunk.css": "./static/css/2731.e60508f1.chunk.css",
"static/js/2731.2c59ed4f.chunk.js": "./static/js/2731.2c59ed4f.chunk.js",
"static/css/5316.e60508f1.chunk.css": "./static/css/5316.e60508f1.chunk.css",
"static/js/5316.558355d5.chunk.js": "./static/js/5316.558355d5.chunk.js",
"static/js/5316.7b9b1abd.chunk.js": "./static/js/5316.7b9b1abd.chunk.js",
"static/js/2555.190c0fbe.chunk.js": "./static/js/2555.190c0fbe.chunk.js",
"static/js/7585.dd261b31.chunk.js": "./static/js/7585.dd261b31.chunk.js",
"static/js/4847.b6087997.chunk.js": "./static/js/4847.b6087997.chunk.js",
@@ -65,7 +65,7 @@
"static/css/984.e60508f1.chunk.css": "./static/css/984.e60508f1.chunk.css",
"static/js/984.4ead34b2.chunk.js": "./static/js/984.4ead34b2.chunk.js",
"static/js/3956.9b6a6dff.chunk.js": "./static/js/3956.9b6a6dff.chunk.js",
"static/js/9076.46bf2c9e.chunk.js": "./static/js/9076.46bf2c9e.chunk.js",
"static/js/9076.36a8041b.chunk.js": "./static/js/9076.36a8041b.chunk.js",
"static/js/9221.064a4791.chunk.js": "./static/js/9221.064a4791.chunk.js",
"static/js/8896.3600ef1f.chunk.js": "./static/js/8896.3600ef1f.chunk.js",
"static/js/9134.11ed4367.chunk.js": "./static/js/9134.11ed4367.chunk.js",
@@ -148,7 +148,7 @@
"static/js/5026.cbf5a1ed.chunk.js": "./static/js/5026.cbf5a1ed.chunk.js",
"index.html": "./index.html",
"main.90d417ae.css.map": "./static/css/main.90d417ae.css.map",
"main.7801474b.js.map": "./static/js/main.7801474b.js.map",
"main.55ef3067.js.map": "./static/js/main.55ef3067.js.map",
"2483.64c94bc6.chunk.js.map": "./static/js/2483.64c94bc6.chunk.js.map",
"6914.c9671304.chunk.js.map": "./static/js/6914.c9671304.chunk.js.map",
"4209.2b6438a1.chunk.js.map": "./static/js/4209.2b6438a1.chunk.js.map",
@@ -163,7 +163,7 @@
"9251.43d5879d.chunk.js.map": "./static/js/9251.43d5879d.chunk.js.map",
"2338.8430dcc6.chunk.js.map": "./static/js/2338.8430dcc6.chunk.js.map",
"4335.efdb7b8f.chunk.js.map": "./static/js/4335.efdb7b8f.chunk.js.map",
"3061.6f255655.chunk.js.map": "./static/js/3061.6f255655.chunk.js.map",
"3061.95077047.chunk.js.map": "./static/js/3061.95077047.chunk.js.map",
"6763.8e2c073b.chunk.js.map": "./static/js/6763.8e2c073b.chunk.js.map",
"3543.448be99d.chunk.js.map": "./static/js/3543.448be99d.chunk.js.map",
"4061.f26c1196.chunk.js.map": "./static/js/4061.f26c1196.chunk.js.map",
@@ -177,7 +177,7 @@
"7821.88351a18.chunk.js.map": "./static/js/7821.88351a18.chunk.js.map",
"2080.e60508f1.chunk.css.map": "./static/css/2080.e60508f1.chunk.css.map",
"2080.2ddaba07.chunk.js.map": "./static/js/2080.2ddaba07.chunk.js.map",
"1182.5865af16.chunk.js.map": "./static/js/1182.5865af16.chunk.js.map",
"1182.141b8e1c.chunk.js.map": "./static/js/1182.141b8e1c.chunk.js.map",
"9033.e60508f1.chunk.css.map": "./static/css/9033.e60508f1.chunk.css.map",
"9033.ff414eaf.chunk.js.map": "./static/js/9033.ff414eaf.chunk.js.map",
"6633.e60508f1.chunk.css.map": "./static/css/6633.e60508f1.chunk.css.map",
@@ -185,7 +185,7 @@
"2731.e60508f1.chunk.css.map": "./static/css/2731.e60508f1.chunk.css.map",
"2731.2c59ed4f.chunk.js.map": "./static/js/2731.2c59ed4f.chunk.js.map",
"5316.e60508f1.chunk.css.map": "./static/css/5316.e60508f1.chunk.css.map",
"5316.558355d5.chunk.js.map": "./static/js/5316.558355d5.chunk.js.map",
"5316.7b9b1abd.chunk.js.map": "./static/js/5316.7b9b1abd.chunk.js.map",
"2555.190c0fbe.chunk.js.map": "./static/js/2555.190c0fbe.chunk.js.map",
"7585.dd261b31.chunk.js.map": "./static/js/7585.dd261b31.chunk.js.map",
"4847.b6087997.chunk.js.map": "./static/js/4847.b6087997.chunk.js.map",
@@ -212,7 +212,7 @@
"984.e60508f1.chunk.css.map": "./static/css/984.e60508f1.chunk.css.map",
"984.4ead34b2.chunk.js.map": "./static/js/984.4ead34b2.chunk.js.map",
"3956.9b6a6dff.chunk.js.map": "./static/js/3956.9b6a6dff.chunk.js.map",
"9076.46bf2c9e.chunk.js.map": "./static/js/9076.46bf2c9e.chunk.js.map",
"9076.36a8041b.chunk.js.map": "./static/js/9076.36a8041b.chunk.js.map",
"9221.064a4791.chunk.js.map": "./static/js/9221.064a4791.chunk.js.map",
"8896.3600ef1f.chunk.js.map": "./static/js/8896.3600ef1f.chunk.js.map",
"9134.11ed4367.chunk.js.map": "./static/js/9134.11ed4367.chunk.js.map",
@@ -296,6 +296,6 @@
},
"entrypoints": [
"static/css/main.90d417ae.css",
"static/js/main.7801474b.js"
"static/js/main.55ef3067.js"
]
}

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="/"/><meta content="width=device-width,initial-scale=1" name="viewport"/><meta content="#081C42" media="(prefers-color-scheme: light)" name="theme-color"/><meta content="#081C42" media="(prefers-color-scheme: dark)" name="theme-color"/><meta content="MinIO Console" name="description"/><link href="./styles/root-styles.css" rel="stylesheet"/><link href="./apple-icon-180x180.png" rel="apple-touch-icon" sizes="180x180"/><link href="./favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/><link href="./favicon-96x96.png" rel="icon" sizes="96x96" type="image/png"/><link href="./favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/><link href="./manifest.json" rel="manifest"/><link color="#3a4e54" href="./safari-pinned-tab.svg" rel="mask-icon"/><title>MinIO Console</title><script defer="defer" src="./static/js/main.7801474b.js"></script><link href="./static/css/main.90d417ae.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"><div id="preload"><img src="./images/background.svg"/> <img src="./images/background-wave-orig2.svg"/></div><div id="loader-block"><img src="./Loader.svg"/></div></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="/"/><meta content="width=device-width,initial-scale=1" name="viewport"/><meta content="#081C42" media="(prefers-color-scheme: light)" name="theme-color"/><meta content="#081C42" media="(prefers-color-scheme: dark)" name="theme-color"/><meta content="MinIO Console" name="description"/><link href="./styles/root-styles.css" rel="stylesheet"/><link href="./apple-icon-180x180.png" rel="apple-touch-icon" sizes="180x180"/><link href="./favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/><link href="./favicon-96x96.png" rel="icon" sizes="96x96" type="image/png"/><link href="./favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/><link href="./manifest.json" rel="manifest"/><link color="#3a4e54" href="./safari-pinned-tab.svg" rel="mask-icon"/><title>MinIO Console</title><script defer="defer" src="./static/js/main.55ef3067.js"></script><link href="./static/css/main.90d417ae.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"><div id="preload"><img src="./images/background.svg"/> <img src="./images/background-wave-orig2.svg"/></div><div id="loader-block"><img src="./Loader.svg"/></div></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9076],{16502:function(e,n,t){t(72791);var r=t(11135),s=t(25787),o=t(80184);n.Z=(0,s.Z)((function(e){return(0,r.Z)({headerContainer:{backgroundColor:"#e78794",borderRadius:3,marginBottom:20,padding:1,paddingBottom:15},labelHeadline:{color:"#000000",fontSize:14,marginLeft:20},labelText:{color:"#000000",fontSize:14,marginLeft:20,marginRight:40}})}))((function(e){var n=e.classes,t=e.label,r=e.title;return(0,o.jsxs)("div",{className:n.headerContainer,children:[(0,o.jsx)("h4",{className:n.labelHeadline,children:r}),(0,o.jsx)("div",{className:n.labelText,children:t})]})}))},49076:function(e,n,t){t.r(n);var r=t(37762),s=t(29439),o=t(72791),a=t(60364),i=t(51691),c=t(87995),l=t(9505),u=t(2148),d=t(62410),f=t(45248),h=t(16502),g=t(92983),m=t(81207),v=t(56087),S=t(72401),x=t(80184),p={setErrorSnackMessage:c.Ih},A=(0,a.$j)(null,p);n.default=A((function(e){var n=e.closeDeleteModalAndRefresh,t=e.deleteOpen,a=e.selectedUsers,c=e.setErrorSnackMessage,p=e.history,A=(0,l.Z)((function(){return n(!0)}),(function(e){return c(e)})),Z=(0,s.Z)(A,2),b=Z[0],j=Z[1],y=(0,o.useState)(!0),C=(0,s.Z)(y,2),L=C[0],k=C[1],w=(0,o.useState)(!1),E=(0,s.Z)(w,2),N=E[0],T=E[1],U=(0,o.useState)([]),D=(0,s.Z)(U,2),I=D[0],M=D[1],O=localStorage.getItem("userLoggedIn")||"";if((0,o.useEffect)((function(){a&&m.Z.invoke("POST","/api/v1/users/service-accounts",a).then((function(e){M(e.userServiceAccountList),e.hasSA&&T(!0),k(!1)})).catch((function(e){c(e),k(!1)}))}),[a,c]),!a)return null;var R=a.map((function(e){return(0,x.jsx)("div",{children:(0,x.jsx)("b",{children:e})},e)})),F=[{type:"view",onClick:function(e){p.push("".concat(v.gA.USERS,"/").concat((0,f.LL)(e.userName)))}}],H="Are you sure you want to delete the following "+a.length+" user"+(a.length>1?"s?":"?");return L?(0,x.jsx)(S.Z,{}):(0,x.jsx)(u.Z,{title:"Delete User".concat(a.length>1?"s":""),confirmText:"Delete",isOpen:t,titleIcon:(0,x.jsx)(d.NvT,{}),isLoading:b,onConfirm:function(){var e,t=(0,r.Z)(a);try{for(t.s();!(e=t.n()).done;){var s=e.value;s===O?(c({errorMessage:"Cannot delete currently logged in user",detailedError:"Cannot delete currently logged in user ".concat(O)}),n(!0)):j("DELETE","/api/v1/user/".concat((0,f.LL)(s)))}}catch(o){t.e(o)}finally{t.f()}},onClose:function(){return n(!1)},confirmationContent:(0,x.jsx)(i.Z,{children:N?(0,x.jsxs)(o.Fragment,{children:[(0,x.jsx)(h.Z,{label:"Click on a user to view the full listing of asociated Service Accounts. All Service Accounts associated with a user will be deleted along with the user. Are you sure you want to continue?",title:"Warning: One or more users selected has associated Service Accounts. "}),(0,x.jsx)(g.Z,{itemActions:F,columns:[{label:"Username",elementKey:"userName"},{label:"# Associated Service Accounts",elementKey:"numSAs"}],isLoading:L,records:I,entityName:"User Service Accounts",idField:"userName",customPaperHeight:"250"})]}):(0,x.jsxs)(o.Fragment,{children:[H,R]})})})}))}}]);
//# sourceMappingURL=9076.36a8041b.chunk.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9076],{49076:function(e,n,t){t.r(n);var r=t(37762),o=t(29439),l=(t(72791),t(60364)),s=t(51691),u=t(9505),i=t(2148),c=t(62410),a=t(45248),d=t(87995),f=t(80184);n.default=function(e){var n=e.closeDeleteModalAndRefresh,t=e.deleteOpen,h=e.selectedUsers,g=(0,l.I0)(),p=(0,u.Z)((function(){return n(!0)}),(function(e){return g((0,d.Ih)(e))})),v=(0,o.Z)(p,2),x=v[0],C=v[1],j=localStorage.getItem("userLoggedIn")||"";if(!h)return null;var y=h.map((function(e){return(0,f.jsx)("div",{children:(0,f.jsx)("b",{children:e})},e)}));return(0,f.jsx)(i.Z,{title:"Delete User".concat(h.length>1?"s":""),confirmText:"Delete",isOpen:t,titleIcon:(0,f.jsx)(c.NvT,{}),isLoading:x,onConfirm:function(){var e,t=(0,r.Z)(h);try{for(t.s();!(e=t.n()).done;){var o=e.value;o===j?((0,d.Ih)({errorMessage:"Cannot delete currently logged in user",detailedError:"Cannot delete currently logged in user ".concat(j)}),n(!0)):C("DELETE","/api/v1/user/".concat((0,a.LL)(o)))}}catch(l){t.e(l)}finally{t.f()}},onClose:function(){return n(!1)},confirmationContent:(0,f.jsxs)(s.Z,{children:["Are you sure you want to delete the following ",h.length," ","user",h.length>1?"s?":"?",(0,f.jsx)("b",{children:y})]})})}}}]);
//# sourceMappingURL=9076.46bf2c9e.chunk.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"static/js/9076.46bf2c9e.chunk.js","mappings":"+OA0FA,UA1DmB,SAAC,GAIK,IAHvBA,EAGsB,EAHtBA,2BACAC,EAEsB,EAFtBA,WACAC,EACsB,EADtBA,cAEMC,GAAWC,EAAAA,EAAAA,MAMjB,GAAyCC,EAAAA,EAAAA,IALpB,kBAAML,GAA2B,MACnC,SAACM,GAAD,OACjBH,GAASI,EAAAA,EAAAA,IAAqBD,OAGhC,eAAOE,EAAP,KAAsBC,EAAtB,KAEMC,EAAeC,aAAaC,QAAQ,iBAAmB,GAE7D,IAAKV,EACH,OAAO,KAET,IAAMW,EAAcX,EAAcY,KAAI,SAACC,GAAD,OACpC,0BACE,uBAAIA,KADIA,MAmBZ,OACE,SAAC,IAAD,CACEC,MAAK,qBAAgBd,EAAce,OAAS,EAAI,IAAM,IACtDC,YAAa,SACbC,OAAQlB,EACRmB,WAAW,SAAC,MAAD,IACXC,UAAWb,EACXc,UArBoB,WAAO,IAAD,YACXpB,GADW,IAC5B,2BAAgC,CAAC,IAAxBa,EAAuB,QAC1BA,IAASL,IACXH,EAAAA,EAAAA,IAAqB,CACnBgB,aAAc,yCACdC,cAAc,0CAAD,OAA4Cd,KAE3DV,GAA2B,IAE3BS,EAAgB,SAAD,wBAA2BgB,EAAAA,EAAAA,IAAgBV,MATlC,gCAsB1BW,QArCY,kBAAM1B,GAA2B,IAsC7C2B,qBACE,UAAC,IAAD,4DACiDzB,EAAce,OAAQ,IADvE,OAEOf,EAAce,OAAS,EAAI,KAAO,KACvC,uBAAIJ","sources":["screens/Console/Users/DeleteUser.tsx"],"sourcesContent":["// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\n\nimport React from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { DialogContentText } from \"@mui/material\";\nimport useApi from \"../Common/Hooks/useApi\";\nimport ConfirmDialog from \"../Common/ModalWrapper/ConfirmDialog\";\nimport { ErrorResponseHandler } from \"../../../common/types\";\nimport { ConfirmDeleteIcon } from \"../../../icons\";\nimport { encodeURLString } from \"../../../common/utils\";\nimport { setErrorSnackMessage } from \"../../../systemSlice\";\n\ninterface IDeleteUserProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedUsers: string[] | null;\n}\n\nconst DeleteUser = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedUsers,\n}: IDeleteUserProps) => {\n const dispatch = useDispatch();\n const onDelSuccess = () => closeDeleteModalAndRefresh(true);\n const onDelError = (err: ErrorResponseHandler) =>\n dispatch(setErrorSnackMessage(err));\n const onClose = () => closeDeleteModalAndRefresh(false);\n\n const [deleteLoading, invokeDeleteApi] = useApi(onDelSuccess, onDelError);\n\n const userLoggedIn = localStorage.getItem(\"userLoggedIn\") || \"\";\n\n if (!selectedUsers) {\n return null;\n }\n const renderUsers = selectedUsers.map((user) => (\n <div key={user}>\n <b>{user}</b>\n </div>\n ));\n\n const onConfirmDelete = () => {\n for (let user of selectedUsers) {\n if (user === userLoggedIn) {\n setErrorSnackMessage({\n errorMessage: \"Cannot delete currently logged in user\",\n detailedError: `Cannot delete currently logged in user ${userLoggedIn}`,\n });\n closeDeleteModalAndRefresh(true);\n } else {\n invokeDeleteApi(\"DELETE\", `/api/v1/user/${encodeURLString(user)}`);\n }\n }\n };\n\n return (\n <ConfirmDialog\n title={`Delete User${selectedUsers.length > 1 ? \"s\" : \"\"}`}\n confirmText={\"Delete\"}\n isOpen={deleteOpen}\n titleIcon={<ConfirmDeleteIcon />}\n isLoading={deleteLoading}\n onConfirm={onConfirmDelete}\n onClose={onClose}\n confirmationContent={\n <DialogContentText>\n Are you sure you want to delete the following {selectedUsers.length}{\" \"}\n user{selectedUsers.length > 1 ? \"s?\" : \"?\"}\n <b>{renderUsers}</b>\n </DialogContentText>\n }\n />\n );\n};\n\nexport default DeleteUser;\n"],"names":["closeDeleteModalAndRefresh","deleteOpen","selectedUsers","dispatch","useDispatch","useApi","err","setErrorSnackMessage","deleteLoading","invokeDeleteApi","userLoggedIn","localStorage","getItem","renderUsers","map","user","title","length","confirmText","isOpen","titleIcon","isLoading","onConfirm","errorMessage","detailedError","encodeURLString","onClose","confirmationContent"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -53,25 +53,24 @@ const DeleteUser = ({
const [userSAList, setUserSAList] = useState<userSACount[]>([]);
const userLoggedIn = localStorage.getItem("userLoggedIn") || "";
useEffect(() => {
if(selectedUsers) {
useEffect(() => {
if (selectedUsers) {
api
.invoke("POST", `/api/v1/users/service-accounts`, selectedUsers)
.then((res) => {
setUserSAList(res.userServiceAccountList) ;
if (res.hasSA) {
setHasSA(true)
}
setLoadingSA(false);
})
.catch((err: ErrorResponseHandler) => {
setErrorSnackMessage(err);
setLoadingSA(false);
});
}
}, [selectedUsers, setErrorSnackMessage]);
.invoke("POST", `/api/v1/users/service-accounts`, selectedUsers)
.then((res) => {
setUserSAList(res.userServiceAccountList);
if (res.hasSA) {
setHasSA(true);
}
setLoadingSA(false);
})
.catch((err: ErrorResponseHandler) => {
setErrorSnackMessage(err);
setLoadingSA(false);
});
}
}, [selectedUsers, setErrorSnackMessage]);
if (!selectedUsers) {
return null;
@@ -80,7 +79,7 @@ const DeleteUser = ({
<div key={user}>
<b>{user}</b>
</div>
));
));
const viewAction = (selectionElement: any): void => {
history.push(
`${IAM_PAGES.USERS}/${encodeURLString(selectionElement.userName)}`
@@ -110,15 +109,18 @@ const DeleteUser = ({
interface userSACount {
userName: string;
numSAs: number;
}
}
const noSAtext = "Are you sure you want to delete the following " + selectedUsers.length+" "+
"user"+ (selectedUsers.length > 1 ? "s?" : "?")
const noSAtext =
"Are you sure you want to delete the following " +
selectedUsers.length +
" " +
"user" +
(selectedUsers.length > 1 ? "s?" : "?");
return (
loadingSA ?
return loadingSA ? (
<Loader />
:
) : (
<ConfirmDialog
title={`Delete User${selectedUsers.length > 1 ? "s" : ""}`}
confirmText={"Delete"}
@@ -128,32 +130,35 @@ const DeleteUser = ({
onConfirm={onConfirmDelete}
onClose={onClose}
confirmationContent={
<DialogContentText>
{hasSA ?
<Fragment>
<WarningMessage
label = "Click on a user to view the full listing of asociated Service Accounts. All Service Accounts associated with a user will be deleted along with the user. Are you sure you want to continue?"
title = "Warning: One or more users selected has associated Service Accounts. "
/>
<TableWrapper
itemActions={tableActions}
columns={[
{ label: "Username", elementKey: "userName" },
{ label: "# Associated Service Accounts", elementKey: "numSAs" },
]}
isLoading={loadingSA}
records={userSAList}
entityName="User Service Accounts"
idField="userName"
customPaperHeight="250"
/>
</Fragment>
: <Fragment>
{noSAtext}
{renderUsers}
</Fragment>
}
<DialogContentText>
{hasSA ? (
<Fragment>
<WarningMessage
label="Click on a user to view the full listing of asociated Service Accounts. All Service Accounts associated with a user will be deleted along with the user. Are you sure you want to continue?"
title="Warning: One or more users selected has associated Service Accounts. "
/>
<TableWrapper
itemActions={tableActions}
columns={[
{ label: "Username", elementKey: "userName" },
{
label: "# Associated Service Accounts",
elementKey: "numSAs",
},
]}
isLoading={loadingSA}
records={userSAList}
entityName="User Service Accounts"
idField="userName"
customPaperHeight="250"
/>
</Fragment>
) : (
<Fragment>
{noSAtext}
{renderUsers}
</Fragment>
)}
</DialogContentText>
}
/>