Skip to content

Commit

Permalink
upcoming: [M3-8218] - Obj fix for crashing accesskey page when releva…
Browse files Browse the repository at this point in the history
…nt customer tags are not added. (#10555)

* Fix crashing access key page.

* code cleanup

* Added changeset: Obj fix for crashing accesskey page when relevant customer tags are not added
  • Loading branch information
cpathipa authored Jun 10, 2024
1 parent fee89b8 commit 87e0fcb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Obj fix for crashing accesskey page when relevant customer tags are not added ([#10555](https://github.com/linode/manager/pull/10555))
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const HostNameTableCell = ({

const { regions } = storageKeyData;

if (!regionsLookup || !regionsData || regions.length === 0) {
if (!regionsLookup || !regionsData || !regions || regions.length === 0) {
return <TableCell>None</TableCell>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export const OMC_AccessKeyDrawer = (props: AccessKeyDrawerProps) => {
!createMode && objectStorageKey ? objectStorageKey.label : '';

const initialRegions =
!createMode && objectStorageKey
? objectStorageKey.regions?.map((region) => region.id)
!createMode && objectStorageKey?.regions
? objectStorageKey.regions.map((region) => region.id)
: [];

const initialValues: FormState = {
Expand All @@ -184,7 +184,6 @@ export const OMC_AccessKeyDrawer = (props: AccessKeyDrawerProps) => {
),
}
: { ...values, bucket_access: null };

const updatePayload = generateUpdatePayload(values, initialValues);

if (mode !== 'creating') {
Expand All @@ -203,7 +202,7 @@ export const OMC_AccessKeyDrawer = (props: AccessKeyDrawerProps) => {
const isSaveDisabled =
isRestrictedUser ||
(mode !== 'creating' &&
objectStorageKey &&
objectStorageKey?.regions &&
!hasLabelOrRegionsChanged(formik.values, objectStorageKey)) ||
(mode === 'creating' &&
limitedAccessChecked &&
Expand Down

0 comments on commit 87e0fcb

Please sign in to comment.