Skip to content

Commit

Permalink
Fix warnings from TICS scan (#986)
Browse files Browse the repository at this point in the history
## Done

- fixing a couple of warnings that showed up in the TICS dashboard
  • Loading branch information
edlerd authored Nov 19, 2024
2 parents df407b2 + f8046d4 commit 5ca9b46
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
30 changes: 14 additions & 16 deletions src/components/forms/DiskDeviceFormRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,20 @@ const DiskDeviceFormRoot: FC<Props> = ({ formik, pools, profiles }) => {
readOnly: readOnly,
overrideValue: hasRootStorage && (
<>
{formRootDevice?.size ?? (hasRootStorage ? "unlimited" : "")}
{hasRootStorage && (
<Button
onClick={() => {
ensureEditMode(formik);
focusField("limits_disk");
}}
type="button"
appearance="base"
title="Edit"
className="u-no-margin--bottom"
hasIcon
>
<Icon name="edit" />
</Button>
)}
{formRootDevice?.size ?? "unlimited"}
<Button
onClick={() => {
ensureEditMode(formik);
focusField("limits_disk");
}}
type="button"
appearance="base"
title="Edit"
className="u-no-margin--bottom"
hasIcon
>
<Icon name="edit" />
</Button>
</>
),
overrideForm: hasRootStorage && (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/cluster/ClusterMemberSelectTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const ClusterMemberSelectTable: FC<Props> = ({ onSelect, disableMember }) => {

const rows = members.map((member) => {
const disableReason =
disableMember?.name === member.server_name && disableMember.reason;
disableMember?.name === member.server_name && disableMember?.reason;
const selectMember = () => {
if (disableReason) {
return;
Expand Down Expand Up @@ -95,7 +95,7 @@ const ClusterMemberSelectTable: FC<Props> = ({ onSelect, disableMember }) => {
sortData: {
name: member.server_name.toLowerCase(),
roles: member.roles.join(", ").toLowerCase(),
archietecture: member.architecture.toLowerCase(),
architecture: member.architecture.toLowerCase(),
status: member.status.toLowerCase(),
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/instances/InstanceOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const InstanceOverview: FC<Props> = ({ instance }) => {
</Col>
<Col size={7}>
<DeviceListTable
configBaseURL={`/ui/project/${instance.project}/instance/${instance?.name}/configuration`}
configBaseURL={`/ui/project/${instance.project}/instance/${instance.name}/configuration`}
devices={instance.expanded_devices as LxdDevices}
/>
</Col>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/instances/forms/UploadExternalFormatFileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const UploadExternalFormatFileForm: FC<Props> = ({
)
.then((operation) => {
const operationId = operation.metadata.id;
const operationSecret = operation.metadata?.metadata?.fs;
const operationSecret = operation.metadata.metadata?.fs;
const instanceName = getInstanceName(operation.metadata);

// establish websocket connection based on the instance creation operation
Expand Down
5 changes: 4 additions & 1 deletion src/pages/storage/CustomVolumeCreateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ const CustomVolumeCreateModal: FC<Props> = ({
const driverDetails = settings?.environment?.storage_supported_drivers.find(
(driver) => driver.Name === pool?.driver,
);
return !driverDetails?.Remote ?? false;
if (!driverDetails) {
return false;
}
return !driverDetails.Remote;
};

const formik = useFormik<StorageVolumeFormValues>({
Expand Down
3 changes: 2 additions & 1 deletion src/pages/storage/StoragePoolSelectTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const StoragePoolSelectTable: FC<Props> = ({ onSelect, disablePool }) => {
];

const rows = pools.map((pool) => {
const disableReason = disablePool?.name === pool.name && disablePool.reason;
const disableReason =
disablePool?.name === pool.name && disablePool?.reason;
const selectPool = () => {
if (disableReason) {
return;
Expand Down

0 comments on commit 5ca9b46

Please sign in to comment.