Skip to content
This repository was archived by the owner on Jan 14, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
674a2b1
Audit fixes
Spring3 Jan 23, 2020
9737518
Pre-commit lint hook, docker image, minor fixes
Spring3 Jan 24, 2020
e35be49
Validated features working on mac. Sorted the information given in re…
Spring3 Jan 24, 2020
2c39a59
Add docker section to readme, updated snapshots
Spring3 Jan 24, 2020
7041bb5
Apply automatic lint fixes. Add .eslintignore
Spring3 Jan 24, 2020
7afc3e3
Include linting into ci
Spring3 Jan 24, 2020
cafa285
Simplifty tray setup. Fix icons for macOS
Spring3 Feb 10, 2020
ae578da
Replace desktopIdle with default electron powerMonitor
Spring3 Feb 10, 2020
43c4519
Minor refactoring for idle timeout logic
Spring3 Feb 16, 2020
74ed3c4
Fix issue with startup on windows when userDir does not yet exists
Spring3 Feb 16, 2020
37c25db
Fix hide/show in tray
Spring3 Feb 17, 2020
d3c1249
Slightly improve the way subtasks are displayed
Spring3 Feb 18, 2020
10b4233
Fix the way custom fields are displayed
Spring3 Feb 19, 2020
fc5ffa9
Remove unused files
Spring3 Feb 19, 2020
0733489
Fix linting issues
Spring3 Feb 19, 2020
40947dd
Update snapshot and add powerMonitor to the electron mock
Spring3 Feb 19, 2020
c909c04
Bump dependencies
Spring3 Feb 19, 2020
e3e94a3
stack.yml -> docker-compose.yml
Spring3 Feb 19, 2020
52cfa25
Unsub from ipc events. Fix bug with timer animation when resumed from…
Spring3 Feb 20, 2020
a78a81c
Fix eslint setup. Auto lint fixes
Spring3 Feb 20, 2020
ce01aaf
Update @testing-library. Update snapshots. Fix links on about page
Spring3 Feb 20, 2020
b68e69d
Fix tests for Copyrights.jsx
Spring3 Feb 21, 2020
6a42e7a
Fix tests for DragArea
Spring3 Feb 21, 2020
35c5e9a
Fix tests for textArea
Spring3 Feb 21, 2020
1aaf7e8
Fix tests for DatePicker
Spring3 Feb 21, 2020
8f2aa1a
Fix tests for infinitescroll
Spring3 Feb 22, 2020
837fdff
Fixed tests for comments section
Spring3 Feb 22, 2020
f48e053
Fix tests for AboutPage
Spring3 Feb 23, 2020
f62d29e
Fix tests for Navbar
Spring3 Feb 24, 2020
9a357d5
Fix tests for progressbar
Spring3 Feb 24, 2020
4bf43ee
Fix tests for IssuesTable, OptionsBlock
Spring3 Feb 24, 2020
9e46491
Fix tests for issues actions
Spring3 Feb 24, 2020
34f5806
Fix styles for ColumnHeadersSelect
Spring3 Feb 24, 2020
7dfb696
Fix tests for Button
Spring3 Feb 24, 2020
cb56d32
Fix tests for TimeEntries
Spring3 Feb 24, 2020
0192557
Fix tests for SummaryPage
Spring3 Feb 24, 2020
3d7a73a
Fix tests for markdowneditor
Spring3 Feb 25, 2020
a6bb606
Fix tests for AppView
Spring3 Feb 25, 2020
8f674f5
Fix tests for LoginView
Spring3 Feb 25, 2020
f6c7ad9
Fix tests fro the IssueDetailsPage
Spring3 Feb 25, 2020
d1b6207
Fix tests for timer
Spring3 Feb 26, 2020
03f459d
Small fix for the markdown editor test
Spring3 Feb 26, 2020
7b778c9
Partially fixed linting errors
Spring3 Feb 27, 2020
2ea2012
Fix linting issues
Spring3 Feb 27, 2020
01a6f0e
Fix tests
Spring3 Feb 28, 2020
a588e0f
Fix layout for the custom fields when there are no subtasks
Spring3 Feb 28, 2020
735925c
Fix login view mode checkbox
Spring3 Feb 28, 2020
58ce449
Fix timer
Spring3 Feb 28, 2020
3de96a7
Fix settings event subscription
Spring3 Feb 28, 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
31 changes: 29 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
version: 2
jobs:
build:
lint:
working_directory: ~/redshape
docker:
- image: circleci/node:10.15.3
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
- run: 'sudo apt install libxss-dev pkg-config'
- run:
name: Install Dependencies
command: 'npm install'
- save_cache:
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: 'Linting'
command: 'npm run lint'

test:
working_directory: ~/redshape
docker:
- image: circleci/node:10.15.3
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
- run: 'sudo apt install libxss-dev libxext-dev libxtst6 libnss3 libgtk-3-0 libgtkextra-dev libasound2'
- run:
name: Install Dependencies
command: 'npm install'
Expand All @@ -18,4 +39,10 @@ jobs:
- run:
name: Coverage
command: 'npm test'


workflows:
version: 2
test:
jobs:
- lint
- test
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
42 changes: 41 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true,
Expand Down Expand Up @@ -27,9 +28,48 @@
"no-underscore-dangle": [ "error", {
"allow": ["__initialize", "__reset"]
}],
"max-len": ["error", { "code": 120, "ignoreComments": true }],
"no-restricted-syntax": "off",
"camelcase": [ "error", {
"allow": ["api_key"]
"allow": [
"api_key",
"time_entry",
"spent_on",
"issue_id",
"activity_id",
"user_id",
"spent_hours",
"total_spent_hours",
"time_entries",
"project_id",
"tracker_id",
"status_id",
"assigned_to_id",
"author_id",
"due_date",
"created_on",
"priority_id",
"private_notes",
"total_count",
"estimated_duration",
"estimated_hours",
"done_ratio",
"assigned_to",
"start_date",
"custom_fields",
"closed_on",
"progress_info"
]
}],
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/anchor-is-valid": "off",
"react/no-array-index-key": "off",
"no-mixed-operators": "off",
"react/forbid-prop-types": "off",
"react/require-default-props": "off",
"react/jsx-props-no-spreading": "off",
"max-classes-per-file": "off",
"no-use-before-define": "off",
"jsx-a11y/label-has-for": [ 2, {
"required": {
"every": [ "nesting", "id" ]
Expand Down
180 changes: 22 additions & 158 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@

A time tracker for [Redmine](https://www.redmine.org) built on [Electron](https://github.com/electron/electron).

> This repo is a fork of the original project. Have a look to the section `rNoz changes` to see the new features.
>
> I would like to integrate these changes in the original one, but until then, I use my own repo.
>
> Acknowledgements: Daniyil Vasylenko and Group4Layers (see the section `Acknowledgements`)

Re-designs the way tasks, task info, tracked time and communication is done on redmine.

The project was originally developed for a MVP portfolio showcase, but there is some roadmap planned with new features that might be added once I find enough of free time.

Thanks for using, or considering to use this project. I would love to hear some feedback as well as your suggestions and thoughts about what could be improved. If you have something to say, don't hesitate to [send me an email](mailto:redshape.app@gmail.com).
Thanks for using, or considering to use this project.

![Redshape Screenshot](https://user-images.githubusercontent.com/4171202/58926139-bbd6df00-8752-11e9-92bb-ddfdb5bce33d.png)

Expand All @@ -41,14 +35,17 @@ Download the latest [Redshape release](https://github.com/Spring3/redshape/relea

The application will automatically update when a new release is available.

## License
[GPL-3.0](https://github.com/Spring3/redshape/blob/master/LICENSE.md)
## Development

Created by [Daniyil Vasylenko](https://github.com/Spring3)
If you don't have access to a deployed instance of redmine, you can now run it in docker

## Contributors
Unfortuantely, you will have to configure it then yourself

rNoz <rnoz.commits@gmail.com> (Group4Layers member).
```
docker-compose -f docker-compose.yml up
```

Then after you run the project with `npm run dev`, use `http://localhost` as redmine endpoint on the login form and provide the credentials or the API token

## FAQ

Expand All @@ -61,155 +58,29 @@ Please ask your Redmine admin user to check if it's enabled in `Administration -
#### - My antivirus / Defender / Mac OS warns that it's not safe to run this app
Mac OS build was signed by a **self-signed certificate**, while Windows and Linux builds **were not signed at all**. In such case, you will see this warnings upon download or running the application / installation, saying that this app is not safe to run or that it was provided by an unknown developer and is not safe to run.

## rNoz changes

### Auth

- Login accepts both API or Username+Password as login method:

![](docs/changes/login_mode_api.png)

### Durations

- Duration: you can use hours, and it is rounded as it will be used in Redmine

![](docs/changes/accept_hours.png)

- Duration: hours are not positive enough (15s rounded => 0)

![](docs/changes/error_nonpositive_enough.png)

- Duration: empty

![](docs/changes/error_empty.png)

- Duration: negative

![](docs/changes/error_negative.png)

- Duration: duration formats (2 examples)

![](docs/changes/accept_duration_1.png)

![](docs/changes/accept_duration_2.png)

- Time Entries are casted to duration formats when editing. For example, this:

![](docs/changes/timeentries.png)

When it is clicked, it is automatically converted to the most comfortable duration format:

![](docs/changes/timeentries_modal_duration.png)

- When tracking an issue:

![](docs/changes/timer.png)

When it is stopped, it is properly filled:

![](docs/changes/timer_stop_modal_duration.png)

- Added info tooltip for the duration field:

![](docs/changes/tooltip.png)

### TimeEntryModal

- When closing the modal of a modified entry or non saved entry (stopped), we need to confirm:

![](docs/changes/timeentreymodal_confirm_modified.png)

- Validations in TimeEntryModal are performed per field (onBlur), to avoid annoying errors in fields we didn't modify yet.

### Tray

- Added tray, allowing to hide in tray/show window, because most of the time the Redshape window is not needed.
#### - How to use timer controls

- Tray with pause/resume button of current timer (long/short issue subject):
Timer controls allow to manually modify the time for the timer by (1 or 5 minutes back and forth) as well as write temporary comments. Using these, we can directly modify the time after the pause in the task. To enable it, toggle the "Use advanced timer controls" item in the Settings menu

![](docs/changes/tray_pause_long.png)
![](docs/changes/tray_resume_short.png)
#### - Idle behavior

- Tick optimizations when using Redshape in tray. This are debug messages not present in the app. They are just printed here to show
the optimization. We reduce the CPU usage.
Redshape can pause the timer if it detects the system is idle for a range of times (5, 10 o 15 minutes). It will warn with notifications (15s. warning time before pausing).

![](docs/changes/tracker_optimization.png)
Optionally, it can automatically discard the idle time from the current timer when it is paused.

- New icons are provided for the tray, showing when it is tracking an issue (play, pause) or not.
#### - More accurate progressbar

### Advanced Timer Controls
Issue progress slider can be changed with 1% step if configured (by default is 10%).
Enable this if you have support in the server side (ruby, redmine) to use every percentage (33%, 81%, etc).

- The view can be advanced or simple. When using advanced view, we can use new buttons to modify the current time (1 or 5 minutes) and write temporary comments. Using these, we can directly modify the time in case we were interrupted in the task (avoid remembering those changes until the end). Also, the comments help us in workflows where our time entry can be hours long.

![](docs/changes/advanced_timer_controls_long.png)

![](docs/changes/advanced_timer_controls_short.png)

When we finish, we have updated our TimeEntryModal:

![](docs/changes/advanced_timer_controls_to_time_entry.png)

### Idle behavior

- Redshape can pause the timer if it detects the system is idle for a range of times (5, 10 o 15 minutes). It will warn with notifications (15s. warning time before pausing).

- Optionally, it can automatically discard the idle time from the current timer when it is paused.

### Settings

- New settings menu to be used per user/redmine host.

![](docs/changes/settings_menu.png)

### Minor bugfixes

- There are other minor bugfixes and features not listed but can be read in the git log. Those are usually related with UX, propagating correctly the state, etc.

### Issue progress bars

- Progress (done ratio) shows a gradient of 5 colors between red-yellow-green (0, 20, 40, 60, 80, 100%).

Time cap shows a green bar between 0-80% and yellow-green in the last 20%. When it is overtime (eg. 150%), a red bar is shown with the overtime proportion (eg. 50/150).

Tooltips added showing the specific percentage value.

![](docs/changes/progressbars.png)

### Custom fields

- Custom fields are shown in the issue details page (if available).

![](docs/changes/custom_fields.png)

### Edit issue

- Progress (done ratio) can be edited in a new modal. It supports an input range to slide the percetage of progress (0 to 100).

![](docs/changes/edit_issue_progress.png)

- Estimation (hours) and Due date can also be edited.

![](docs/changes/edit_issue_estimation_due_date.png)

- If editing a parent task, some non-editable fields are omitted.

![](docs/changes/edit_issue_parent.png)

### Issue fields

- If is a parent task, it shows links to each of its subtasks.

If is a parent task, it shows the totals (estimated and spent time).

![](docs/changes/issue_subtasks.png)

### More settings
## License
[GPL-3.0](https://github.com/Spring3/redshape/blob/master/LICENSE.md)

- Issue progress slider can be changed with 1% step if configured (by default is 10%).
Enable this if you have support in the server side (ruby, redmine) to use every percentage (33%, 81%, etc).
Created by [Daniyil Vasylenko](https://github.com/Spring3)

![](docs/changes/settings_progress.png)
## Contributors

[rNoz](https://github.com/rnoz) from [Group4Layers](https://www.group4layers.com)

### AUR package

Expand All @@ -234,12 +105,5 @@ The second target (`pkgbuild`) will update the version and md5sums of the PKGBUI

### Known issues

- Tray new icons should be ported for Mac (png to icns; png2icns gives black background).
- Changes not tested in Mac or Windows.
- One test is omitted from the original repo (TimeEntryModal, it should match the snapshot) because it never finishes (throws JS heap out of memory).
- As soon as Electron v8 is stable, it should be used (package.json). Redshape is prepared for future features (timeoutType), keeping the notification when the timer is paused due to system idle.

## Acknowledgements

- [Daniyil Vasylenko](redshape.app@gmail.com): original author of this interesting and useful project.
- [Group4Layers](https://www.group4layers.com): it is possible to contribute to this repository and achieve the new features provided here thanks to this company and its efforts to promote and work with open source. The two weeks of dedication have been given in hours assigned by the company.
5 changes: 4 additions & 1 deletion __mocks__/electron-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@ class Store {
}

get = (key) => {
// eslint-disable-next-line
console.log('[electron-store] Using mocked get function');
return values[key];
}

has = (key) => {
// eslint-disable-next-line
console.log('[electron-store] Using mocked has function');
return Object.hasOwnProperty.call(values, key);
}

set = (key, value) => {
// eslint-disable-next-line
console.log('[electron-store] Using mocked set function');
values[key] = value;
}

delete = (key) => delete values[key];
delete = (key) => delete values[key];

clear = () => Store.__reset();
}
Expand Down
10 changes: 9 additions & 1 deletion __mocks__/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const shell = {
openExternal: () => {}
};

const powerMonitor = {
getSystemIdleTime: jest.fn()
};

const remote = {
shell,
process: {
Expand All @@ -17,16 +21,20 @@ const remote = {
if (path.includes('/common/request')) {
return require('../common/request'); // eslint-disable-line
}
if (path.includes('electron')) {
return { powerMonitor };
}
return undefined;
}
};

const ipcRenderer = {
on: jest.fn(),
send: jest.fn(),
removeListener: jest.fn()
};

module.exports = {
remote,
ipcRenderer,
ipcRenderer
};
3 changes: 3 additions & 0 deletions __mocks__/image-mock.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
import React from 'react';

// eslint-disable-next-line react/jsx-filename-extension
export default () => (<div className="image" />);
Binary file added assets/icon-pause-tray-macTemplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon-pause.ico
Binary file not shown.
Binary file modified assets/icon-pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-play-tray-macTemplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon-play.ico
Binary file not shown.
Binary file modified assets/icon-play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-tray-macTemplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon.icns
Binary file not shown.
Loading