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

feat: Timeline items now use the feature title instead of the key #155

Merged
merged 1 commit into from
Aug 13, 2024
Merged
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
25 changes: 15 additions & 10 deletions ccc-client/src/components/Progress.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-card>
<v-card max-width="100em">
<template v-slot:loader>
<v-progress-linear
color="primary"
Expand Down Expand Up @@ -48,14 +48,14 @@
<vue-markdown :source="stepDescription"></vue-markdown>
</v-card-text>
</v-card>
<v-card id="console" theme="dark" outlined rounded="0" height="30em" max-height="30em" max-width="100em"
<v-card id="console" theme="dark" outlined rounded="0" height="30em" max-height="30em"
style="font-family: monospace; overflow: scroll">
<v-card-text v-html="consoleOutput"></v-card-text>
</v-card>
<v-progress-linear color="primary" :model-value="(currentStep - 1) / steps.length * 100"/>
<v-timeline direction="horizontal" side="end">
<v-timeline-item size="small" v-for="(stepName, step) in steps" :ref="`${step + 1}-step`"
:icon="currentStep - 1 > step ? 'mdi-check' : ''" fill-dot dot-color="primary">{{ stepName }}
:icon="currentStep - 1 > step ? 'mdi-check' : ''" fill-dot dot-color="primary">{{ getStepTitle(stepName) }}
</v-timeline-item>
</v-timeline>
</v-card-text>
Expand All @@ -82,6 +82,7 @@ let getStepInterval: NodeJS.Timer | null = null;
let consoleOutput: string = '';
let currentStep: number = 1;
let steps: string[] = [];
let features: any = [];

export default defineComponent({
components: {
Expand All @@ -90,6 +91,7 @@ export default defineComponent({
data() {
return {
steps,
features,
currentStep,
consoleOutput,
getStepInterval,
Expand All @@ -106,16 +108,19 @@ export default defineComponent({
logoUrl,
};
},
mounted() {
axios.default.get('/api/steps')
.then(
(backendSteps) => {
this.steps = backendSteps.data.steps;
},
);
async mounted() {
this.steps = (await axios.default.get('/api/steps')).data.steps
this.features = (await axios.default.get('/api/features')).data

this.getStepInterval = setInterval(this.getCurrentStep.bind(this), 3000) as NodeJS.Timer;
},
methods: {
getStepTitle(stepName: string) {
if (stepName == 'flavour') {
return 'Flavour'
}
return this.features[stepName].Title
},
async doOAuth() {
if (this.oAuthCode !== '') {
await navigator.clipboard.writeText(this.oAuthCode);
Expand Down
Loading