Skip to content

Commit

Permalink
Merge pull request #13083 from torchiaf/10170-fix-first-step
Browse files Browse the repository at this point in the history
Fleet Git Repo make first configuration step clickable
  • Loading branch information
torchiaf authored Jan 21, 2025
2 parents 8c0ced4 + 6da57b2 commit 1bb4450
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
6 changes: 6 additions & 0 deletions shell/components/CruResource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ export default {
default: () => []
},
stepsOptions: {
type: Object,
default: () => ({ editFirstStep: true })
},
// The set of labels to display for the finish AsyncButton
finishMode: {
type: String,
Expand Down Expand Up @@ -562,6 +567,7 @@ export default {
ref="Wizard"
:header-mode="mode"
:steps="steps"
:edit-first-step="stepsOptions.editFirstStep"
:errors="errors"
:finish-mode="finishMode"
class="wizard"
Expand Down
19 changes: 11 additions & 8 deletions shell/edit/fleet.cattle.io.gitrepo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
subtext: this.t('fleet.gitRepo.add.steps.repoInfo.subtext'),
descriptionKey: 'fleet.gitRepo.add.steps.repoInfo.description',
ready: false,
weight: 30
weight: 1
};
const stepTargetInfo = {
Expand All @@ -129,11 +129,9 @@ export default {
subtext: this.t('fleet.gitRepo.add.steps.targetInfo.subtext'),
descriptionKey: 'fleet.gitRepo.steps.add.targetInfo.description',
ready: true,
weight: 30
weight: 1
};
const addRepositorySteps = [stepRepoInfo, stepTargetInfo].sort((a, b) => (b.weight || 0) - (a.weight || 0));
return {
allClusters: [],
allClusterGroups: [],
Expand All @@ -155,7 +153,6 @@ export default {
targetAdvanced,
stepRepoInfo,
stepTargetInfo,
addRepositorySteps,
displayHelmRepoURLRegex: false,
fvFormRuleSets: [{ path: 'spec.repo', rules: ['required'] }]
};
Expand All @@ -168,6 +165,13 @@ export default {
return _SPECIFY;
},
steps() {
return [
this.stepRepoInfo,
this.stepTargetInfo
];
},
isLocal() {
return this.value.metadata.namespace === 'fleet-local';
},
Expand Down Expand Up @@ -463,7 +467,7 @@ export default {
},
stepOneReady() {
this.addRepositorySteps[0]['ready'] = this.stepOneRequires;
this.stepRepoInfo['ready'] = this.stepOneRequires;
},
updateTls() {
Expand Down Expand Up @@ -507,8 +511,7 @@ export default {
:subtypes="[]"
:validation-passed="true"
:errors="errors"
:steps="addRepositorySteps"
:edit-first-step="true"
:steps="steps"
:finish-mode="'finish'"
class="wizard"
@cancel="done"
Expand Down

0 comments on commit 1bb4450

Please sign in to comment.