Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 39 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@fullcalendar/multimonth": "6.1.20",
"@fullcalendar/vue3": "6.1.20",
"@google/model-viewer": "4.3.0",
"@sentry/vue": "10.55.0",
"@sentry/vue": "10.56.0",
"@unhead/vue": "3.1.1",
"@vuepic/vue-datepicker": "11.0.3",
"bowser": "2.14.1",
Expand Down Expand Up @@ -92,7 +92,7 @@
"vite": "8.0.16",
"vitest": "4.1.8",
"vitest-localstorage-mock": "0.1.2",
"vue-eslint-parser": "10.4.0"
"vue-eslint-parser": "10.4.1"
},
"engines": {
"node": ">=22.22.1",
Expand Down
21 changes: 20 additions & 1 deletion src/components/lists/PeopleList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<th scope="col" class="studio" v-if="!isBots && !isGuests">
{{ $t('people.list.studio') }}
</th>
<th scope="col" class="country" v-if="!isBots && !isGuests">
{{ $t('people.list.country') }}
</th>
<th scope="col" class="contract" v-if="!isBots && !isGuests">
{{ $t('people.list.contract') }}
</th>
Expand Down Expand Up @@ -79,6 +82,9 @@
<td class="studio" v-if="!isBots && !isGuests">
<studio-name :studio="person.studio" v-if="person.studio" />
</td>
<td class="country" v-if="!isBots && !isGuests">
{{ countryName(person.country) }}
</td>
<td class="contract" v-if="!isBots && !isGuests">
{{ $t(`people.contract.${person.contract_type}`) }}
</td>
Expand Down Expand Up @@ -124,7 +130,7 @@
</table>
</div>

<table-info :is-loading="isLoading" :is-error="isError" :cells="8" />
<table-info :is-loading="isLoading" :is-error="isError" :cells="9" />

<p class="has-text-centered footer-info" v-if="!isLoading">
{{ nbUsersDetails }}
Expand All @@ -136,6 +142,9 @@
import { AlertTriangleIcon } from 'lucide-vue-next'
import { mapGetters } from 'vuex'

import { getCountryName } from '@/lib/countries'
import { localeCode } from '@/lib/lang'

import { grabListMixin } from '@/components/mixins/grablist'
import { domMixin } from '@/components/mixins/dom'

Expand Down Expand Up @@ -257,6 +266,10 @@ export default {
},

methods: {
countryName(country) {
return getCountryName(country, localeCode.value)
},

isExpired(expirationDate) {
return expirationDate < this.today
},
Expand Down Expand Up @@ -320,6 +333,11 @@ export default {
min-width: 180px;
}

.country {
width: 160px;
min-width: 160px;
}

.contract {
width: 160px;
min-width: 160px;
Expand Down Expand Up @@ -455,6 +473,7 @@ export default {

.phone,
.studio,
.country,
.contract,
.position,
.seniority,
Expand Down
22 changes: 21 additions & 1 deletion src/components/modals/EditPersonModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
v-model="form.studio_id"
v-if="!isBot"
/>
<combobox
:label="$t('people.fields.country')"
:options="countryOptions"
v-model="form.country"
v-if="showCountryField"
/>
<combobox
:label="$t('people.fields.active')"
:options="activeOptions"
Expand Down Expand Up @@ -201,6 +207,8 @@ import { useI18n } from 'vue-i18n'
import { useStore } from 'vuex'

import { useTime } from '@/composables/time'
import { getCountryOptions } from '@/lib/countries'
import { localeCode } from '@/lib/lang'

import BaseModal from '@/components/modals/BaseModal.vue'
import Combobox from '@/components/widgets/Combobox.vue'
Expand Down Expand Up @@ -245,6 +253,8 @@ const activeOptions = computed(() => [
{ label: t('main.no'), value: 'false' }
])

const countryOptions = computed(() => getCountryOptions(localeCode.value))

const contractOptions = [
{ label: 'open-ended', value: 'open-ended' },
{ label: 'fixed-term', value: 'fixed-term' },
Expand Down Expand Up @@ -290,6 +300,7 @@ const form = ref({
active: 'true',
departments: [],
studio_id: null,
country: null,
expiration_date: null,
is_bot: false
})
Expand All @@ -303,6 +314,11 @@ const user = computed(() => store.getters.user)

const isEditing = computed(() => Boolean(props.personToEdit?.id))

// Country feeds the carbon footprint calculation; hidden for bots/clients (guests never reach this modal).
const showCountryField = computed(
() => !props.isBot && form.value.role !== 'client'
)

const modalTitle = computed(() => {
if (isEditing.value) {
const prefix = props.isBot ? t('bots.edit_title') : t('people.edit_title')
Expand Down Expand Up @@ -349,7 +365,9 @@ const emitForm = event => {
emit(event, {
...form.value,
last_name: form.value.last_name || '',
active: form.value.active === 'true' || form.value.active === true
active: form.value.active === 'true' || form.value.active === true,
// Don't store a country for excluded roles (field hidden but value kept).
country: showCountryField.value ? form.value.country : null
})
}

Expand Down Expand Up @@ -379,6 +397,7 @@ const resetForm = () => {
active: p.active ? 'true' : 'false',
departments: [...(p.departments || [])],
studio_id: p.studio_id,
country: p.country || null,
expiration_date: p.expiration_date,
is_bot: p.is_bot,
notifications_enabled: p.notifications_enabled ? 'true' : 'false',
Expand All @@ -402,6 +421,7 @@ const resetForm = () => {
active: 'true',
departments: [],
studio_id: null,
country: null,
expiration_date: null,
is_bot: props.isBot,
email: props.isBot ? user.value.email : null
Expand Down
3 changes: 2 additions & 1 deletion src/components/pages/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
/>
<combobox-display-options
class="flexrow-item"
:type="type"
:has-linked-assets="isTVShow"
:is-all-episodes="currentEpisode?.id === 'all'"
:type="type"
v-model="displaySettings"
/>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/components/pages/People.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,13 @@ export default {
optionalCsvColumns: [
'Phone',
'Role',
'Contract Type',
'Departments',
'Studio',
'Country',
'Contract Type',
'Position',
'Seniority',
'Daily Salary',
'Active'
],
dataMatchers: ['Email'],
Expand Down
12 changes: 11 additions & 1 deletion src/components/pages/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
v-model="form.locale"
@update:model-value="localeChanged"
/>
<combobox
:label="$t('people.fields.country')"
:options="countryOptions"
v-model="form.country"
v-if="user.role !== 'client' && !user.is_guest"
/>
</div>
</card>

Expand Down Expand Up @@ -183,7 +189,8 @@ import { useI18n } from 'vue-i18n'
import { useHead } from '@unhead/vue'
import { useStore } from 'vuex'

import lang from '@/lib/lang'
import { getCountryOptions } from '@/lib/countries'
import lang, { localeCode } from '@/lib/lang'

import ChangeAvatarModal from '@/components/modals/ChangeAvatarModal.vue'
import Card from '@/components/widgets/Card.vue'
Expand All @@ -210,6 +217,7 @@ const form = ref({
notifications_discord_userid: '',
email: '',
phone: '',
country: null,
timezone: 'Europe/Paris',
locale: 'en_US'
})
Expand Down Expand Up @@ -262,6 +270,8 @@ const timezoneOptions = computed(() =>
.map(tz => ({ label: tz, value: tz }))
)

const countryOptions = computed(() => getCountryOptions(localeCode.value))

// Functions

const syncFormFromUser = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/pages/TaskType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
<div class="filler"></div>
<combobox-display-options
class="flexrow-item"
:type="displayTaskType"
:has-linked-assets="isTVShow"
:is-all-episodes="currentEpisode?.id === 'all'"
:type="displayTaskType"
v-model="displaySettings"
/>
<div
Expand Down
Loading