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

added check to see if templates list is empty and prompt to add a tem… #140

Merged
merged 1 commit into from
Oct 2, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
<v-card-title>
Select a template to deploy from
</v-card-title>
<v-tabs v-model="tab" grow>
<v-card v-if="templates.length <1 || templates == undefined">
<v-card-title>No Templates Found!</v-card-title>
<v-card-text
> No templates available. <a href="/#/templates/new">Add</a> one to view
information and launch apps from here.</v-card-text
>
</v-card>
<v-tabs v-model="tab" grow v-else>
<v-tab v-for="template in templates" :key="template.id">
{{ template.title }}
<small v-if="template.items">({{ template.items.length }})</small>
</v-tab>
</v-tabs>
<v-tabs-items v-model="tab">
<v-tabs-items v-model="tab" v-if="templates">
<v-tab-item v-for="template in templates" :key="template.id">
<div class="d-flex templates-details page">
<v-container
Expand Down Expand Up @@ -353,15 +360,15 @@ export default {
appDetailsDialog: false,
selectedApp: null,
search: "",
tab: null
tab: null,
};
},
computed: {
...mapState("templates", ["templates", "isLoading"])
...mapState("templates", ["templates", "isLoading"]),
},
methods: {
...mapActions({
readTemplates: "templates/readTemplatesAndItems"
readTemplates: "templates/readTemplatesAndItems",
}),
filterItems(items) {
if (!items) {
Expand All @@ -371,7 +378,7 @@ export default {
return items;
}
let regex = new RegExp(this.search, "i");
return items.filter(item => {
return items.filter((item) => {
return regex.test(item.title);
});
},
Expand All @@ -380,11 +387,11 @@ export default {
return [...result].sort((a, b) => {
return a.title.localeCompare(b.title);
});
}
},
},
mounted() {
this.readTemplates();
}
},
};
</script>

Expand Down
1 change: 0 additions & 1 deletion frontend/src/store/modules/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const actions = {
.get(url)
.then(response => {
const templates = response.data;

templates.forEach(function(template) {
let temp_url = `/api/templates/${template.id}`;
axios
Expand Down