Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce WFH detailed logging - initial version #7

Merged
merged 29 commits into from
Apr 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9e4816d
Prep for architecture changes (component structure)
lsolova Nov 18, 2019
38ef0fd
Set up initial architecture.
lsolova Nov 23, 2019
9243196
Initial v2 architecture documentation.
lsolova Feb 2, 2020
8a6bf29
Rename dateWrapper to dateUtils.
lsolova Feb 17, 2020
11f0930
Remove startStop event duplication.
lsolova Feb 17, 2020
2b1c156
Move dateUtils.
lsolova Feb 22, 2020
443de3d
Reordering functions.
lsolova Apr 3, 2020
f03c5a8
Change karma configuration (new webpack setting).
lsolova Apr 3, 2020
e76b89d
Change to default 8h workload.
lsolova Apr 3, 2020
ef5ab7a
Support tasktypes and add to IndexedDB record current tasktype.
lsolova Apr 5, 2020
af9ea23
Add comment to START records only.
lsolova Apr 5, 2020
2c09c0d
Introduce day details counter (time per task type).
lsolova Apr 6, 2020
5266e78
Change local testing HTTP port.
lsolova Apr 8, 2020
d5d864a
Update task type calculated times on measure stop.
lsolova Apr 8, 2020
d4dc586
Change design to support task types.
lsolova Apr 10, 2020
4094b96
Pass task type change to controller.
lsolova Apr 10, 2020
4c59374
Start separation of modelhandler and controller functionality.
lsolova Apr 10, 2020
f9edbc2
Prepare support of new time log entry items.
lsolova Apr 10, 2020
2eb0c9d
Separate start and stop measurement.
lsolova Apr 10, 2020
9040818
Move notification content definition to controller.
lsolova Apr 10, 2020
96c20ad
Remove unnecessary logging.
lsolova Apr 10, 2020
98bf8d9
Merge remote-tracking branch 'origin/architecture-changes' into wfh-d…
lsolova Apr 10, 2020
b03c777
Fix merge issues.
lsolova Apr 10, 2020
7dc2b25
Remove unnecessary files.
lsolova Apr 3, 2020
9ba0586
Renamings.
lsolova Apr 10, 2020
2f20faf
Move log record creation from controller to model handler.
lsolova Apr 10, 2020
8e8ada5
Pass start or stop log type by business logic.
lsolova Apr 10, 2020
44734c9
Start on task type selection automatically.
lsolova Apr 10, 2020
214792e
Remove unnecessary HTML id attr.
lsolova Apr 16, 2020
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
2 changes: 1 addition & 1 deletion .config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var webpackConfig = require('./webpack.config');
var webpackConfig = require('./webpack.client.config');
webpackConfig.devtool = 'inline-source-map';

module.exports = function (config) {
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

41 changes: 41 additions & 0 deletions docs/components-v1.0.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@startuml "v.0.9 initial state"
skinparam shadowing false

[Application] as app
[MeasureController] as mc
[MeasureView] as mw
[MeasureTime] as mt
[ModelHandler] as mh
[PersistentStore] as ps
[SettingsController] as sc
[SettingsView] as sw
[TimeLogService] as tls
[TimeLogPersistingService] as tlps
[TimeCalcUtils] as tcau
[TimeConversionUtils] as tcou

app ..> mc
app ..> mw
app ..> sc
app ..> sw
mc ..> mh
mc ..> tcau
mc ..> tcou
mc ..> tls
mh ..> ps
mh ..> tcou
mt ..> tcou
mw ..> mc
mw ..> tcou
sc ..> mh
sc ..> tcau
sc ..> tcou
sc ..> tls
sw ..> sc
sw ..> tcou
tcau ..> tcou
tlps ..> ps
tls ..> tcou
tls ..> tlps

@enduml
40 changes: 40 additions & 0 deletions docs/components-v2.0.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@startuml "v.0.9 initial state - packaged"
skinparam shadowing false

package "Views" {
[ApplicationView] as aw
[CalendarView] as cw
[MeasureView] as mw
[SettingsView] as sw
}
package "Controllers" {
[CalendarController] as cc
[MeasureController] as mc
[SettingsController] as sc
}
package "Data manipulation" {
[CalculationUtils] as cau
[ModelHandler] as mh
[PersistentStore] as ps
[TimeLogPersistingService] as tlps
}
package "Utils" {
[DateUtils] as dateu
}

aw --> cw
aw --> mw
aw --> sw
cc --> mh
cw ... cc
mc --> mh
mw ... mc
sc --> mh
sw ... sc
tlps --> dateu
tlps --> ps
mh --> cau
mh --> tlps

@enduml

44 changes: 44 additions & 0 deletions docs/storage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Timeasr data management

Timeasr data is stored locally in the browser.

## Log format (database)

Timestamp is a minute level epoch (minutes since 1 January 1970.)

| Timestamp | Type | Value regex | Example | Notes |
|--------------|-------|-------------------|----------------|---------------|
| 201911231515 | TIMER | (start\|stop) | start | |
lsolova marked this conversation as resolved.
Show resolved Hide resolved
| 201911231515 | BLNC | (+-)?\d{3,4}( .+) | +200 Overtime | |
| 201911231515 | SET | \w*(:[\w\d]*)? | workload:800 | user settings |
| 201911231515 | WDY | | | workday entry |

### Settings

User can set up behavior and calculation base.

| Name | Value regex | Note |
|----------|---------------|-------------------|
| workload | \d* | Stored in minutes |

## Calculations

### Actual balance

Collect start-stop pairs and calculate summary of pair time difference.
Add signed summary of BLNC (balance) values.

### Number of workdays

Count WDY (workday) entries with value.

## Cleanup

On first measure change of a day a cleanup task has been started.

1. This should calculate summary of balance older than 90 days. This summary will be saved to BLNC as rollingBalance.
1. Older WDY entries are removed.
1. Older SET entries are moved to the beginning of the calculation period.
1. Calculation is called.


25 changes: 25 additions & 0 deletions docs/usecases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Timeasr use cases

## 1. Measure
lsolova marked this conversation as resolved.
Show resolved Hide resolved

- Start time period
- Stop time period

## 2. Set a workday

- Select a day clicking on that item in a simple calendar table

## 3. Get/collect statistics

- Calculate actual rolling balance (no monthly limit or boundary)
- Calculate earliest daily leaving time (with balance)
- Calculate regular daily leaving time (without balance based on workload setting)
- Get last 24h changes (readable timestamps)

## 4. Add balance changers

Add additional hours or remove official overtime from the balance.

## 5. Cleanup/database maintenance

See [Storage](./storage.md) for more details
64 changes: 0 additions & 64 deletions gulpfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"eslint": "node ./node_modules/eslint/bin/eslint src/**/*.js",
"karma": "node ./node_modules/karma/bin/karma start .config/karma.conf.js",
"stylelint": "node ./node_modules/stylelint/dist/cli.js \"src/**/*.css\"",
"dev": "node_modules/.bin/webpack-dev-server --config .config/webpack.client.config.js",
"dev": "node_modules/.bin/webpack-dev-server --port 8081 --config .config/webpack.client.config.js",
lsolova marked this conversation as resolved.
Show resolved Hide resolved
"precommit": "npm run eslint stylelint"
},
"repository": {
Expand Down
7 changes: 6 additions & 1 deletion src/client/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</div>
<div id="counter">
<div id="counterValue"></div>
<div id="taskTypesList"></div>
<div id="lastChangeTime"></div>
<div id="leaveValue"></div>
</div>
Expand All @@ -42,7 +43,11 @@
<div>Summary: <span id="monthlywladjsum"></span></div>
<textarea id="monthlywladj" name="monthlywladj"></textarea>
</div>
<div id="license" class="settingsrow">
<div class="settingsrow">
<label for="tasktypes">Task types</label>
<textarea id="tasktypes" name="tasktypes"></textarea>
</div>
<div class="settingsrow license">
<span id="version"><%= htmlWebpackPlugin.options.version %></span>
<span>Software licensed under LGP-3.0<br><a href="https://bitbucket.org/lsolova/timeasr">https://bitbucket.org/lsolova/timeasr</a></span>
<span>Design licensed under CC BY-NC 4.0</span>
Expand Down
Loading