mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
baiscs of space edit page
This commit is contained in:
90
vue/src/apps/SpaceManageView/SpaceManageView.vue
Normal file
90
vue/src/apps/SpaceManageView/SpaceManageView.vue
Normal file
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col col-12">
|
||||
<div v-if="space !== undefined">
|
||||
Recipes {{ space.recipe_count }} / {{ space.max_recipes }}
|
||||
Users {{ space.user_count }} / {{ space.max_users }}
|
||||
Files {{ space.file_size_mb }} / {{ space.max_file_storage_mb }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col col-12">
|
||||
<div v-if="user_spaces !== undefined">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ $t('User') }}</th>
|
||||
<th>{{ $t('Groups') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="us in user_spaces" :key="us.id">
|
||||
<td>{{ us.user.username }}</td>
|
||||
<td>
|
||||
<generic-multiselect
|
||||
class="input-group-text m-0 p-0"
|
||||
@change="us.groups = $event.val"
|
||||
label="name"
|
||||
:initial_selection="us.groups"
|
||||
:model="Models.GROUP"
|
||||
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
|
||||
:limit="10"
|
||||
:multiple="true"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<button @click="alert('')">{{ $t('Delete') }}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from "vue"
|
||||
import {BootstrapVue} from "bootstrap-vue"
|
||||
|
||||
import "bootstrap-vue/dist/bootstrap-vue.css"
|
||||
|
||||
import {ApiMixin, ResolveUrlMixin, ToastMixin} from "@/utils/utils"
|
||||
|
||||
import {ApiApiFactory} from "@/utils/openapi/api.ts"
|
||||
import GenericMultiselect from "@/components/GenericMultiselect";
|
||||
|
||||
Vue.use(BootstrapVue)
|
||||
|
||||
export default {
|
||||
name: "SupermarketView",
|
||||
mixins: [ResolveUrlMixin, ToastMixin, ApiMixin],
|
||||
components: {GenericMultiselect},
|
||||
data() {
|
||||
return {
|
||||
space: undefined,
|
||||
user_spaces: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$i18n.locale = window.CUSTOM_LOCALE
|
||||
|
||||
let apiFactory = new ApiApiFactory()
|
||||
apiFactory.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => {
|
||||
this.space = r.data
|
||||
})
|
||||
apiFactory.listUserSpaces().then(r => {
|
||||
this.user_spaces = r.data
|
||||
})
|
||||
},
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
18
vue/src/apps/SpaceManageView/main.js
Normal file
18
vue/src/apps/SpaceManageView/main.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import Vue from 'vue'
|
||||
import App from './SpaceManageView.vue'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
// TODO move this and other default stuff to centralized JS file (verify nothing breaks)
|
||||
let publicPath = localStorage.STATIC_URL + 'vue/'
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
publicPath = 'http://localhost:8080/'
|
||||
}
|
||||
export default __webpack_public_path__ = publicPath // eslint-disable-line
|
||||
|
||||
|
||||
new Vue({
|
||||
i18n,
|
||||
render: h => h(App),
|
||||
}).$mount('#app')
|
||||
@@ -23,7 +23,7 @@ export class Models {
|
||||
false: undefined,
|
||||
},
|
||||
},
|
||||
tree: { default: undefined },
|
||||
tree: {default: undefined},
|
||||
},
|
||||
},
|
||||
delete: {
|
||||
@@ -50,7 +50,7 @@ export class Models {
|
||||
type: "lookup",
|
||||
field: "target",
|
||||
list: "self",
|
||||
sticky_options: [{ id: 0, name: "tree_root" }],
|
||||
sticky_options: [{id: 0, name: "tree_root"}],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -71,7 +71,7 @@ export class Models {
|
||||
food_onhand: true,
|
||||
shopping: true,
|
||||
},
|
||||
tags: [{ field: "supermarket_category", label: "name", color: "info" }],
|
||||
tags: [{field: "supermarket_category", label: "name", color: "info"}],
|
||||
// REQUIRED: unordered array of fields that can be set during create
|
||||
create: {
|
||||
// if not defined partialUpdate will use the same parameters, prepending 'id'
|
||||
@@ -159,7 +159,7 @@ export class Models {
|
||||
field: "substitute_siblings",
|
||||
label: "substitute_siblings", // form.label always translated in utils.getForm()
|
||||
help_text: "substitute_siblings_help", // form.help_text always translated
|
||||
condition: { field: "parent", value: true, condition: "field_exists" },
|
||||
condition: {field: "parent", value: true, condition: "field_exists"},
|
||||
},
|
||||
substitute_children: {
|
||||
form_field: true,
|
||||
@@ -168,7 +168,7 @@ export class Models {
|
||||
field: "substitute_children",
|
||||
label: "substitute_children",
|
||||
help_text: "substitute_children_help",
|
||||
condition: { field: "numchild", value: 0, condition: "gt" },
|
||||
condition: {field: "numchild", value: 0, condition: "gt"},
|
||||
},
|
||||
inherit_fields: {
|
||||
form_field: true,
|
||||
@@ -178,7 +178,7 @@ export class Models {
|
||||
field: "inherit_fields",
|
||||
list: "FOOD_INHERIT_FIELDS",
|
||||
label: "InheritFields",
|
||||
condition: { field: "food_children_exist", value: true, condition: "preference_equals" },
|
||||
condition: {field: "food_children_exist", value: true, condition: "preference_equals"},
|
||||
help_text: "InheritFields_help",
|
||||
},
|
||||
child_inherit_fields: {
|
||||
@@ -189,7 +189,7 @@ export class Models {
|
||||
field: "child_inherit_fields",
|
||||
list: "FOOD_INHERIT_FIELDS",
|
||||
label: "ChildInheritFields", // form.label always translated in utils.getForm()
|
||||
condition: { field: "numchild", value: 0, condition: "gt" },
|
||||
condition: {field: "numchild", value: 0, condition: "gt"},
|
||||
help_text: "ChildInheritFields_help", // form.help_text always translated
|
||||
},
|
||||
reset_inherit: {
|
||||
@@ -199,7 +199,7 @@ export class Models {
|
||||
field: "reset_inherit",
|
||||
label: "reset_children",
|
||||
help_text: "reset_children_help",
|
||||
condition: { field: "numchild", value: 0, condition: "gt" },
|
||||
condition: {field: "numchild", value: 0, condition: "gt"},
|
||||
},
|
||||
form_function: "FoodCreateDefault",
|
||||
},
|
||||
@@ -399,7 +399,7 @@ export class Models {
|
||||
static SUPERMARKET = {
|
||||
name: "Supermarket",
|
||||
apiName: "Supermarket",
|
||||
ordered_tags: [{ field: "category_to_supermarket", label: "category::name", color: "info" }],
|
||||
ordered_tags: [{field: "category_to_supermarket", label: "category::name", color: "info"}],
|
||||
create: {
|
||||
params: [["name", "description", "category_to_supermarket"]],
|
||||
form: {
|
||||
@@ -469,9 +469,9 @@ export class Models {
|
||||
form_field: true,
|
||||
type: "choice",
|
||||
options: [
|
||||
{ value: "FOOD_ALIAS", text: "Food_Alias" },
|
||||
{ value: "UNIT_ALIAS", text: "Unit_Alias" },
|
||||
{ value: "KEYWORD_ALIAS", text: "Keyword_Alias" },
|
||||
{value: "FOOD_ALIAS", text: "Food_Alias"},
|
||||
{value: "UNIT_ALIAS", text: "Unit_Alias"},
|
||||
{value: "KEYWORD_ALIAS", text: "Keyword_Alias"},
|
||||
],
|
||||
field: "type",
|
||||
label: "Type",
|
||||
@@ -669,6 +669,12 @@ export class Models {
|
||||
paginated: false,
|
||||
}
|
||||
|
||||
static GROUP = {
|
||||
name: "Group",
|
||||
apiName: "Group",
|
||||
paginated: false,
|
||||
}
|
||||
|
||||
static STEP = {
|
||||
name: "Step",
|
||||
apiName: "Step",
|
||||
@@ -694,7 +700,7 @@ export class Actions {
|
||||
},
|
||||
],
|
||||
},
|
||||
ok_label: { function: "translate", phrase: "Save" },
|
||||
ok_label: {function: "translate", phrase: "Save"},
|
||||
},
|
||||
}
|
||||
static UPDATE = {
|
||||
@@ -729,7 +735,7 @@ export class Actions {
|
||||
},
|
||||
],
|
||||
},
|
||||
ok_label: { function: "translate", phrase: "Delete" },
|
||||
ok_label: {function: "translate", phrase: "Delete"},
|
||||
instruction: {
|
||||
form_field: true,
|
||||
type: "instruction",
|
||||
@@ -756,17 +762,17 @@ export class Actions {
|
||||
suffix: "s",
|
||||
params: ["query", "page", "pageSize", "options"],
|
||||
config: {
|
||||
query: { default: undefined },
|
||||
page: { default: 1 },
|
||||
pageSize: { default: 25 },
|
||||
query: {default: undefined},
|
||||
page: {default: 1},
|
||||
pageSize: {default: 25},
|
||||
},
|
||||
}
|
||||
static MERGE = {
|
||||
function: "merge",
|
||||
params: ["source", "target"],
|
||||
config: {
|
||||
source: { type: "string" },
|
||||
target: { type: "string" },
|
||||
source: {type: "string"},
|
||||
target: {type: "string"},
|
||||
},
|
||||
form: {
|
||||
title: {
|
||||
@@ -781,7 +787,7 @@ export class Actions {
|
||||
},
|
||||
],
|
||||
},
|
||||
ok_label: { function: "translate", phrase: "Merge" },
|
||||
ok_label: {function: "translate", phrase: "Merge"},
|
||||
instruction: {
|
||||
form_field: true,
|
||||
type: "instruction",
|
||||
@@ -815,8 +821,8 @@ export class Actions {
|
||||
function: "move",
|
||||
params: ["source", "target"],
|
||||
config: {
|
||||
source: { type: "string" },
|
||||
target: { type: "string" },
|
||||
source: {type: "string"},
|
||||
target: {type: "string"},
|
||||
},
|
||||
form: {
|
||||
title: {
|
||||
@@ -831,7 +837,7 @@ export class Actions {
|
||||
},
|
||||
],
|
||||
},
|
||||
ok_label: { function: "translate", phrase: "Move" },
|
||||
ok_label: {function: "translate", phrase: "Move"},
|
||||
instruction: {
|
||||
form_field: true,
|
||||
type: "instruction",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -57,6 +57,10 @@ const pages = {
|
||||
entry: "./src/apps/ShoppingListView/main.js",
|
||||
chunks: ["chunk-vendors"],
|
||||
},
|
||||
space_manage_view: {
|
||||
entry: "./src/apps/SpaceManageView/main.js",
|
||||
chunks: ["chunk-vendors"],
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user