Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

fix(chromatic): Fix validation errors that shows in chromatic #1869

Merged
merged 1 commit into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/DeploymentsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export const DeploymentsModal = ({ handleCloseModal, isModalOpen }: IDeployments
if (settings.namespace !== '') {
fetchDeployments('no-cache', settings.namespace)
.then((output) => {
setDeployments(output);
if (Array.isArray(output)) {
setDeployments(output);
}
})
.catch((e) => {
throw Error(e);
Expand Down Expand Up @@ -101,7 +103,7 @@ export const DeploymentsModal = ({ handleCloseModal, isModalOpen }: IDeployments
let sortedDeployments = deployments;

if (typeof activeSortIndex !== 'undefined') {
sortedDeployments = deployments.sort((a, b) => {
sortedDeployments = deployments.slice().sort((a, b) => {
const aValue = getSortableRowValues(a)[activeSortIndex];
const bValue = getSortableRowValues(b)[activeSortIndex];
if (activeSortDirection === 'asc') {
Expand Down
4 changes: 3 additions & 1 deletion src/components/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export const SettingsModal = ({ handleCloseModal, isModalOpen }: ISettingsModal)
})
.then((value) => {
if (value) {
setAvailableDSLs(value);
if (Array.isArray(value)) {
setAvailableDSLs(value);
}
}
})
.catch((e) => {
Expand Down
14 changes: 0 additions & 14 deletions src/components/SourceCodeEditor.stories.tsx

This file was deleted.