Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI dev dependencies typescript 4.9.3 #3856

Merged
merged 2 commits into from Nov 21, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/apps/platform/package.json
Expand Up @@ -167,7 +167,7 @@
"redux-immutable-state-invariant": "^2.1.0",
"redux-saga-test-plan": "^3.7.0",
"tailwindcss": "^2.0.3",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
},
"browserslist": [
">0.2%",
Expand Down
19 changes: 10 additions & 9 deletions ui/apps/platform/src/Containers/Clusters/ClustersSidePanel.tsx
Expand Up @@ -28,7 +28,6 @@ import DownloadHelmValues from './DownloadHelmValues';
import {
clusterDetailPollingInterval,
newClusterDefault,
wizardSteps,
centralEnvDefault,
} from './cluster.helpers';
import { CentralEnv, ClusterManagerType } from './clusterTypes';
Expand All @@ -47,6 +46,8 @@ const validate = (values) => {
return errors;
};

type WizardStep = 'FORM' | 'DEPLOYMENT';

type MessageState = {
type: 'warn' | 'error';
message: JSX.Element | string;
Expand All @@ -62,7 +63,7 @@ function ClustersSidePanel({ selectedClusterId, setSelectedClusterId }) {
const [clusterRetentionInfo, setClusterRetentionInfo] =
useState<DecommissionedClusterRetentionInfo>(null);
const [centralEnv, setCentralEnv] = useState<CentralEnv>(centralEnvDefault);
const [wizardStep, setWizardStep] = useState(wizardSteps.FORM);
const [wizardStep, setWizardStep] = useState<WizardStep>('FORM');
const [loadingCounter, setLoadingCounter] = useState(0);
const [messageState, setMessageState] = useState<MessageState | null>(null);
const [isBlocked, setIsBlocked] = useState(false);
Expand All @@ -78,7 +79,7 @@ function ClustersSidePanel({ selectedClusterId, setSelectedClusterId }) {
setSelectedCluster(defaultCluster);
setMessageState(null);
setIsBlocked(false);
setWizardStep(wizardSteps.FORM);
setWizardStep('FORM');
setPollingDelay(null);
}

Expand Down Expand Up @@ -139,7 +140,7 @@ function ClustersSidePanel({ selectedClusterId, setSelectedClusterId }) {
setPollingDelay(null);
}

if (wizardStep === wizardSteps.FORM) {
if (wizardStep === 'FORM') {
switch (managerType(cluster)) {
case 'MANAGER_TYPE_HELM_CHART':
setMessageState({
Expand Down Expand Up @@ -244,7 +245,7 @@ function ClustersSidePanel({ selectedClusterId, setSelectedClusterId }) {
}

function onNext() {
if (wizardStep === wizardSteps.FORM) {
if (wizardStep === 'FORM') {
setMessageState(null);
setSubmissionError('');
saveCluster(selectedCluster)
Expand All @@ -259,7 +260,7 @@ function ClustersSidePanel({ selectedClusterId, setSelectedClusterId }) {
const clusterWithId = { ...selectedCluster, id: newId };
setSelectedCluster(clusterWithId);

setWizardStep(wizardSteps.DEPLOYMENT);
setWizardStep('DEPLOYMENT');

if (!selectedCluster?.healthStatus?.lastContact) {
setPollingDelay(clusterDetailPollingInterval);
Expand Down Expand Up @@ -306,7 +307,7 @@ function ClustersSidePanel({ selectedClusterId, setSelectedClusterId }) {
const selectedClusterName = (selectedCluster && selectedCluster.name) || '';

// @TODO: improve error handling when adding support for new clusters
const isForm = wizardStep === wizardSteps.FORM;
const isForm = wizardStep === 'FORM';
const iconClassName = 'h-4 w-4';

const panelButtons = isBlocked ? (
Expand Down Expand Up @@ -359,7 +360,7 @@ function ClustersSidePanel({ selectedClusterId, setSelectedClusterId }) {
</div>
</div>
)}
{!isBlocked && wizardStep === wizardSteps.FORM && (
{!isBlocked && wizardStep === 'FORM' && (
<ClusterEditForm
centralEnv={centralEnv}
centralVersion={metadata.version}
Expand All @@ -371,7 +372,7 @@ function ClustersSidePanel({ selectedClusterId, setSelectedClusterId }) {
isLoading={loadingCounter > 0}
/>
)}
{!isBlocked && wizardStep === wizardSteps.DEPLOYMENT && (
{!isBlocked && wizardStep === 'DEPLOYMENT' && (
<div className="flex flex-col md:flex-row p-4">
<ClusterDeployment
editing={!!selectedCluster}
Expand Down
Expand Up @@ -541,11 +541,6 @@ export function getUpgradeableClusters(clusters = []) {
});
}

export const wizardSteps = Object.freeze({
FORM: 'FORM',
DEPLOYMENT: 'DEPLOYMENT',
});

export default {
runtimeOptions,
clusterTypeOptions,
Expand All @@ -554,5 +549,4 @@ export default {
newClusterDefault,
findUpgradeState,
isUpToDateStateObject,
wizardSteps,
};
2 changes: 1 addition & 1 deletion ui/packages/ui-components/package.json
Expand Up @@ -80,6 +80,6 @@
"react-dom": "^17.0.2",
"tailwindcss": "^2.0.3",
"ts-jest": "^26.5.6",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
}
}
8 changes: 4 additions & 4 deletions ui/yarn.lock
Expand Up @@ -18850,10 +18850,10 @@ typeface-open-sans@^1.1.13:
resolved "https://registry.yarnpkg.com/typeface-open-sans/-/typeface-open-sans-1.1.13.tgz#32a09ebd7df59601e01ad81216f98ce641eeafd1"
integrity sha512-lVGVHvYl7UJDFB9vN8r7NHw3sVm7Rjeow6b9AeABc/J+2mDaCkmcdVtw3QZnsJW39P+xm5zeggIj9gLHYGn9Iw==

typescript@^4.8.4:
version "4.8.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
typescript@^4.9.3:
version "4.9.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db"
integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==

uglify-js@^3.1.4:
version "3.13.7"
Expand Down