Skip to content

Commit

Permalink
feat(ui): add helpers card on home
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Mar 2, 2023
1 parent e0dd016 commit 1808cfe
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 66 deletions.
2 changes: 1 addition & 1 deletion ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
watch: {
$route(to) {
if (to.name === "home" && localStorage.getItem("tourDoneOrSkip") !== "true") {
this.redirectToWelcome();
this.redirectToWelcome && this.redirectToWelcome();
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/home/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
</router-link>
</el-row>
</el-card>
<onboarding-bottom v-if="!flowId" />
</div>
</div>

Expand All @@ -121,10 +122,12 @@
import TriggerFlow from "../flows/TriggerFlow.vue";
import permission from "../../models/permission";
import action from "../../models/action";
import OnboardingBottom from "../onboarding/OnboardingBottom.vue";
export default {
mixins: [RouteContext, RestoreUrl],
components: {
OnboardingBottom,
Collapse,
StateGlobalChart,
NamespaceSelect,
Expand Down
59 changes: 59 additions & 0 deletions ui/src/components/onboarding/OnboardingBottom.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<template>
<el-col class="main-col mt-4">
<el-row :gutter="25" justify="center">
<el-col
v-for="card in cards"
:key="card.title"
:lg="8"
:md="24"
:offset="32"
>
<onboarding-card
:title="card.title"
:content="card.content"
:img-class="card.imgClass"
:link="card.link"
/>
</el-col>
</el-row>
</el-col>
</template>

<script>
import {mapGetters} from "vuex";
import OnboardingCard from "./OnboardingCard.vue";
export default {
components: {
OnboardingCard
},
data() {
return {
cards: [
{
title: this.$t("get started"),
content: this.$t("get started content"),
imgClass: "get-started",
link: "https://kestra.io/docs/getting-started/"
},
{
title: this.$t("watch demo"),
content: this.$t("watch demo content"),
imgClass: "demo-video",
link: "https://api.kestra.io/r/onboarding-video"
},
{
title: this.$t("need help?"),
content: this.$t("need help? content"),
imgClass: "help",
link: "https://api.kestra.io/v1/communities/slack/redirect"
}
]
}
},
computed: {
...mapGetters("core", ["guidedProperties"])
}
}
</script>

67 changes: 6 additions & 61 deletions ui/src/components/onboarding/Welcome.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<el-col class="main-col">
<el-col class="mt-4">
<div>
<h1>{{ $t('welcome aboard') }}</h1>
<h4>
{{ $t('welcome aboard content') }}
</h4>
</div>
<el-row>
<el-row class="mt-4">
<el-col :lg="24">
<el-card>
<el-row justify="center">
Expand All @@ -17,7 +17,7 @@
<h3 v-html="$t('welcome display require')" />
</el-col>
</el-row>
<el-row justify="center">
<el-row justify="center" class="mt-4">
<router-link :to="{name: 'flows/create'}">
<el-button size="large" type="info">
{{ $t('welcome button create') }}
Expand All @@ -27,57 +27,18 @@
</el-card>
</el-col>
</el-row>
<el-row :gutter="32" justify="center">
<el-col
v-for="card in cards"
:key="card.title"
:lg="8"
:md="24"
:offset="32"
>
<onboarding-card
:title="card.title"
:content="card.content"
:img-class="card.imgClass"
:link="card.link"
/>
</el-col>
</el-row>
<onboarding-bottom />
</el-col>
</template>

<script>
import {mapGetters} from "vuex";
import OnboardingCard from "./OnboardingCard.vue";
import OnboardingBottom from "./OnboardingBottom.vue";
export default {
name: "CreateFlow",
components: {
OnboardingCard
},
data() {
return {
cards: [
{
title: this.$t("get started"),
content: this.$t("get started content"),
imgClass: "get-started",
link: "https://kestra.io/docs/getting-started/"
},
{
title: this.$t("watch demo"),
content: this.$t("watch demo content"),
imgClass: "demo-video",
link: "https://api.kestra.io/r/onboarding-video"
},
{
title: this.$t("need help?"),
content: this.$t("need help? content"),
imgClass: "help",
link: "https://api.kestra.io/v1/communities/slack/redirect"
}
]
}
OnboardingBottom
},
computed: {
...mapGetters("core", ["guidedProperties"])
Expand All @@ -86,26 +47,10 @@
</script>

<style scoped lang="scss">
.main-col {
padding-top: calc(var(--spacer) * 2);
}
h3 {
text-align: center;
}
h3, h4 {
line-height: var(--line-height-lg);
}
.el-col {
margin-bottom: var(--spacer);
}
h4 {
margin-bottom: var(--spacer);
}
.onboarding-img {
height: 300px;
width: 100%;
Expand Down
3 changes: 0 additions & 3 deletions ui/src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {createApp} from "vue"
import VueAxios from "vue-axios";
import Vue3Tour from "vue3-tour"

import App from "./App.vue"
import initApp from "./utils/init"
Expand All @@ -21,7 +20,5 @@ configureAxios((instance) => {
store.axios = app.axios;
}, store, router);

app.use(Vue3Tour)

// mount
app.mount("#app")
3 changes: 2 additions & 1 deletion ui/src/utils/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "chart.js";
import {TreemapController, TreemapElement} from "chartjs-chart-treemap"
import {MatrixController, MatrixElement} from "chartjs-chart-matrix";

import Vue3Tour from "vue3-tour"

import Toast from "./toast";
import filters from "./filters";
Expand Down Expand Up @@ -111,6 +111,7 @@ export default (app, routes, stores, translations) => {
// others plugins
app.use(VueSidebarMenu);
app.use(Toast)
app.use(Vue3Tour)

// filters
app.config.globalProperties.$filters = filters;
Expand Down

0 comments on commit 1808cfe

Please sign in to comment.