Skip to content

Commit

Permalink
many updates for 1.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
KatjaGlassConsulting committed Jun 24, 2023
1 parent e0176af commit 8db3390
Show file tree
Hide file tree
Showing 49 changed files with 35,694 additions and 41,780 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_VERSION=$npm_package_version
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changes

## 0.1.0 to 1.0.18

- many programming updates
- config update to activate additional functionality (see public\config.js)
- approval - in case the ApprovalBundle is used, additional related functionality will be available
- overtime - in case the ApprovalBundle is used and working with overtime, additional related functionality will be available
- summary15mins - a new tab is visible which indicates time-frames which are no 15 minute blocks
- breakChecks - an option to check for German Break Rules
- This version works with Kimai2 V1 and Kimai2 V1
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ TimeKex is available in the current version which does not contain tests. The so

The demonstration is running on the stable Kimai demo instance. Be aware that this demo instances is regularily rebuild.

## Version 1.0.18

The current released version of TimeKex is 1.0.18 and is running under Kimai2 Version 1 and Version 2. TimeKex does contain many undocumented features which can be controlled via the config.js file. You could activate different features when you change from "false" to "true". The following options are available:

- approval - in case the ApprovalBundle is used, additional related functionality will be available
- overtime - in case the ApprovalBundle is used and working with overtime, additional related functionality will be available
- summary15mins - a new tab is visible which indicates time-frames which are no 15 minute blocks
- breakChecks - an option to check for German Break Rules

Remark: The Kimai ApprovalBundle Plugin is currenty (summer 2023) not supporting Kimai2 Version 2. An update is expected in Q3/Q4 2023.

### CORS

It is meant to run TimeKex on the same server as Kimai, then you will not have issues with CORS. You could for example put the build folder in a folder "timeKex" under your kimai public folder. If you run it on different servers, make sure to enable CORS from what ever URL you have.

## License

### Code & Scripts
Expand Down
Binary file modified exampleFiles/TimeKex_timeData.xlsx
Binary file not shown.
73,121 changes: 32,232 additions & 40,889 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 11 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
{
"name": "timekex",
"version": "0.1.2",
"version": "1.0.18",
"private": true,
"homepage": ".",
"license": "MIT",
"dependencies": {
"@reduxjs/toolkit": "^1.7.1",
"@reduxjs/toolkit": "^1.8.2",
"axios": "^0.27.2",
"node-fetch": "^2.6.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"read-excel-file": "^5.2.26",
"react-redux": "^7.2.8",
"react-router-dom": "^5.3.3",
"read-excel-file": "^5.3.4",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^2.0.3",
"typescript": "^4.5.4"
"semantic-ui-react": "^2.1.3",
"typescript": "^4.7.4"
},
"devDependencies": {
"react-scripts": "4.0.3"
},
"resolutions": {
"immer": "9.0.12",
"glob-parent": "6.0.2",
"nth-check": "2.0.1",
"sevmer": "7.3.5"
"react-scripts": "^5.0.1",
"xhr2": "^0.2.1"
},
"scripts": {
"preinstall": "npx npm-force-resolutions",
Expand Down
6 changes: 5 additions & 1 deletion public/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
var config = {
"kimaiAPI" : "https://demo-stable.kimai.org/api/",
"ignoreActivities" : ["Vacation","Public Holiday"],
"adminUser" : ["anna_admin","susan_super"]
"adminUser" : ["anna_admin","susan_super"],
"approval" : false,
"overtime" : false,
"summary15mins" : false,
"breakChecks" : false
}
52 changes: 29 additions & 23 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
import React from 'react'
import React, {useEffect} from 'react'
import { useDispatch } from 'react-redux'
import {
HashRouter as Router,
Switch,
Route,
Redirect,
} from 'react-router-dom'
import { connect } from "react-redux";

import Main from './features/views/Main';
import OvertimeOverview from './features/views/OvertimeOverview';
import Admin from './features/views/Admin';
import Info from './features/views/Info';
import Login from './features/views/Login';
import { globalConfigSet } from './features/globalConfig/globalConfigSlice';

class App extends React.Component {
constructor(props) {
super(props)
this.props.dispatch(globalConfigSet(this.props._config));
}
function App (props) {
const dispatch = useDispatch();

render() {
return (
<Router>
<div className="App">
<Switch>
<Route exact path="/" component={Main} />
<Route exact path="/admin" component={Admin} />
<Route exact path="/info" component={Info} />
<Route exact path="/login" component={Login} />
<Redirect to="/" />
</Switch>
</div>
</Router>
)
}
useEffect(()=>{
const user = JSON.parse(localStorage.getItem("User"));
if (!props._config.username && !props._config.password && user){
dispatch(globalConfigSet({...props._config, username: user.user, password: user.password}));
} else {
dispatch(globalConfigSet(props._config));
}
},[props._config, dispatch])

return (
<Router>
<div className="App">
<Switch>
<Route exact path="/" component={Main} />
<Route exact path="/overtime" component={OvertimeOverview} />
<Route exact path="/admin" component={Admin} />
<Route exact path="/info" component={Info} />
<Route exact path="/login" component={Login} />
<Redirect to="/" />
</Switch>
</div>
</Router>
)
}

export default connect()(App);
export default App;
1 change: 1 addition & 0 deletions src/api/kimaiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export async function kimaiClient(method, config ) {

req.setRequestHeader('X-AUTH-USER', config.username);
req.setRequestHeader('X-AUTH-TOKEN', config.password);
req.setRequestHeader('Cache-Control', 'no-cache, no-store, max-age=0');

req.onload = () => resolve(req.response);
req.onerror = () => reject(req.statusText);
Expand Down
1 change: 1 addition & 0 deletions src/api/kimaiClientPostGeneric.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export async function kimaiClientPostGeneric(method, config, data, type = "POST"
req.setRequestHeader('Content-Type', 'application/json');
req.setRequestHeader('X-AUTH-USER', config.username);
req.setRequestHeader('X-AUTH-TOKEN', config.password);
req.setRequestHeader('Cache-Control', 'no-cache, no-store, max-age=0');

req.onload = () => resolve(req.response);
req.onerror = () => reject(req);
Expand Down
1 change: 1 addition & 0 deletions src/api/kimaiClientPostTimesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export async function kimaiClientPostTimesheet(timesheet, config) {
req.setRequestHeader('Content-Type', 'application/json');
req.setRequestHeader('X-AUTH-USER', config.username);
req.setRequestHeader('X-AUTH-TOKEN', config.password);
req.setRequestHeader('Cache-Control', 'no-cache, no-store, max-age=0');

req.onload = () => resolve(req.response);
req.onerror = () => reject(req);
Expand Down
30 changes: 20 additions & 10 deletions src/app/store.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
import { configureStore } from '@reduxjs/toolkit';
import excelDataReducer from '../features/excelImport/excelSlice';
import kimaiDataReducer from '../features/kimaiDB/kimaiSlice';
import kimaiTimesheetsReducer from '../features/kimaiTimesheets/kimaiTimesheetsSlice';
import updateTimesheetsReducer from '../features/updateTimesheets/updateTimesheetsSlice';
import { globalConfigReducer } from '../features/globalConfig/globalConfigSlice';
import {messagesReducer} from '../features/messages/messagesSlice';
import { configureStore } from '@reduxjs/toolkit'
import excelDataReducer from '../features/excelImport/excelSlice'
import excelMetaDataReducer from '../features/excelMetaImport/excelMetaSlice'
import kimaiDataReducer from '../features/kimaiDB/kimaiSlice'
import kimaiRawDataReducer from '../features/kimaiRawData/kimaiRawSlice'
import kimaiTimesheetsReducer from '../features/kimaiTimesheets/kimaiTimesheetsSlice'
import updateTimesheetsReducer from '../features/updateTimesheets/updateTimesheetsSlice'
import approvalReducer from '../features/approvalSlice'
import overtimeReducer from '../features/overtimeSlice'
import overtimeOverviewReducer from '../features/overtimeOverviewSlice'
import { globalConfigReducer } from '../features/globalConfig/globalConfigSlice'
import { messagesReducer } from '../features/messages/messagesSlice'

export default configureStore({
reducer: {
excelData: excelDataReducer,
kimaiData: kimaiDataReducer,
config: globalConfigReducer,
updateTimesheets: updateTimesheetsReducer,
kimaiTimesheets : kimaiTimesheetsReducer,
messages: messagesReducer
kimaiTimesheets: kimaiTimesheetsReducer,
messages: messagesReducer,
approval: approvalReducer,
overtime: overtimeReducer,
overtimeOverview: overtimeOverviewReducer,
kimaiRawData: kimaiRawDataReducer,
excelMetaData: excelMetaDataReducer,
},
})
})
Loading

0 comments on commit 8db3390

Please sign in to comment.