Skip to content

Commit

Permalink
[admin] add a short name field to Project / Asset Type / TaskType
Browse files Browse the repository at this point in the history
* Add editable production code - useful in Ayon
* add TaskType short name
* add short_name to Asset Type
* add short_name to csv export for Asset Type
* add short_name to the locales
* AssetType set short_name on edit
* Set project code to Short Name for consistency
* add production.code for closed productions list
  • Loading branch information
scottmcdonnell authored Jun 27, 2024
1 parent f85f87d commit 57208d8
Show file tree
Hide file tree
Showing 26 changed files with 120 additions and 9 deletions.
6 changes: 6 additions & 0 deletions src/components/lists/AssetTypeList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<th scope="col" class="name">
{{ $t('asset_types.fields.name') }}
</th>
<th scope="col" class="short-name">
{{ $t('asset_types.fields.short_name') }}
</th>
<th scope="col" class="task-types">
{{ $t('asset_types.fields.task_types') }}
</th>
Expand All @@ -18,6 +21,9 @@
<td class="name">
{{ entry.name }}
</td>
<td class="short-name">
{{ entry.short_name }}
</td>
<td class="task-types" v-if="(entry.task_types || []).length > 0">
<span
:key="taskType.id"
Expand Down
9 changes: 9 additions & 0 deletions src/components/lists/ProductionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<th scope="col" class="name datatable-row-header">
{{ $t('productions.fields.name') }}
</th>
<th scope="col" class="code">
{{ $t('productions.fields.code') }}
</th>
<th scope="col" class="type">
{{ $t('productions.fields.type') }}
</th>
Expand Down Expand Up @@ -40,6 +43,9 @@
:last-production-screen="lastProductionScreen"
/>
</th>
<td class="code">
{{ entry.code }}
</td>
<td class="type">
{{ $t(`productions.type.${entry.production_type || 'short'}`) }}
</td>
Expand Down Expand Up @@ -99,6 +105,9 @@
:is-link="false"
/>
</th>
<td class="code">
{{ entry.code }}
</td>
<td class="type">
{{ $t(`productions.type.${entry.production_type || 'short'}`) }}
</td>
Expand Down
26 changes: 25 additions & 1 deletion src/components/lists/TaskTypeList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
<th scope="col" class="department">
{{ $t('task_types.fields.department') }}
</th>
<th scope="col" class="name">{{ $t('task_types.fields.name') }}</th>
<th scope="col" class="name">
{{ $t('task_types.fields.name') }}
</th>
<th scope="col" class="short_name">
{{ $t('task_types.fields.short_name') }}
</th>
<th scope="col" class="allow-timelog">
{{ $t('task_types.fields.allow_timelog') }}
</th>
Expand Down Expand Up @@ -42,6 +47,9 @@
/>
</td>
<task-type-cell class="name" :task-type="taskType" />
<td class="short_name">
{{ taskType.short_name }}
</td>
<td class="allow-timelog">
<boolean-rep :value="taskType.allow_timelog" />
</td>
Expand Down Expand Up @@ -87,6 +95,9 @@
/>
</td>
<task-type-cell class="name" :task-type="taskType" />
<td class="short_name">
{{ taskType.short_name }}
</td>
<td class="allow-timelog">
<boolean-rep :value="taskType.allow_timelog" />
</td>
Expand Down Expand Up @@ -132,6 +143,9 @@
/>
</td>
<task-type-cell class="name" :task-type="taskType" />
<td class="short_name">
{{ taskType.short_name }}
</td>
<td class="allow-timelog">
<boolean-rep :value="taskType.allow_timelog" />
</td>
Expand Down Expand Up @@ -177,6 +191,9 @@
/>
</td>
<task-type-cell class="name" :task-type="taskType" />
<td class="short_name">
{{ taskType.short_name }}
</td>
<td class="allow-timelog">
<boolean-rep :value="taskType.allow_timelog" />
</td>
Expand Down Expand Up @@ -222,6 +239,9 @@
/>
</td>
<task-type-cell class="name" :task-type="taskType" />
<td class="short_name">
{{ taskType.short_name }}
</td>
<td class="allow-timelog">
<boolean-rep :value="taskType.allow_timelog" />
</td>
Expand Down Expand Up @@ -396,6 +416,10 @@ export default {
min-width: 300px;
}
.short_name {
width: 200px;
min-width: 200px;
}
.priority {
width: 80px;
min-width: 80px;
Expand Down
11 changes: 10 additions & 1 deletion src/components/modals/EditAssetTypeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@
@enter="runConfirmation"
v-focus
/>

<text-field
ref="shortNameField"
:label="$t('asset_types.fields.short_name')"
:maxlength="30"
v-model="form.short_name"
@enter="runConfirmation"
/>
<combobox-boolean
:label="$t('main.archived')"
@enter="runConfirmation"
Expand Down Expand Up @@ -121,6 +127,7 @@ export default {
return {
form: {
name: '',
short_name: '',
task_types: []
}
}
Expand Down Expand Up @@ -191,12 +198,14 @@ export default {
const types = this.assetTypeToEdit.task_types || []
this.form = {
name: this.assetTypeToEdit.name,
short_name: this.assetTypeToEdit.short_name,
task_types: [...types],
archived: String(this.assetTypeToEdit.archived === true)
}
} else {
this.form = {
name: '',
short_name: '',
task_types: [],
archived: 'false'
}
Expand Down
9 changes: 9 additions & 0 deletions src/components/modals/EditProductionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
@enter="runConfirmation"
v-focus
/>
<text-field
ref="codeField"
:label="$t('productions.fields.code')"
v-model="form.code"
@enter="runConfirmation"
/>
<combobox-styled
class="field"
:label="$t('productions.fields.status')"
Expand Down Expand Up @@ -143,6 +149,7 @@ export default {
if (this.productionToEdit && this.productionToEdit.id) {
data.form = {
name: this.productionToEdit.name,
code: this.productionToEdit.code,
project_status_id: this.productionToEdit.project_status_id,
fps: this.productionToEdit.fps,
ratio: this.productionToEdit.ratio,
Expand All @@ -153,6 +160,7 @@ export default {
} else {
data.form = {
name: '',
code: '',
project_status_id: this.productionStatus
? this.productionStatus[0].id
: null,
Expand Down Expand Up @@ -203,6 +211,7 @@ export default {
if (this.productionToEdit && this.productionToEdit.id) {
this.form = {
name: this.productionToEdit.name,
code: this.productionToEdit.code,
project_status_id: this.productionToEdit.project_status_id,
fps: this.productionToEdit.fps,
ratio: this.productionToEdit.ratio,
Expand Down
8 changes: 8 additions & 0 deletions src/components/modals/EditTaskTypeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
@enter="confirmClicked"
v-focus
/>
<text-field
ref="shortNameField"
:label="$t('task_types.fields.short_name')"
v-model="form.short_name"
@enter="confirmClicked"
/>
<boolean-field
:label="$t('task_types.fields.allow_timelog')"
@enter="confirmClicked"
Expand Down Expand Up @@ -117,6 +123,7 @@ export default {
if (this.taskTypeToEdit) {
this.form = {
name: this.taskTypeToEdit.name,
short_name: this.taskTypeToEdit.short_name,
color: this.taskTypeToEdit.color,
for_entity: this.taskTypeToEdit.for_entity || 'Asset',
allow_timelog: String(this.taskTypeToEdit.allow_timelog === true),
Expand All @@ -131,6 +138,7 @@ export default {
return {
form: {
name: '',
short_name: '',
color: '$grey',
for_entity: 'Asset',
allow_timelog: 'false',
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 @@ -180,12 +180,14 @@ export default {
const headers = [
this.$t('main.type'),
this.$t('asset_types.fields.name'),
this.$t('asset_types.fields.short_name'),
this.$t('asset_types.fields.task_types')
]
const entries = [headers].concat(
this.assetTypes.map(assetType => [
assetType.type,
assetType.name,
assetType.short_name,
assetType.task_types.length
? assetType.task_types
.map(taskTypeId => this.taskTypeMap.get(taskTypeId)?.name)
Expand Down
9 changes: 9 additions & 0 deletions src/components/pages/production/ProductionParameters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
v-focus
v-model="form.name"
/>
<text-field
ref="codeField"
:label="$t('productions.fields.code')"
@enter="runConfirmation"
v-model="form.code"
/>
<div class="columns">
<div class="mr1">
<date-field
Expand Down Expand Up @@ -184,6 +190,7 @@ export default {
homepageOptions: HOME_PAGE_OPTIONS,
form: {
name: '',
code: '',
start_date: new Date(),
end_date: new Date(),
nb_episodes: 0,
Expand Down Expand Up @@ -258,6 +265,7 @@ export default {
if (this.currentProduction) {
this.form = {
name: this.currentProduction.name,
code: this.currentProduction.code,
start_date: parseSimpleDate(
this.currentProduction.start_date
).toDate(),
Expand Down Expand Up @@ -285,6 +293,7 @@ export default {
} else {
this.form = {
name: '',
code: '',
start_date: new Date(),
end_date: new Date(),
production_type: 'short',
Expand Down
3 changes: 3 additions & 0 deletions src/components/pages/production/ProductionTaskType.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<tr class="datatable-row" :key="taskType.id">
<task-type-cell :task-type="taskType" />
<td class="short-name">
{{ taskType.short_name }}
</td>
<td class="remove">
<button
class="button"
Expand Down
10 changes: 10 additions & 0 deletions src/components/pages/production/ProductionTaskTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@
taskListObject.entity === activeTab
"
>
<!--
<thead>
<tr>
<th class="th-name">{{ $t('task_status.fields.name') }}</th>
<th class="th-short-name">
{{ $t('task_status.fields.short_name') }}
</th>
</tr>
</thead>
-->
<draggable
v-model="taskListObject.list"
draggable=".task-type"
Expand Down
4 changes: 3 additions & 1 deletion src/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default {
title: 'Vermögensarten',
production_title: 'Vermögensarten Statistiken',
fields: {
name: 'Name'
name: 'Name',
short_name: 'Kurzname'
}
},

Expand Down Expand Up @@ -455,6 +456,7 @@ export default {
welcome: 'Willkommen bei Kitsu'
},
fields: {
code: 'Kurzname',
fps: 'FPS',
name: 'Name',
ratio: 'Ratio',
Expand Down
5 changes: 4 additions & 1 deletion src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default {
production_title: 'Asset Types Stats',
fields: {
name: 'Name',
short_name: 'Short Name',
task_types: 'Workflow'
}
},
Expand Down Expand Up @@ -1010,6 +1011,7 @@ export default {
},

fields: {
code: 'Short Name',
end_date: 'End date',
episode_span: 'Episode spacing',
fps: 'FPS',
Expand Down Expand Up @@ -1223,7 +1225,7 @@ export default {
is_retake: 'Has retake value',
is_default: 'Is default',
name: 'Name',
short_name: 'Short name'
short_name: 'Short Name'
}
},

Expand All @@ -1241,6 +1243,7 @@ export default {
department: 'Department',
color: 'Color',
name: 'Name',
short_name: 'Short Name',
allow_timelog: 'Timelog',
priority: 'Priority'
}
Expand Down
1 change: 1 addition & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"production_title": "Estadísticas de Assets",
"fields": {
"name": "Nombre",
"short_name": "Denominación breve",
"task_types": "Tipos de tarea"
},
"include_all": "Incluir todos los tipos de recurso"
Expand Down
6 changes: 4 additions & 2 deletions src/locales/fa.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default {
title: 'انواع منبع',
production_title: 'آمار تمام منابع',
fields: {
name: 'نام'
name: 'نام',
short_name: 'اسم کوتاه'
}
},

Expand Down Expand Up @@ -471,7 +472,8 @@ export default {
ratio: 'نسبت تصویر',
resolution: 'ابعاد تصویر',
status: 'وضعیت',
type: 'نوع'
type: 'نوع',
code: 'اسم کوتاه'
},
metadata: {
add_explaination: 'Add specific data required by this project.',
Expand Down
1 change: 1 addition & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"production_title": "Stats types d'assets",
"fields": {
"name": "Nom",
"short_name": "Nom court",
"task_types": "Workflow"
},
"include_all": "Inclure tous les types d'asset"
Expand Down
Loading

0 comments on commit 57208d8

Please sign in to comment.