Skip to content

Commit

Permalink
fix: Fixed target application state not preserving issue
Browse files Browse the repository at this point in the history
Signed-off-by: Hrishav <hrishav.kumar@harness.io>
  • Loading branch information
hrishavjha committed Jul 5, 2023
1 parent b2dc619 commit 77b5f16
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
22 changes: 11 additions & 11 deletions chaoscenter/web/src/components/InputSlider/InputSlider.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,87 +44,87 @@ input[type='range']::-webkit-slider-thumb {
margin-right: 0;
}
.inputScore-0::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 0%, rgba(243, 243, 250, 1) 0%);
background: linear-gradient(90deg, var(--primary-7) 0%, rgba(243, 243, 250, 1) 0%);
}

.inputScore-1::-webkit-slider-thumb {
margin-left: -7px;
margin-right: 0;
}
.inputScore-1::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 10%, rgba(243, 243, 250, 1) 10%);
background: linear-gradient(90deg, var(--primary-7) 10%, rgba(243, 243, 250, 1) 10%);
}

.inputScore-2::-webkit-slider-thumb {
margin-left: -5px;
margin-right: 0;
}
.inputScore-2::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 20%, rgba(243, 243, 250, 1) 20%);
background: linear-gradient(90deg, var(--primary-7) 20%, rgba(243, 243, 250, 1) 20%);
}

.inputScore-3::-webkit-slider-thumb {
margin-left: -3px;
margin-right: 0;
}
.inputScore-3::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 30%, rgba(243, 243, 250, 1) 30%);
background: linear-gradient(90deg, var(--primary-7) 30%, rgba(243, 243, 250, 1) 30%);
}

.inputScore-4::-webkit-slider-thumb {
margin-left: -1px;
margin-right: 0;
}
.inputScore-4::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 40%, rgba(243, 243, 250, 1) 40%);
background: linear-gradient(90deg, var(--primary-7) 40%, rgba(243, 243, 250, 1) 40%);
}

.inputScore-5::-webkit-slider-thumb {
margin-left: 0.5px;
margin-right: 0;
}
.inputScore-5::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 50%, rgba(243, 243, 250, 1) 50%);
background: linear-gradient(90deg, var(--primary-7) 50%, rgba(243, 243, 250, 1) 50%);
}

.inputScore-6::-webkit-slider-thumb {
margin-left: 3px;
margin-right: 0;
}
.inputScore-6::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 60%, rgba(243, 243, 250, 1) 60%);
background: linear-gradient(90deg, var(--primary-7) 60%, rgba(243, 243, 250, 1) 60%);
}

.inputScore-7::-webkit-slider-thumb {
margin-left: 5px;
margin-right: 0;
}
.inputScore-7::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 70%, rgba(243, 243, 250, 1) 70%);
background: linear-gradient(90deg, var(--primary-7) 70%, rgba(243, 243, 250, 1) 70%);
}

.inputScore-8::-webkit-slider-thumb {
margin-left: 7px;
margin-right: 0;
}
.inputScore-8::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 80%, rgba(243, 243, 250, 1) 80%);
background: linear-gradient(90deg, var(--primary-7) 80%, rgba(243, 243, 250, 1) 80%);
}

.inputScore-9::-webkit-slider-thumb {
margin-left: 8px;
margin-right: 0;
}
.inputScore-9::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 90%, rgba(243, 243, 250, 1) 90%);
background: linear-gradient(90deg, var(--primary-7) 90%, rgba(243, 243, 250, 1) 90%);
}

.inputScore-10::-webkit-slider-thumb {
margin-left: 0;
margin-right: 0;
}
.inputScore-10::-webkit-slider-runnable-track {
background: linear-gradient(90deg, rgba(0, 146, 228, 1) 100%, rgba(243, 243, 250, 1) 100%);
background: linear-gradient(90deg, var(--primary-7) 100%, rgba(243, 243, 250, 1) 100%);
}

input[type='range']::-moz-range-track {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function ChaosStudioCloneController(): React.ReactElement {
React.useEffect(() => {
if (experimentData && showStudio < 2 && !hasUnsavedChangesInURL) {
const clonedExperimentName = getHash(2, experimentData.name);
const infrastructureType = experimentData?.infra?.infraType ?? InfrastructureType.KUBERNETES;
const infrastructureType = InfrastructureType.KUBERNETES;
const experimentHandler = experimentYamlService.getInfrastructureTypeHandler();
updateSearchParams({
experimentName: clonedExperimentName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ChaosStudioEditController(): React.ReactElement {

React.useEffect(() => {
if (experimentData && showStudio < 2 && !hasUnsavedChangesInURL) {
const infrastructureType = experimentData?.infra?.infraType ?? InfrastructureType.KUBERNETES;
const infrastructureType = InfrastructureType.KUBERNETES;
const experimentHandler = experimentYamlService.getInfrastructureTypeHandler();
updateSearchParams({
experimentName: experimentData.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export default function TargetApplicationTabController({
setFaultData
}: TargetApplicationControllerProps): React.ReactElement {
const [appInfoData, setAppInfoData] = React.useState<AppInfoData[]>([]);
const [targetApp, setTargetApp] = React.useState<TargetApplicationData>();
const [targetApp, setTargetApp] = React.useState<TargetApplicationData>({
...engineCR?.spec?.appinfo
});
const [selectedGVR, setSelectedGVR] = React.useState<KubeGVRRequest>();
const { data: result, loading } = kubeObjectSubscription({
shouldResubscribe: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { AppInfoData, TargetApplicationData } from '@controllers/TargetAppl
interface TargetApplicationViewProps {
appInfoData: AppInfoData[];
targetApp: TargetApplicationData | undefined;
setTargetApp: React.Dispatch<React.SetStateAction<TargetApplicationData | undefined>>;
setTargetApp: React.Dispatch<React.SetStateAction<TargetApplicationData>>;
engineCR: ChaosEngine | undefined;
setFaultData: React.Dispatch<React.SetStateAction<FaultData | undefined>>;
// getKubeObjectLazyQueryFunction: LazyQueryFunction<KubeObjResponse, KubeObjRequest>;
Expand Down

0 comments on commit 77b5f16

Please sign in to comment.