Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
harishanchu committed Nov 2, 2019
2 parents 75fd48b + 261ce5b commit ae28853
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ npm-debug.log
server/datasources.development.json
data
server/*.localdev.*
config/localdev
58 changes: 29 additions & 29 deletions client/3rdpartylicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,34 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

[email protected]
MIT
The MIT License (MIT)

Copyright (C) 2011-2014 by Jorik Tangelder (Eight Media)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

[email protected]
MIT
MIT

[email protected]
MIT
MIT License
Expand Down Expand Up @@ -117,32 +145,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[email protected]
MIT
MIT

[email protected]
MIT
The MIT License (MIT)

Copyright (C) 2011-2014 by Jorik Tangelder (Eight Media)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
<link rel="stylesheet" href="styles.e83989a318157831d71a.css"></head>
<body>
<app-root></app-root>
<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.e2f50c782754114df0da.js"></script><script type="text/javascript" src="main.3376ebdbf9c408da5fec.js"></script></body>
<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.e2f50c782754114df0da.js"></script><script type="text/javascript" src="main.86180dab9f6b0d7dcf1e.js"></script></body>
</html>
1 change: 0 additions & 1 deletion client/main.3376ebdbf9c408da5fec.js

This file was deleted.

1 change: 1 addition & 0 deletions client/main.86180dab9f6b0d7dcf1e.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/polyfills.e2f50c782754114df0da.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/runtime.a66f828dca56eeb90e02.js

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

47 changes: 42 additions & 5 deletions common/models/customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,44 @@ module.exports = function (Customer) {
.catch(next);
});

Customer.afterRemote('prototype.__updateById__tasks', function (context, taskInstance, next) {
let connector = Customer.dataSource.connector;
let status;
let userId = taskInstance.userId;
let taskId = context.args.fk;

// Update status of latest associated timsheet based on task status.

if (context.args.data && context.args.data.status) {
if (context.args.data.status === "open") {
status = 'inProgress';
} else {
status = 'completed';
}

connector.query(
'UPDATE TimeSheet ' +
'SET status = "' + status +
'" WHERE taskId = ? AND ' +
'userId = ? ' +
'ORDER BY date DESC ' +
'LIMIT 1;',
[taskId, userId],
(err, rows) => {
if(err) {
console.log(err);

next(new Err('Failed to update associated timesheet.'))
} else {
next()
}
}
)
} else {
next();
}
});

/*--------------------------
* Listen for model events
*--------------------------
Expand Down Expand Up @@ -226,8 +264,7 @@ module.exports = function (Customer) {
err.code = 'USER_NOT_FOUND';

return callback(err);
}
else {
} else {
const Role = Customer.app.models.Role;
const RoleMapping = Customer.app.models.RoleMapping;

Expand Down Expand Up @@ -496,14 +533,14 @@ module.exports = function (Customer) {
* @param {Error} err
* @promise
*/
Customer.confirm = function(uid, token, redirect, fn) {
Customer.confirm = function (uid, token, redirect, fn) {
fn = fn || utils.createPromiseCallback();
this.findById(uid, function(err, user) {
this.findById(uid, function (err, user) {
if (err) {
fn(err);
} else {
if (user && user.verificationToken === token) {
user.updateAttributes({verificationToken: null, emailVerified: true}, function(err) {
user.updateAttributes({verificationToken: null, emailVerified: true}, function (err) {
if (err) {
fn(err);
} else {
Expand Down
4 changes: 2 additions & 2 deletions common/models/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ module.exports = function (Stats) {
"userId = ? " +
"GROUP BY date";

let currentOpenTasksCount = "select count(*) as count from TimeSheet " +
let currentOpenTasksCount = "select count(*) as count from Task " +
"where " +
"status = 'inProgress' AND " +
"status = 'open' AND " +
"userId = ?";

let currentWeekWorkedDays = "select count(DISTINCT date) as count from TimeSheet " +
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Workplace",
"version": "1.0.0",
"name": "workplace",
"version": "1.0.1",
"released": "2019-01-12",
"main": "server/server.js",
"engines": {
Expand Down

0 comments on commit ae28853

Please sign in to comment.