Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/SharedFolder/Info.vue
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | <div class="container"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="row mb-3" v-if="folder.type == 'mail'"> | <div class="row mb-3" v-if="folder.type == 'mail'"> | ||||
<label for="aliases-input" class="col-sm-4 col-form-label">{{ $t('form.emails') }}</label> | <label for="aliases-input" class="col-sm-4 col-form-label">{{ $t('form.emails') }}</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
<list-input id="aliases" :list="folder.aliases"></list-input> | <list-input id="aliases" :list="folder.aliases"></list-input> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div v-if="folder_id === 'new' || folder.id" id="folder-skus" class="row mb-3"> | |||||
<label class="col-sm-4 col-form-label">{{ $t('form.subscriptions') }}</label> | |||||
<subscription-select class="col-sm-8 pt-sm-1" ref="skus" :object="folder" type="shared-folder" :readonly="true"></subscription-select> | |||||
</div> | |||||
<btn class="btn-primary" type="submit" icon="check">{{ $t('btn.submit') }}</btn> | <btn class="btn-primary" type="submit" icon="check">{{ $t('btn.submit') }}</btn> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
<div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="tab-settings"> | <div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="tab-settings"> | ||||
<form @submit.prevent="submitSettings" class="card-body"> | <form @submit.prevent="submitSettings" class="card-body"> | ||||
<div class="row mb-3"> | <div class="row mb-3"> | ||||
<label for="acl-input" class="col-sm-4 col-form-label">{{ $t('form.acl') }}</label> | <label for="acl-input" class="col-sm-4 col-form-label">{{ $t('form.acl') }}</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
Show All 12 Lines | <div class="container"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import AclInput from '../Widgets/AclInput' | import AclInput from '../Widgets/AclInput' | ||||
import ListInput from '../Widgets/ListInput' | import ListInput from '../Widgets/ListInput' | ||||
import StatusComponent from '../Widgets/Status' | import StatusComponent from '../Widgets/Status' | ||||
import SubscriptionSelect from '../Widgets/SubscriptionSelect' | |||||
export default { | export default { | ||||
components: { | components: { | ||||
AclInput, | AclInput, | ||||
ListInput, | ListInput, | ||||
StatusComponent | StatusComponent, | ||||
SubscriptionSelect | |||||
}, | }, | ||||
data() { | data() { | ||||
return { | return { | ||||
domains: [], | domains: [], | ||||
folder_id: null, | folder_id: null, | ||||
folder: { type: 'mail', config: {}, aliases: [] }, | folder: { type: 'mail', config: {}, aliases: [] }, | ||||
status: {}, | status: {}, | ||||
types: [ 'mail', 'event', 'task', 'contact', 'note', 'file' ] | types: [ 'mail', 'event', 'task', 'contact', 'note', 'file' ] | ||||
Show All 34 Lines | export default { | ||||
statusUpdate(folder) { | statusUpdate(folder) { | ||||
this.folder = Object.assign({}, this.folder, folder) | this.folder = Object.assign({}, this.folder, folder) | ||||
}, | }, | ||||
submit() { | submit() { | ||||
this.$root.clearFormValidation($('#folder-info form')) | this.$root.clearFormValidation($('#folder-info form')) | ||||
let method = 'post' | let method = 'post' | ||||
let location = '/api/v4/shared-folders' | let location = '/api/v4/shared-folders' | ||||
let post = this.$root.pick(this.folder, ['id', 'name', 'domain', 'type', 'aliases']) | |||||
if (this.folder_id !== 'new') { | if (this.folder_id !== 'new') { | ||||
method = 'put' | method = 'put' | ||||
location += '/' + this.folder_id | location += '/' + this.folder_id | ||||
} | } | ||||
const post = this.$root.pick(this.folder, ['id', 'name', 'domain', 'type', 'aliases']) | |||||
if (post.type != 'mail') { | if (post.type != 'mail') { | ||||
delete post.aliases | delete post.aliases | ||||
} | } | ||||
// post.skus = this.$refs.skus.getSkus() | |||||
axios[method](location, post) | axios[method](location, post) | ||||
.then(response => { | .then(response => { | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.$router.push({ name: 'shared-folders' }) | this.$router.push({ name: 'shared-folders' }) | ||||
}) | }) | ||||
}, | }, | ||||
submitSettings() { | submitSettings() { | ||||
this.$root.clearFormValidation($('#settings form')) | this.$root.clearFormValidation($('#settings form')) | ||||
Show All 11 Lines |