Skip to content

Commit

Permalink
[admin] add a description field to Asset Type / Task Type / Task Status
Browse files Browse the repository at this point in the history
* add taskstatus description for documenting statuses, added to csv export
* add description to Task Types
* Add description to Asset Types
  • Loading branch information
scottmcdonnell authored Jun 27, 2024
1 parent 57208d8 commit f3eb6ac
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 11 deletions.
11 changes: 10 additions & 1 deletion src/components/lists/AssetTypeList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
<tr class="datatable-row" v-for="entry in entries" :key="entry.id">
<td class="name">
{{ entry.name }}
<span
class="help-tooltip"
:title="entry.description"
v-if="entry.description"
>
<help-circle-icon class="icon is-small" />
</span>
</td>
<td class="short-name">
{{ entry.short_name }}
Expand Down Expand Up @@ -56,6 +63,7 @@

<script>
import { sortTaskTypes } from '@/lib/sorting'
import { HelpCircleIcon } from 'vue-feather-icons'
import { mapGetters, mapActions } from 'vuex'
import RowActionsCell from '@/components/cells/RowActionsCell'
Expand Down Expand Up @@ -85,7 +93,8 @@ export default {
components: {
TaskTypeName,
RowActionsCell,
TableInfo
TableInfo,
HelpCircleIcon
},
computed: {
...mapGetters(['taskTypeMap'])
Expand Down
13 changes: 12 additions & 1 deletion src/components/lists/TaskStatusList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@
v-for="entry in entries"
:key="entry.id"
>
<td class="name">{{ entry.name }}</td>
<td class="name">
{{ entry.name }}
<span
class="help-tooltip"
:title="entry.description"
v-if="entry.description"
>
<help-circle-icon class="icon is-small" />
</span>
</td>
<task-status-cell class="short-name" :entry="entry" />
<boolean-cell class="is-default" :value="entry.is_default" />
<boolean-cell class="is-done" :value="entry.is_done" />
Expand Down Expand Up @@ -81,6 +90,7 @@

<script>
import draggable from 'vuedraggable'
import { HelpCircleIcon } from 'vue-feather-icons'
import { formatListMixin } from '@/components/mixins/format'
Expand Down Expand Up @@ -110,6 +120,7 @@ export default {
},
components: {
HelpCircleIcon,
BooleanCell,
draggable,
RowActionsCell,
Expand Down
6 changes: 6 additions & 0 deletions src/components/lists/TaskTypeList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<th scope="col" class="allow-timelog">
{{ $t('task_types.fields.allow_timelog') }}
</th>
<th scope="col" class="description">
{{ $t('task_types.fields.description') }}
</th>
<th scope="col" class="actions"></th>
</tr>
</thead>
Expand Down Expand Up @@ -53,6 +56,9 @@
<td class="allow-timelog">
<boolean-rep :value="taskType.allow_timelog" />
</td>
<td>
{{ taskType.description }}
</td>
<row-actions-cell
:taskType-id="taskType.id"
@delete-clicked="$emit('delete-clicked', taskType)"
Expand Down
9 changes: 8 additions & 1 deletion src/components/modals/EditAssetTypeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
v-model="form.short_name"
@enter="runConfirmation"
/>
<textarea-field
:label="$t('asset_types.fields.description')"
v-model="form.description"
@enter="runConfirmation"
/>
<combobox-boolean
:label="$t('main.archived')"
@enter="runConfirmation"
Expand Down Expand Up @@ -91,6 +96,7 @@ import Combobox from '@/components/widgets/Combobox.vue'
import ComboboxBoolean from '@/components/widgets/ComboboxBoolean.vue'
import ModalFooter from '@/components/modals/ModalFooter'
import TextField from '@/components/widgets/TextField'
import TextareaField from '@/components/widgets/TextareaField'
import TaskTypeName from '@/components/widgets/TaskTypeName'
export default {
Expand All @@ -101,7 +107,8 @@ export default {
ComboboxBoolean,
TaskTypeName,
ModalFooter,
TextField
TextField,
TextareaField
},
props: {
Expand Down
13 changes: 11 additions & 2 deletions src/components/modals/EditTaskStatusModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@
:maxlength="8"
@enter="confirmClicked"
v-model="form.short_name"
v-focus
v-if="taskStatusToEdit.short_name !== 'todo'"
/>
<textarea-field
input-class="task-status-description"
:label="$t('task_status.fields.description')"
@enter="confirmClicked"
v-model="form.description"
/>
<boolean-field
:label="$t('task_status.fields.is_default')"
@enter="confirmClicked"
Expand Down Expand Up @@ -113,6 +118,7 @@ import ComboboxBoolean from '@/components/widgets/ComboboxBoolean'
import ColorField from '@/components/widgets/ColorField'
import ModalFooter from '@/components/modals/ModalFooter'
import TextField from '@/components/widgets/TextField'
import TextareaField from '@/components/widgets/TextareaField'
export default {
name: 'edit-task-status-modal',
Expand All @@ -122,7 +128,8 @@ export default {
ColorField,
ComboboxBoolean,
ModalFooter,
TextField
TextField,
TextareaField
},
props: {
Expand All @@ -149,6 +156,7 @@ export default {
form: {
name: '',
short_name: '',
description: '',
color: '$grey999',
is_done: 'false',
is_feedback_request: 'false',
Expand Down Expand Up @@ -216,6 +224,7 @@ export default {
this.form = {
name: this.taskStatusToEdit.name,
short_name: this.taskStatusToEdit.short_name,
description: this.taskStatusToEdit.description,
color: this.taskStatusToEdit.color,
is_done: String(this.taskStatusToEdit.is_done),
is_retake: String(this.taskStatusToEdit.is_retake || false),
Expand Down
9 changes: 8 additions & 1 deletion src/components/modals/EditTaskTypeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
@enter="confirmClicked"
v-model="form.allow_timelog"
/>
<textarea-field
:label="$t('task_types.fields.description')"
v-model="form.description"
@enter="confirmClicked"
/>
<combobox-simple
class="field"
:label="$t('task_types.fields.dedicated_to')"
Expand Down Expand Up @@ -85,6 +90,7 @@ import ComboboxDepartment from '@/components/widgets/ComboboxDepartment'
import ColorField from '@/components/widgets/ColorField'
import ModalFooter from '@/components/modals/ModalFooter'
import TextField from '@/components/widgets/TextField'
import TextareaField from '@/components/widgets/TextareaField'
export default {
name: 'edit-task-type-modal',
Expand All @@ -96,7 +102,8 @@ export default {
ComboboxDepartment,
ColorField,
ModalFooter,
TextField
TextField,
TextareaField
},
props: {
Expand Down
2 changes: 2 additions & 0 deletions src/components/pages/AssetTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,15 @@ export default {
this.$t('main.type'),
this.$t('asset_types.fields.name'),
this.$t('asset_types.fields.short_name'),
this.$t('asset_types.fields.description'),
this.$t('asset_types.fields.task_types')
]
const entries = [headers].concat(
this.assetTypes.map(assetType => [
assetType.type,
assetType.name,
assetType.short_name,
assetType.description,
assetType.task_types.length
? assetType.task_types
.map(taskTypeId => this.taskTypeMap.get(taskTypeId)?.name)
Expand Down
2 changes: 2 additions & 0 deletions src/components/pages/TaskStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export default {
this.$t('main.type'),
this.$t('task_status.fields.name'),
this.$t('task_status.fields.short_name'),
this.$t('task_status.fields.description'),
this.$t('task_status.fields.color'),
this.$t('task_status.fields.is_default'),
this.$t('task_status.fields.is_done'),
Expand All @@ -213,6 +214,7 @@ export default {
taskStatus.type,
taskStatus.name,
taskStatus.short_name,
taskStatus.description,
taskStatus.color,
taskStatus.is_default,
taskStatus.is_done,
Expand Down
2 changes: 2 additions & 0 deletions src/components/pages/TaskTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ export default {
this.$t('task_types.fields.dedicated_to'),
this.$t('task_types.fields.department'),
this.$t('task_types.fields.name'),
this.$t('task_types.fields.description'),
this.$t('task_types.fields.color'),
this.$t('task_types.fields.allow_timelog')
]
Expand All @@ -252,6 +253,7 @@ export default {
taskType.for_entity,
this.departmentMap.get(taskType.department_id)?.name,
taskType.name,
taskType.description,
taskType.color,
taskType.allow_timelog
])
Expand Down
7 changes: 5 additions & 2 deletions src/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default {
production_title: 'Vermögensarten Statistiken',
fields: {
name: 'Name',
short_name: 'Kurzname'
short_name: 'Kurzname',
description: 'Beschreibung'
}
},

Expand Down Expand Up @@ -579,7 +580,8 @@ export default {
is_retake: 'Hat Wiederholungswert',
is_default: 'Is default',
name: 'Name',
short_name: 'Kurzname'
short_name: 'Kurzname',
description: 'Beschreibung'
}
},

Expand All @@ -594,6 +596,7 @@ export default {
dedicated_to: 'Für',
color: 'Farbe',
name: 'Name',
description: 'Beschreibung',
allow_timelog: 'Zeiterfassung',
priority: 'Priorität'
}
Expand Down
5 changes: 4 additions & 1 deletion src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default {
fields: {
name: 'Name',
short_name: 'Short Name',
description: 'Description',
task_types: 'Workflow'
}
},
Expand Down Expand Up @@ -1225,7 +1226,8 @@ export default {
is_retake: 'Has retake value',
is_default: 'Is default',
name: 'Name',
short_name: 'Short Name'
short_name: 'Short name',
description: 'Description'
}
},

Expand All @@ -1244,6 +1246,7 @@ export default {
color: 'Color',
name: 'Name',
short_name: 'Short Name',
description: 'Description',
allow_timelog: 'Timelog',
priority: 'Priority'
}
Expand Down
7 changes: 5 additions & 2 deletions src/locales/fa.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default {
production_title: 'آمار تمام منابع',
fields: {
name: 'نام',
short_name: 'اسم کوتاه'
short_name: 'اسم کوتاه',
description: 'توضیحات'
}
},

Expand Down Expand Up @@ -565,7 +566,8 @@ export default {
is_done: 'انجام شده',
is_retake: 'بازنگری',
name: 'نام',
short_name: 'اسم کوتاه'
short_name: 'اسم کوتاه',
description: 'توضیحات'
}
},

Expand All @@ -581,6 +583,7 @@ export default {
color: 'رنگ',
name: 'نام',
allow_timelog: 'ضبط زمان',
description: 'توضیحات',
priority: 'اولویت'
}
},
Expand Down
2 changes: 2 additions & 0 deletions src/store/api/assettypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default {
const data = {
name: assetType.name,
short_name: assetType.short_name,
description: assetType.description,
task_types: assetType.task_types
}
return client.ppost('/api/data/entity-types', data)
Expand All @@ -22,6 +23,7 @@ export default {
const data = {
name: assetType.name,
short_name: assetType.short_name,
description: assetType.description,
task_types: assetType.task_types,
archived: assetType.archived === 'true'
}
Expand Down
1 change: 1 addition & 0 deletions src/store/api/taskstatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const sanitizeTaskStatus = taskStatus => {
return {
name: taskStatus.name,
short_name: taskStatus.short_name,
description: taskStatus.description,
for_concept: Boolean(taskStatus.for_concept === 'true'),
is_default: Boolean(taskStatus.is_default === 'true'),
is_done: Boolean(taskStatus.is_done === 'true'),
Expand Down
2 changes: 2 additions & 0 deletions src/store/api/tasktypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default {
const data = {
name: taskType.name,
short_name: taskType.short_name,
description: taskType.description,
color: taskType.color,
priority: Number(taskType.priority),
for_entity: taskType.for_entity,
Expand All @@ -22,6 +23,7 @@ export default {
const data = {
name: taskType.name,
short_name: taskType.short_name,
description: taskType.description,
color: taskType.color,
department_id: taskType.department_id
}
Expand Down

0 comments on commit f3eb6ac

Please sign in to comment.