Skip to content

Commit

Permalink
v1.1.1 (#62)
Browse files Browse the repository at this point in the history
* language fixes

* fix for admin tasks not updating correctly (#61)
  • Loading branch information
GDay authored Apr 14, 2021
1 parent 409857e commit b28a1ca
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
4 changes: 2 additions & 2 deletions back/admin_tasks/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def send_email_notification_to_external_person(admin_task):
"Hi! Could you please help me with this? It's for our new hire ") + admin_task.new_hire.full_name()
}
]
if admin_task.comments.exists():
if admin_task.comment.exists():
content.append({
"type": "block",
"text": admin_task.content.last().comment
Expand All @@ -37,7 +37,7 @@ def send_email_new_assigned_admin(admin_task):
"text": _("This is about task: ") + admin_task.name + _(" for ") + admin_task.new_hire.full_name()
}
]
if admin_task.comments.exists():
if admin_task.comment.exists():
content.append({
"type": "block",
"text": '<strong>' + _("Last message: ") + '</strong><br />' + admin_task.content.last().comment
Expand Down
6 changes: 3 additions & 3 deletions front/layouts/newhire.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
>
<img :src="$store.state.baseInfo.org.logo" style="max-height: 40px; max-width: 100px; margin-right: 20px;">

<v-toolbar-title>Welcome {{ $store.state.baseInfo.new_hire.first_name }}!</v-toolbar-title>
<v-toolbar-title>Hi {{ $store.state.baseInfo.new_hire.first_name }}!</v-toolbar-title>

<v-spacer />
<v-toolbar-items>
Expand Down Expand Up @@ -96,8 +96,8 @@ export default {
}
this.$newhirepart.getMe(code).then((data) => {
this.$store.commit('setBaseInfo', data)
moment.locale(data.language)
this.$i18n.locale = data.language
moment.locale(data.new_hire.language)
this.$i18n.locale = data.new_hire.language
if (this.$router.currentRoute.name === 'portal') {
if (data.new_hire.has_to_do) {
this.$router.push({ name: 'portal-todo' })
Expand Down
4 changes: 2 additions & 2 deletions front/pages/admin/hrtasks/mine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<template v-slot:no-data>
There are no to do items for you (yet).
</template>
<template v-slot:item.first_name="{ item }">
{{ item.first_name }} {{ item.last_name }}
<template v-slot:item.new_hire.first_name="{ item }">
{{ item.new_hire.first_name }} {{ item.new_hire.last_name }}
</template>
<template v-slot:item.date="{ item }">
{{ item.date | timeAgo }}
Expand Down
3 changes: 3 additions & 0 deletions front/pages/portal/resources/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export default {
})
},
clickedItem (value) {
if (value.length === 0) {
return
}
const item = this.searchResources.find(a => a.id === value[0])
if (item.item) {
this.item = item
Expand Down
35 changes: 22 additions & 13 deletions front/pages/portal/todo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<v-row v-for="(value, preopertyName) in toDoItems" :key="preopertyName">
<v-col xs="12" mb="4">
<v-subheader class="list-header">
{{ preopertyName | toCalendar }}
{{ toCalendar(preopertyName) }}
</v-subheader>
<div v-for="i in value" :key="i.id" class="upper">
<ToDoItem :to-do="i" />
Expand Down Expand Up @@ -80,18 +80,6 @@ export default {
layout: 'newhire',
name: 'ToDoPart',
components: { ToDoItem, BadgeModal },
filters: {
toCalendar (value) {
return moment(value).calendar(null, {
sameDay: '[Today]',
nextDay: '[Tomorrow]',
nextWeek: 'dddd',
lastDay: '[Yesterday]',
lastWeek: '[Last] dddd',
sameElse: 'MM/DD/YYYY'
})
}
},
data: () => ({
loading: true,
loadingBadges: true,
Expand Down Expand Up @@ -127,6 +115,27 @@ export default {
this.loading = false
})
},
toCalendar (value) {
if (this.$store.state.baseInfo.new_hire.language === 'en') {
return moment(value).calendar(null, {
sameDay: '[Today]',
nextDay: '[Tomorrow]',
nextWeek: 'dddd',
lastDay: '[Yesterday]',
lastWeek: '[Last] dddd',
sameElse: 'MM/DD/YYYY'
})
} else if (this.$store.state.baseInfo.new_hire.language === 'nl') {
return moment(value).calendar(null, {
lastDay: '[Gisteren]',
sameDay: '[Vandaag]',
nextDay: '[Morgen]',
lastWeek: '[Vorige week] dddd',
nextWeek: '[Volgende week] dddd',
sameElse: 'DD-MMMM'
})
}
},
getBadges () {
this.loadingBadges = true
this.$newhirepart.getBadges().then((data) => {
Expand Down

0 comments on commit b28a1ca

Please sign in to comment.