Skip to content

Commit

Permalink
Merge pull request #72 from educorvi/develop
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
neferin12 committed Oct 13, 2023
2 parents 342767f + 5121039 commit 89ac65a
Show file tree
Hide file tree
Showing 9 changed files with 2,111 additions and 1,659 deletions.
13 changes: 12 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
assignees:
- "neferin12"
commit-message:
prefix: build
groups:
production-dependencies:
dependency-type: "production"
update-types:
- "minor"
- "patch"
development-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dist
dist-ssr
coverage
*.local
dev-dist

/cypress/videos/
/cypress/screenshots/
Expand Down
35 changes: 18 additions & 17 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,54 @@
"size": "yarn run build && size-limit"
},
"dependencies": {
"@tsconfig/node-lts": "^18.12.5",
"@vue/compat": "^3.3.4",
"axios": "^1.4.0",
"axios": "^1.5.1",
"bootstrap": "^4.6.2",
"bootstrap-vue": "^2.23.1",
"bootswatch": "^4.6.2",
"file-saver": "^2.0.5",
"humanize-duration": "^3.29.0",
"humanize-duration": "^3.30.0",
"keycloak-js": "^20.0.5",
"pinia": "^2.1.6",
"showdown": "^2.1.0",
"swagger-ui": "^4.19.1",
"swagger-ui": "^5.9.0",
"swagger-ui-dist": "^4.19.1",
"vue": "^3.3.4",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.4"
"vue-i18n": "^9.5.0",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.3",
"@rushstack/eslint-patch": "^1.5.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/github": "^8.1.0",
"@size-limit/file": "^8.2.6",
"@size-limit/time": "^8.2.6",
"@types/file-saver": "^2.0.5",
"@types/humanize-duration": "^3.27.1",
"@types/node": "^18.17.7",
"@types/showdown": "^2.0.1",
"@types/showdown": "^2.0.2",
"@types/swagger-ui": "^3.52.0",
"@types/swagger-ui-dist": "^3.30.1",
"@vitejs/plugin-vue": "^4.3.3",
"@vitejs/plugin-vue": "^4.4.0",
"@vue/compiler-sfc": "^3.3.4",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/tsconfig": "^0.1.3",
"eslint": "^8.47.0",
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.51.0",
"eslint-plugin-vue": "^9.17.0",
"license-downloader": "^1.0.8",
"license-report": "^6.4.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"sass": "^1.66.1",
"semantic-release": "^20.1.3",
"sass": "^1.69.3",
"semantic-release": "^21.1.1",
"semantic-release-monorepo": "^7.0.5",
"size-limit": "^8.2.6",
"typescript": "~4.7.4",
"vite": "^4.4.9",
"vite-plugin-pwa": "^0.16.4",
"vue-tsc": "~1.2.1"
"typescript": "~5.2.2",
"vite": "^4.4.11",
"vite-plugin-pwa": "^0.16.5",
"vue-tsc": "~1.8.19"
},
"size-limit": [
{
Expand Down
30 changes: 19 additions & 11 deletions client/src/components/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{ t('total') }}: {{ hours }}
<br />
<span v-if="breaks" class="text-muted">
(-{{ getHumanizedDuration(breaks) }} {{ t('break') }})
(+{{ getHumanizedDuration(breaks) }} {{ t('break') }})
</span>
</p>

Expand Down Expand Up @@ -49,14 +49,15 @@
{{
getDurationOrDash(
activity.from,
activity.to
activity.to,
activity.breakMins * 60 * 1000
)
}}
<span
v-if="activity.breakMins"
class="text-muted"
>
(-{{
(+{{
getHumanizedDuration(
activity.breakMins * 60 * 1000,
['m']
Expand Down Expand Up @@ -170,20 +171,21 @@ const monthOptions = computed(() =>
const years = ref<Array<number>>([]);
const year = ref(new Date().getFullYear());
const breaks = computed(() => {
return activities.value.reduce((prev: number, curr: Activity) => {
return prev + curr.breakMins * 60 * 1000;
}, 0);
});
const hours = computed(() => {
return getHumanizedDuration(
activities.value.reduce((prev: number, curr: Activity) => {
return (
prev + ((curr.to?.getTime() || 0) - (curr.from?.getTime() || 0))
);
}, 0)
}, 0) - (breaks.value || 0)
);
});
const breaks = computed(() => {
return activities.value.reduce((prev: number, curr: Activity) => {
return prev + curr.breakMins * 60 * 1000;
}, 0);
});
function getHumanizedDuration(
duration: number,
Expand All @@ -195,11 +197,17 @@ function getHumanizedDuration(
});
}
function getDurationOrDash(from: Date | null, to: Date | null) {
/**
* Returns duration between `from` and `to` (minus `sub`, if specified)
* @param from
* @param to
* @param sub
*/
function getDurationOrDash(from: Date | null, to: Date | null, sub = 0) {
if (!from || !to) {
return ' - ';
}
return getHumanizedDuration(to.getTime() - from.getTime());
return getHumanizedDuration(to.getTime() - from.getTime() - sub);
}
function loadActivities() {
Expand Down
4 changes: 2 additions & 2 deletions client/src/views/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ onMounted(() => {
// insert Divider between versions
.replace(/\n(?=# \[timeclicker_client-)/g, '\n___\n\n')
// strip "timeclicker_client" from version name
.replace(/(?<=# \[)timeclicker_client-(?=v\d\.\d\.\d\])/g, '')
.replace(/(?<=# \[)timeclicker_client-(?=v\d+\.\d+\.\d+\])/g, '')
// replace link to GitHub compare with link to GitHub release
.replace(
/https:\/\/github\.com\/educorvi\/timeclicker\/compare\/timeclicker_client-v\d\.\d\.\d\.\.\.(?=timeclicker_client-v\d\.\d\.\d)/g,
/https:\/\/github\.com\/educorvi\/timeclicker\/compare\/timeclicker_client-v\d+\.\d+\.\d+\.\.\.(?=timeclicker_client-v\d+\.\d+\.\d+)/g,
'https://github.com/educorvi/timeclicker/releases/tag/'
);
const converter = new Converter();
Expand Down
2 changes: 1 addition & 1 deletion client/tsconfig.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@vue/tsconfig/tsconfig.node.json",
"extends": "@tsconfig/node-lts/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",
Expand Down
2 changes: 1 addition & 1 deletion client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
"compilerOptions": {
"baseUrl": ".",
Expand Down
16 changes: 8 additions & 8 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/github": "^8.1.0",
"@types/compression": "^1.7.2",
"@types/cors": "^2.8.13",
"@types/express": "^4.17.17",
"@types/compression": "^1.7.3",
"@types/cors": "^2.8.14",
"@types/express": "^4.17.19",
"@types/node": "^18.17.7",
"@types/swagger-ui-express": "^4.1.3",
"nodemon": "^3.0.1",
"semantic-release": "^20.1.3",
"semantic-release": "^21.1.1",
"semantic-release-monorepo": "^7.0.5",
"ts-node": "^10.9.1",
"tslib": "^2.6.2",
"typescript": "^4.9.5"
"typescript": "^5.2.2"
},
"dependencies": {
"axios": "^1.4.0",
"axios": "^1.5.1",
"compression": "^1.7.4",
"cors": "^2.8.5",
"express": "^4.18.2",
"express-rate-limit": "^6.9.0",
"express-rate-limit": "^6.11.1",
"keycloak-backend": "^4.0.1",
"pg": "^8.11.3",
"reflect-metadata": "^0.1.13",
"swagger-ui-express": "^4.6.3",
"tslog": "^4.9.2",
"tsoa": "^5.1.1",
"typeorm": "^0.3.17",
"typeorm-extension": "^3.0.1"
"typeorm-extension": "^3.0.2"
}
}

0 comments on commit 89ac65a

Please sign in to comment.