changes related to activating the create task module

This commit is contained in:
omair saleh
2020-05-13 04:42:22 +08:00
parent 06074949dc
commit c85c2fdd2d
13 changed files with 131 additions and 199 deletions
@@ -1,5 +1,5 @@
<template>
<div class="row no-margin" v-if="!pagination">
<div class="row no-margin" v-if="pagination">
<div class="col">
<ul class="pagination justify-content-center mb-0" v-if="pagination.last_page !== 1">
<li class="page-item " :class="[{'disabled': pagination.current_page === 1 && pageNumbers().includes(1)}]" @click="callPage(1)">
@@ -12,7 +12,7 @@
</div>
<div class="row">
<div class="col">
<small>{{task.business_service.name}}</small>
<small>{{task.business_service? task.business_service.name:'Miscellaneous'}}</small>
</div>
</div>
</div>
@@ -86,7 +86,7 @@
<div class="col-4 bg-dark p-4">
<div class="row">
<div class="col">
<div class="row mb-5">
<div class="row mb-5" v-if="task.milestone">
<div class="col">
<div class="row mb-2">
<div class="col">
@@ -131,7 +131,7 @@
</div>
</div>
</div>
<div class="row">
<div class="row mb-3" v-if="task.milestone">
<div class="col">
<div class="row">
<div class="col">
@@ -142,7 +142,7 @@
<div class="col">
<div class="row">
<div class="col">
<small class="text-warning d-block" v-if="!task.assignees.departments.length">No department assigned for this task</small>
<small class="text-warning d-block mt-2" v-if="!task.assignees.departments.length">No department assigned for this task</small>
<div class="row mt-3" v-if="task.assignees.departments.length">
<div class="col">
<div class="mr-2 mb-1 d-inline-block text-center assignee-avatar" v-for="assignee in task.assignees.departments">
@@ -156,7 +156,7 @@
</div>
</div>
</div>
<div class="row mt-3">
<div class="row">
<div class="col">
<div class="row">
<div class="col">
@@ -167,14 +167,10 @@
<div class="col">
<div class="row">
<div class="col">
<small class="text-warning d-block" v-if="!task.assignees.users.length">No department assigned for this task</small>
<div class="row mt-3" v-if="task.assignees.users.length">
<div class="col">
<div class="mr-2 mb-1 d-inline-block text-center assignee-avatar" v-for="assignee in task.assignees.users">
<avatar :size="30" :username="assignee.name"></avatar>
</div>
</div>
</div>
<small class="toggleAssignList mt-2 d-block pointer" v-if="!task.milestone">Assign task to employee <i class="iconsminds-arrow-down float-right"></i></small>
<task-assignee-form-component section="taskSection" :assignable="{assignment_id: task.id, assignee_type: 'User'}" v-if="!task.milestone"></task-assignee-form-component>
<small class="text-warning d-block" v-if="!task.assignees.users.length">No employee assigned for this task</small>
<task-assignee-component section="taskSection" v-if="task.assignees.users.length" :data="task.assignees.users" :assignable="{assignment_id: task.id, assignee_type: 'User'}" :manageable="!task.milestone"></task-assignee-component>
</div>
</div>
</div>
@@ -192,7 +188,7 @@
<div class="col">
<div class="row">
<div class="col">
<small class="text-warning d-block" v-if="!task.time_tracker.length">No one has worked on this task yet</small>
<small class="text-warning d-block mt-2" v-if="!task.time_tracker.length">No one has worked on this task yet</small>
<div class="row mt-3" v-if="task.time_tracker.length">
<div class="col">
<div class="row mb-2 align-items-center" v-for="tracker in task.time_tracker">
@@ -3,18 +3,10 @@
<div class="col">
<div class="row mb-3">
<div class="col">
<div class="row mb-3 animated fadeInDown fast">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.milestone_id">
<selectable-component :endpoint="route('api.project_milestone.list')" section="projectMilestoneSection" valueColumn="id" labelColumn="name" v-model="parameters.milestone_id"></selectable-component>
<span>milestone</span>
</validation-wrapper-component>
</div>
</div>
<div class="row mb-3 animated fadeInDown fast">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.type_id">
<selectable-component :endpoint="route('api.modular_type.list')" section="modularTypeSection" valueColumn="id" labelColumn="name" v-model="parameters.type_id"></selectable-component>
<selectable-component :endpoint="route('api.modular_type.list', 'task')" section="modularTypeSection" valueColumn="id" labelColumn="name" v-model="parameters.type_id"></selectable-component>
<span>type</span>
</validation-wrapper-component>
</div>
@@ -35,14 +27,6 @@
</validation-wrapper-component>
</div>
</div>
<div class="row mb-3 animated fadeInDown fast">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.status">
<selectable-component :endpoint="route('api.modular_type.list')" section="modularTypeSection" valueColumn="id" labelColumn="name" v-model="parameters.status"></selectable-component>
<span>status</span>
</validation-wrapper-component>
</div>
</div>
</div>
</div>
<div class="row mb-3">
@@ -80,11 +64,12 @@
data() {
return {
parameters: {
milestone_id: '',
milestone_id: null,
type_id: '',
title: '',
description: '',
status: ''
status: 7,
active: true
},
};
},
@@ -1,88 +1,64 @@
<template>
<div class="card mb-3 parentContainer">
<div class="row pt-3 pb-3 pr-4 pl-4">
<div class="col">
<div class="row align-items-center">
<div class="col-3">
<div class="row">
<div class="col">
<div class=" mb-1 w-xs-100 mt-0">
<span class="align-middle d-inline-block text-muted text-small text-uppercase" style=" font-size: 9px !important; ">assignee_id</span>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="ist-item-heading truncate mb-0 w-xs-100 mt-0">
<span class="align-middle d-inline-block">{{taskAssignee.assignee_id}}</span>
</div>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">
<div class=" mb-1 w-xs-100 mt-0">
<span class="align-middle d-inline-block text-muted text-small text-uppercase" style=" font-size: 9px !important; ">assignee_type</span>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="text-small mb-0 w-xs-100 mt-0">
<span class="align-middle d-inline-block">{{taskAssignee.assignee_type}}</span>
</div>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">
<div class=" mb-1 w-xs-100 mt-0">
<span class="align-middle d-inline-block text-muted text-small text-uppercase" style=" font-size: 9px !important; ">assignment_id</span>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="text-small mb-0 w-xs-100 mt-0">
<span class="align-middle d-inline-block">{{taskAssignee.assignment_id}}</span>
</div>
</div>
</div>
</div>
<div class="col text-right">
<button type="button" class="btn btn-outline-secondary icon-button mr-3 requestModal" data-type="editModal"><i class="iconsminds-pen-2"></i></button>
<button type="button" class="btn btn-outline-danger icon-button requestModal" data-type="deleteModal"><i class="simple-icon-trash"></i></button>
</div>
</div>
<div class="row" style="margin-top: -8px;">
<div class="col">
<div class="mr-2 mb-1 d-inline-block text-center assignee-avatar" v-for="assignee in assignees">
<avatar :size="30" :username="assignee.name"></avatar>
<i class="iconsminds-close d-block mt-1 delete-icon pointer text-danger" v-if="manageable" @click="deleteAssignee(assignee.id)"></i>
</div>
</div>
<form-component section="taskAssigneeSection" :data="taskAssignee">
<template slot="form" slot-scope="{section, data}">
<task-assignee-form-component :section="section" :data="data"></task-assignee-form-component>
</template>
</form-component>
<delete-component section="taskAssigneeSection" :requestRoute="route('api.task_assignee.delete', taskAssignee.id)" name="task-assignee"></delete-component>
</div>
</template>
<script>
export default {
props: {
data: {
type: Object,
section: {
type: String,
required: true
},
data: {
type: Array,
required: true
},
assignable: {
type: Object,
default: null
},
manageable: {
type: Boolean,
default: false
}
},
watch: {
'data': function() {
this.assignees = this.data;
}
},
data() {
return {
taskAssignee: this.data,
}
assignees: this.data,
parameters: {
assignee_id: '',
assignee_type: this.assignable.assignee_type,
assignment_id: this.assignable.assignment_id,
},
};
},
watch: {
'data': function() {
this.taskAssignee = this.data;
}
methods:{
deleteAssignee(id){
this.parameters.assignee_id = id;
this.submit(this.route('api.task_assignee.delete'), 'delete', null, true, true)
},
successHandler(){
this.updateList()
}
}
}
</script>
<style>
.delete-icon {
visibility: hidden;
}
.assignee-avatar:hover .delete-icon {
visibility: visible;
}
</style>
@@ -1,45 +1,7 @@
<template>
<div class="row" v-on:keyup.enter="submitForm()">
<div class="col">
<div class="row mb-3">
<div class="col">
<div class="row mb-3 animated fadeInDown fast">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.assignee_id">
<input v-model="parameters.assignee_id" type="text" class="form-control">
<span>assignee_id</span>
</validation-wrapper-component>
</div>
</div>
<div class="row mb-3 animated fadeInDown fast">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.assignee_type">
<input v-model="parameters.assignee_type" type="text" class="form-control">
<span>assignee_type</span>
</validation-wrapper-component>
</div>
</div>
<div class="row mb-3 animated fadeInDown fast">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.assignment_id">
<input v-model="parameters.assignment_id" type="text" class="form-control">
<span>assignment_id</span>
</validation-wrapper-component>
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col">
<div class="row">
<div class="col text-right">
<button type="button" class="btn btn-outline-dark float-left" @click="closeModal()">Cancel</button>
<button type="button" class="btn btn-primary" @click="submitForm()">Submit</button>
</div>
</div>
</div>
</div>
</div>
<div>
<selectable-component v-if="parameters.assignee_type === 'Department'" v-on:change="submitForm()" :endpoint="route('api.department.list')" section="departmentSection" valueColumn="id" labelColumn="name" v-model="parameters.assignee_id"></selectable-component>
<selectable-component v-if="parameters.assignee_type === 'User'" v-on:change="submitForm()" :endpoint="route('api.account.user.list')" section="userSection" valueColumn="id" labelColumn="name" v-model="parameters.assignee_id"></selectable-component>
</div>
</template>
<script>
@@ -47,12 +9,16 @@
export default {
props: {
section: {
type: String,
required: true
type: String,
required: true
},
data: {
type: Object,
default: null
},
assignable: {
type: Object,
default: null
}
},
created() {
@@ -65,8 +31,8 @@
return {
parameters: {
assignee_id: '',
assignee_type: '',
assignment_id: ''
assignee_type: this.assignable.assignee_type,
assignment_id: this.assignable.assignment_id,
},
};
},
@@ -77,13 +43,17 @@
assignment_id: { required }
}
},
watch: {
'parameters.assignee_id': function() {
this.submitForm();
}
},
methods:{
submitForm(){
this.submit((this.data ? this.route('api.task_assignee.update', this.data.id) : this.route('api.task_assignee.create')), (this.data ? 'put' : 'post'), this.section+'.form', true, true)
this.submit(this.route('api.task_assignee.create'),'post', null, true, true)
},
successHandler(){
this.crudSuccess();
this.updateList()
}
}
}