Skip to content
This repository was archived by the owner on Jan 14, 2023. It is now read-only.

Commit 378f24e

Browse files
Spring3rNoz
andauthored
Feature/rnoz contributions (#16)
* Bugfix in Routes when setting the component. There were errors in Routes like this: Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function`. in Route (created by AppView) in AppView (created by Context.Consumer) in Connect(AppView) (created by Route) in Route (created by Routes) in Switch (created by Routes) in Routes in Router (created by HashRouter) in HashRouter in Provider in ThemeProvider Bugfixed doing what is said here: remix-run/react-router#6471 * Added Login mode to the LoginView (User+Password as default, API Key as alternative method). * Gitignore without .idea dir. * LoginView tests repaired and added one for the apiKey. Added enzyme-to-json as dependency. * Bugfix: className rendered false instead of empty string. * Bugfix: IssuesTable with Date rendered without date. * Bugfixes in IssuesTable: tr or td cannot appear as a child of div, table, etc. * Bugfix in InfiniteScroll: window is not PropTypes.element. * Bugfix in CommentsSection: p child of p. * Bugfix: pause and save state of Timer when unload/exit, preserve state when moving/continue. Tests adapted. * Time tracking is editable (duration and date) when we stop the Timer. * Tray feature: app can hide in tray. * Modal: close button with cursor pointer. * Feature: duration (humanized string, eg. 1m, 2hours 3minutes, 1d 39 s) and hours (float) allowed when editing TimeEntryModal. Added support for right slot in Label. Conversion between duration/hours. Form fields checked individually (onBlur). Refactored validator for Update/Publish. Package: @hapi/joi updated to v16. Tests added/passed. * Feature: TimeEntryModal requests confirmation when contents are modified or initial state is volatile (cames from Timer). Reached a snapshot bug in one test (disabled). * Time interval optimized when window is hidden (datetime diffs). New feature: tray supports pause/resume current timer. * Added electron mock for ipcRenderer. * Electron updated to latest stable version with support for Tray icon. Bugfixed: tray icon needed png icons in asar file. * Developed advanced timer controls, settings menu in window, automatic time paused when system is idle, optional discard idle time from timer, notifications and temporary comments in timer. * Bugfix: styles in advanced controls. Bugfix: jest and electron now share the same node version to avoid recompile modules on each mode. * Added 2 custom icons (1 minute rewind and fastforward) for the advanced timer controls. * README.md with new features (docs, images). Version updated to 1.1.0 and contributors added. Optimized AUR package in support dir. * AUR PKGBUILD with redshape.desktop bugfixed to support the hicolor/0x0 path in Linux (Electron-specific). * Bugfix: correctly save the state of the timer (duration and comments) when quitting the app with temporary data. Better script to build the AUR package. * Bugfix: DatePicker is not updated properly (onDayChange instead of onChange). Version bumped. Tests passed. * Updated PKGBUILD with new version. Releases updated. * Bugfix: TimeEntryModal spent_on date is casted to ISO string, instead of Date object (related with the previous bugfix). * Feature: progress bars with two modes: progress-gradient (5 colors between red-yellow-green) and time-tracking (overtime in red). * Custom fields are shown in IssueDetailsPage (if available). * New feature: added IssueModal in IssueDetailsPage to be able to update the progress (done ratio). * Progress of issue can be edited using an input range instead of an input number. * Show errors from requests if available in response.data.errors. * IssuesTable: estimated time is fixed to 2 decimals. * New features: editable estimated time and due date in issue, omitted non-editable fields, show totals (estimated and spent time) and show subtasks in issue. * Added setting issue progress slider with two steps mode: 10% (default) or 1% (should be server-compatible). * [rnoz] Follow up (#17) * Audit fixes * Pre-commit lint hook, docker image, minor fixes * Validated features working on mac. Sorted the information given in readme * Add docker section to readme, updated snapshots * Apply automatic lint fixes. Add .eslintignore * Include linting into ci * Simplifty tray setup. Fix icons for macOS * Replace desktopIdle with default electron powerMonitor * Minor refactoring for idle timeout logic * Fix issue with startup on windows when userDir does not yet exists * Fix hide/show in tray * Slightly improve the way subtasks are displayed * Fix the way custom fields are displayed * Remove unused files * Fix linting issues * Update snapshot and add powerMonitor to the electron mock * Bump dependencies * stack.yml -> docker-compose.yml * Unsub from ipc events. Fix bug with timer animation when resumed from tray * Fix eslint setup. Auto lint fixes * Update @testing-library. Update snapshots. Fix links on about page * Fix tests for Copyrights.jsx * Fix tests for DragArea * Fix tests for textArea * Fix tests for DatePicker * Fix tests for infinitescroll * Fixed tests for comments section * Fix tests for AboutPage * Fix tests for Navbar * Fix tests for progressbar * Fix tests for IssuesTable, OptionsBlock * Fix tests for issues actions * Fix styles for ColumnHeadersSelect * Fix tests for Button * Fix tests for TimeEntries * Fix tests for SummaryPage * Fix tests for markdowneditor * Fix tests for AppView * Fix tests for LoginView * Fix tests fro the IssueDetailsPage * Fix tests for timer * Small fix for the markdown editor test * Partially fixed linting errors * Fix linting issues * Fix tests * Fix layout for the custom fields when there are no subtasks * Fix login view mode checkbox * Fix timer * Fix settings event subscription * Update readme * cert fix Co-authored-by: rNoz <[email protected]>
1 parent 416761c commit 378f24e

File tree

142 files changed

+15040
-24118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+15040
-24118
lines changed

.circleci/config.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
11
version: 2
22
jobs:
3-
build:
3+
lint:
44
working_directory: ~/redshape
55
docker:
66
- image: circleci/node:10.15.3
77
steps:
88
- checkout
99
- restore_cache:
1010
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
11+
- run: 'sudo apt install libxss-dev pkg-config'
12+
- run:
13+
name: Install Dependencies
14+
command: 'npm install'
15+
- save_cache:
16+
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
17+
paths:
18+
- ./node_modules
19+
- run:
20+
name: 'Linting'
21+
command: 'npm run lint'
22+
23+
test:
24+
working_directory: ~/redshape
25+
docker:
26+
- image: circleci/node:10.15.3
27+
steps:
28+
- checkout
29+
- restore_cache:
30+
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
31+
- run: 'sudo apt install libxss-dev libxext-dev libxtst6 libnss3 libgtk-3-0 libgtkextra-dev libasound2'
1132
- run:
1233
name: Install Dependencies
1334
command: 'npm install'
@@ -18,4 +39,10 @@ jobs:
1839
- run:
1940
name: Coverage
2041
command: 'npm test'
21-
42+
43+
workflows:
44+
version: 2
45+
test:
46+
jobs:
47+
- lint
48+
- test

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.eslintrc.json

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"parser": "babel-eslint",
23
"env": {
34
"browser": true,
45
"es6": true,
@@ -27,9 +28,48 @@
2728
"no-underscore-dangle": [ "error", {
2829
"allow": ["__initialize", "__reset"]
2930
}],
31+
"max-len": ["error", { "code": 120, "ignoreComments": true }],
32+
"no-restricted-syntax": "off",
3033
"camelcase": [ "error", {
31-
"allow": ["api_key"]
34+
"allow": [
35+
"api_key",
36+
"time_entry",
37+
"spent_on",
38+
"issue_id",
39+
"activity_id",
40+
"user_id",
41+
"spent_hours",
42+
"total_spent_hours",
43+
"time_entries",
44+
"project_id",
45+
"tracker_id",
46+
"status_id",
47+
"assigned_to_id",
48+
"author_id",
49+
"due_date",
50+
"created_on",
51+
"priority_id",
52+
"private_notes",
53+
"total_count",
54+
"estimated_duration",
55+
"estimated_hours",
56+
"done_ratio",
57+
"assigned_to",
58+
"start_date",
59+
"custom_fields",
60+
"closed_on",
61+
"progress_info"
62+
]
3263
}],
64+
"jsx-a11y/label-has-associated-control": "off",
65+
"jsx-a11y/anchor-is-valid": "off",
66+
"react/no-array-index-key": "off",
67+
"no-mixed-operators": "off",
68+
"react/forbid-prop-types": "off",
69+
"react/require-default-props": "off",
70+
"react/jsx-props-no-spreading": "off",
71+
"max-classes-per-file": "off",
72+
"no-use-before-define": "off",
3373
"jsx-a11y/label-has-for": [ 2, {
3474
"required": {
3575
"every": [ "nesting", "id" ]

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ coverage/
33
dist/
44
build/
55
.env
6+
.idea
7+
support/package-aur/*
8+
!support/package-aur/manager.sh
9+
!support/package-aur/PKGBUILD

README.md

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,43 @@ Re-designs the way tasks, task info, tracked time and communication is done on r
99

1010
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.
1111

12-
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:[email protected]).
12+
Thanks for using, or considering to use this project.
1313

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

1616
## Installation
1717

1818
### macOS
19+
1920
Download the latest [Redshape release](https://github.com/Spring3/redshape/releases/latest).
2021

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

2324
### Windows
25+
2426
Download the latest [Redshape installer](https://github.com/Spring3/redshape/releases).
2527

2628
You can download the .exe installer or the web installer. Both automatically detect the system architecture and set up the correct version.
2729

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

30-
3132
### Linux
3233

3334
Download the latest [Redshape release](https://github.com/Spring3/redshape/releases/latest).
3435

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

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

40-
Created by [Daniyil Vasylenko](https://github.com/Spring3)
40+
If you don't have access to a deployed instance of redmine, you can now run it in docker
41+
42+
Unfortuantely, you will have to configure it then yourself
43+
44+
```
45+
docker-compose -f docker-compose.yml up
46+
```
4147

48+
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
4249

4350
## FAQ
4451

@@ -48,6 +55,51 @@ Created by [Daniyil Vasylenko](https://github.com/Spring3)
4855
#### - Markdown is displayed incorrectly
4956
Please ask your Redmine admin user to check if it's enabled in `Administration -> General -> Text Formatting` menu. This path may change with the upcoming redmine releases, so please refer to Redmine documentation to find out exactly where this switch is located for your version of Redmine
5057

51-
#### - My antivirus / Defender / Mac OS warns that it's not safe to run this app
58+
#### - My antivirus / Defender / Mac OS warns that it's not safe to run this app
5259
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.
5360

61+
#### - How to use timer controls
62+
63+
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
64+
65+
#### - Idle behavior
66+
67+
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).
68+
69+
Optionally, it can automatically discard the idle time from the current timer when it is paused.
70+
71+
#### - More accurate progressbar
72+
73+
Issue progress slider can be changed with 1% step if configured (by default is 10%).
74+
Enable this if you have support in the server side (ruby, redmine) to use every percentage (33%, 81%, etc).
75+
76+
### AUR package
77+
78+
Electron-builder does not offer aur packages. Therefore, in the directory `support/package-aur` we can build those for ArchLinux/Manjaro distributions. It is "optimized" and just installs around 50MiB, using the system electron, as it is exposed here [issue 4059](https://github.com/electron-userland/electron-builder/issues/4059).
79+
80+
```sh
81+
bash support/package-aur/manager.sh pack # can be omitted if using the archive from the repo
82+
bash support/package-aur/manager.sh makepkg
83+
```
84+
85+
Before publishing a release, you have to update the PKGBUILD:
86+
87+
```sh
88+
# using npm script:
89+
npm run release:aur
90+
91+
# alternatively, with the shell:
92+
bash support/package-aur/manager.sh pack pkgbuild
93+
```
94+
95+
The second target (`pkgbuild`) will update the version and md5sums of the PKGBUILD.
96+
97+
98+
## License
99+
[GPL-3.0](https://github.com/Spring3/redshape/blob/master/LICENSE.md)
100+
101+
Created by [Daniyil Vasylenko](https://github.com/Spring3)
102+
103+
## Contributors
104+
105+
[rNoz](https://github.com/rnoz) from [Group4Layers](https://www.group4layers.com)

__mocks__/electron-store.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,24 @@ class Store {
1414
}
1515

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

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

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

31-
delete = (key) => delete values[key];
34+
delete = (key) => delete values[key];
3235

3336
clear = () => Store.__reset();
3437
}

__mocks__/electron.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const shell = {
44
openExternal: () => {}
55
};
66

7+
const powerMonitor = {
8+
getSystemIdleTime: jest.fn()
9+
};
10+
711
const remote = {
812
shell,
913
process: {
@@ -17,10 +21,20 @@ const remote = {
1721
if (path.includes('/common/request')) {
1822
return require('../common/request'); // eslint-disable-line
1923
}
24+
if (path.includes('electron')) {
25+
return { powerMonitor };
26+
}
2027
return undefined;
2128
}
2229
};
2330

31+
const ipcRenderer = {
32+
on: jest.fn(),
33+
send: jest.fn(),
34+
removeListener: jest.fn()
35+
};
36+
2437
module.exports = {
25-
remote
38+
remote,
39+
ipcRenderer
2640
};

__mocks__/image-mock.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
import React from 'react';
2+
3+
// eslint-disable-next-line react/jsx-filename-extension
14
export default () => (<div className="image" />);

__mocks__/ipc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
send: jest.fn(),
3+
setupTimer: jest.fn(),
4+
};
533 Bytes
Loading

0 commit comments

Comments
 (0)