Skip to content

Commit 39a37de

Browse files
authored
Merge branch 'master' into svcacct-property
2 parents ba0684c + 920fc7d commit 39a37de

File tree

18 files changed

+284
-459
lines changed

18 files changed

+284
-459
lines changed

models/login_details.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/src/ProtectedRoutes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const ProtectedRoute = ({ Component }: ProtectedRouteProps) => {
6464
dispatch(saveSessionResponse(res));
6565
dispatch(userLogged(true));
6666
setSessionLoading(false);
67-
dispatch(globalSetDistributedSetup(res.distributedMode || false));
67+
dispatch(globalSetDistributedSetup(res?.distributedMode || false));
6868

6969
if (res.customStyles && res.customStyles !== "") {
7070
const overrideColorVariants = getOverrideColorVariants(

portal-ui/src/api/consoleApi.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ export interface LoginDetails {
466466
| "service-account"
467467
| "redirect-service-account";
468468
redirectRules?: RedirectRule[];
469-
isDirectPV?: boolean;
470469
isK8S?: boolean;
471470
animatedLogin?: boolean;
472471
}

portal-ui/src/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Api, HttpResponse, Error, FullRequestParams } from "./consoleApi";
22

33
export let api = new Api();
4+
api.baseUrl = `${new URL(document.baseURI).pathname}api/v1`;
45
const internalRequestFunc = api.request;
56
api.request = async <T = any, E = any>({
67
body,

portal-ui/src/screens/Console/Account/Account.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,22 @@ const Account = () => {
247247
disabled={userIDP}
248248
/>
249249
</SecureComponent>
250-
<Button
251-
id={"create-service-account"}
252-
onClick={() => {
253-
navigate(`${IAM_PAGES.ACCOUNT_ADD}`);
254-
}}
255-
label={`Create access key`}
256-
icon={<AddIcon />}
257-
variant={"callAction"}
258-
/>
250+
<SecureComponent
251+
scopes={[IAM_SCOPES.ADMIN_CREATE_SERVICEACCOUNT]}
252+
resource={CONSOLE_UI_RESOURCE}
253+
matchAll
254+
errorProps={{ disabled: true }}
255+
>
256+
<Button
257+
id={"create-service-account"}
258+
onClick={() => {
259+
navigate(`${IAM_PAGES.ACCOUNT_ADD}`);
260+
}}
261+
label={`Create access key`}
262+
icon={<AddIcon />}
263+
variant={"callAction"}
264+
/>
265+
</SecureComponent>
259266
</Box>
260267
</Grid>
261268

portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,33 +285,21 @@ const BasicDashboard = ({ usage }: IDashboardProps) => {
285285
<TimeStatItem
286286
icon={<StorageIcon />}
287287
label={"Backend type"}
288-
value={
289-
usage?.backend?.backendType
290-
? usage.backend.backendType
291-
: "Unknown"
292-
}
288+
value={usage?.backend?.backendType ?? "Unknown"}
293289
/>
294290
</Grid>
295291
<Grid item xs={4}>
296292
<TimeStatItem
297293
icon={<FormatDrivesIcon />}
298294
label={"Standard storage class parity"}
299-
value={
300-
usage?.backend?.standardSCParity
301-
? usage.backend.standardSCParity.toString()
302-
: "n/a"
303-
}
295+
value={usage?.backend?.standardSCParity?.toString() ?? "n/a"}
304296
/>
305297
</Grid>
306298
<Grid item xs={4}>
307299
<TimeStatItem
308300
icon={<FormatDrivesIcon />}
309301
label={"Reduced redundancy storage class parity"}
310-
value={
311-
usage?.backend?.standardSCParity
312-
? usage.backend.rrSCParity.toString()
313-
: "n/a"
314-
}
302+
value={usage?.backend?.rrSCParity?.toString() ?? "n/a"}
315303
/>
316304
</Grid>
317305
</Grid>

0 commit comments

Comments
 (0)