start shared/local decision on entity creation
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div class="ui-add-button">
|
||||
<ui-button v-if="!decision" :label="label" icon="fth-plus" @click="$emit('click')" :disabled="disabled" />
|
||||
<ui-dropdown v-else align="right">
|
||||
<template v-slot:button>
|
||||
<ui-button :label="label" icon="fth-plus" :disabled="disabled" />
|
||||
</template>
|
||||
<div class="ui-add-button-items">
|
||||
<button type="button" class="ui-add-button-item" @click="$emit('click', false)" :disabled="disabled">
|
||||
<i class="fth-layers"></i>
|
||||
<span class="-text">For {{application.name}}</span>
|
||||
</button>
|
||||
<span class="ui-add-button-items-line"></span>
|
||||
<button type="button" class="ui-add-button-item" @click="$emit('click', true)" :disabled="disabled">
|
||||
<i class="fth-radio is-primary"></i>
|
||||
<span class="-text">For all apps</span>
|
||||
</button>
|
||||
</div>
|
||||
</ui-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { find as _find } from 'underscore';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
decision: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: '@ui.add'
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
application()
|
||||
{
|
||||
return _find(zero.applications, x => x.id === zero.appId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/*.ui-add-button .ui-dropdown-button
|
||||
{
|
||||
font-weight: 700;
|
||||
}*/
|
||||
|
||||
.ui-add-button-items
|
||||
{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1px 1fr;
|
||||
}
|
||||
|
||||
.ui-add-button-item
|
||||
{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 20px 10px;
|
||||
font-size: var(--font-size);
|
||||
|
||||
i
|
||||
{
|
||||
font-size: 20px;
|
||||
line-height: 24px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.is-primary
|
||||
{
|
||||
font-size: 24px;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
&:hover
|
||||
{
|
||||
background: var(--color-bg-xxlight);
|
||||
}
|
||||
}
|
||||
|
||||
.ui-add-button-items-line
|
||||
{
|
||||
display: block;
|
||||
height: 100%;
|
||||
background: var(--color-line-light);
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="ui-dropdown-toggle" @click.stop="toggle">
|
||||
<slot name="button"></slot>
|
||||
</div>
|
||||
<div class="ui-dropdown" role="dialog" v-if="open" v-click-outside="hide" :class="alignClasses">
|
||||
<div class="ui-dropdown" role="dialog" v-if="open" v-click-outside="hide" :class="dropdownClasses">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
@@ -19,6 +19,10 @@
|
||||
type: String,
|
||||
default: 'left'
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
locked: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -31,9 +35,16 @@
|
||||
|
||||
computed: {
|
||||
|
||||
alignClasses()
|
||||
dropdownClasses()
|
||||
{
|
||||
return 'align-' + this.align.split(' ').join(' align-');
|
||||
let classes = 'align-' + this.align.split(' ').join(' align-');
|
||||
|
||||
if (!!this.theme)
|
||||
{
|
||||
classes += ' theme-' + this.theme;
|
||||
}
|
||||
|
||||
return classes;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -148,7 +148,6 @@
|
||||
|
||||
applicationChanged(item, opts)
|
||||
{
|
||||
console.info(item, opts);
|
||||
opts.loading(true);
|
||||
|
||||
AuthApi.switchApp(item.id).then(success =>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
{
|
||||
opts.hide();
|
||||
this.$refs.form.onDelete(ApplicationsApi.delete.bind(this, this.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="languages">
|
||||
<ui-header-bar title="@language.list" :back-button="true">
|
||||
<ui-table-filter v-model="tableConfig" />
|
||||
<ui-button label="Add" icon="fth-plus" />
|
||||
<ui-add-button @click="onAdd" />
|
||||
</ui-header-bar>
|
||||
<div class="ui-blank-box">
|
||||
<ui-table v-model="tableConfig" />
|
||||
@@ -47,6 +47,13 @@
|
||||
},
|
||||
items: LanguagesApi.getAll
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
onAdd()
|
||||
{
|
||||
console.info('add');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -369,7 +369,9 @@
|
||||
"domains": "Domains",
|
||||
"domains_text": "Select domains for this application",
|
||||
"domains_help": "Valid domain names are: \"example.com\", \"www.example.com\", \"example.com:8080\", or \"https://www.example.com\".",
|
||||
"domains_add": "Add domain"
|
||||
"domains_add": "Add domain",
|
||||
"features": "Features",
|
||||
"features_text": "Enable additional features for this application"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user