Skip to content

Commit

Permalink
馃悰 fixed previous button in the week view skipping one week
Browse files Browse the repository at this point in the history
馃悰 fixed null values stored incorrectly in the week view
  • Loading branch information
faburem committed Mar 27, 2024
1 parent 10e0e4b commit d00c7c3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
34 changes: 18 additions & 16 deletions imports/api/timecards/server/methods.js
Expand Up @@ -150,23 +150,25 @@ async function upsertTimecard(projectId, task, date, hours, userId) {
task: await emojify(task),
})
}
await Timecards.updateAsync(
{
userId,
projectId,
date,
task: await emojify(task),
},
{
userId,
projectId,
date,
hours,
task: await emojify(task),
},
if (hours !== 0) {
await Timecards.updateAsync(
{
userId,
projectId,
date,
task: await emojify(task),
},
{
userId,
projectId,
date,
hours,
task: await emojify(task),
},

{ upsert: true },
)
{ upsert: true },
)
}
return 'notifications.success'
}
async function checkProjectAdministratorAndUser(projectId, administratorId, userId) {
Expand Down
5 changes: 3 additions & 2 deletions imports/api/users/server/publications.js
Expand Up @@ -105,19 +105,20 @@ Meteor.publish('adminUserList', async function adminUserList({ limit, search })
options.fields = {
profile: 1, emails: 1, isAdmin: 1, createdAt: 1, inactive: 1,
}
let query = {}
options.sort = { createdAt: -1 }
if (limit) {
options.limit = limit
}
if (search) {
options.filter = {
query = {
$or: [
{ 'profile.name': { $regex: `.*${search.replace(/[-[\]{}()*+?.,\\/^$|#\s]/g, '\\$&')}.*`, $options: 'i' } },
{ 'emails.address': { $regex: `.*${search.replace(/[-[\]{}()*+?.,\\/^$|#\s]/g, '\\$&')}.*`, $options: 'i' } },
],
}
}
return Meteor.users.find({}, options)
return Meteor.users.find(query, options)
})

Meteor.publish('projectResources', async function projectResources({ projectId }) {
Expand Down
4 changes: 2 additions & 2 deletions imports/ui/pages/track/components/weektable.js
Expand Up @@ -96,11 +96,11 @@ Template.weektable.helpers({
Template.weektable.events({
'click .js-previous-week': (event, templateInstance) => {
event.preventDefault()
FlowRouter.setQueryParams({ date: dayjs.utc(templateInstance.startDate.get()).subtract(1, 'week').format('YYYY-MM-DD') })
FlowRouter.setQueryParams({ date: templateInstance.startDate.get().subtract(1, 'week').format('YYYY-MM-DD') })
},
'click .js-next-week': (event, templateInstance) => {
event.preventDefault()
FlowRouter.setQueryParams({ date: dayjs.utc(templateInstance.startDate.get()).add(1, 'week').format('YYYY-MM-DD') })
FlowRouter.setQueryParams({ date: templateInstance.startDate.get().add(1, 'week').format('YYYY-MM-DD') })
},
'click .js-today': (event, templateInstance) => {
event.preventDefault()
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "titra",
"version": "0.97.1",
"version": "0.97.2",
"private": true,
"scripts": {
"start": "meteor run"
Expand Down

0 comments on commit d00c7c3

Please sign in to comment.