Skip to content

Commit

Permalink
Remix migration (#24)
Browse files Browse the repository at this point in the history
* Load session cookie secret

* Prevent sessions.ts from being send to client

I don't think this happened so far but changing it to .server.ts ensures that it will not happen.

* Send troi api requests in sequence

When sending them in parallel a race condition when writing the cache data to the session
might appear. This might then lead to the cache not storing data for all requests and waiting
for the troi api more often then necessary.

* Load employee data from personio api

* Add personio api endpoints for attendances

* Add session cache for personio get requests

TODO: update cached data after post, patch & delete

* Modify cache for data changing personio requests

* Add mininmal form for work time

* Submit new attendances to personio

* Delete and patch personio attendances

* Fix creating personio attendances

* Use memory session storage for e2e tests

* Mock personio api in e2e tests

* Add plus/minus logic in WorkingTimeForm

* Add save and delete in workTimeForm

* Unify PATCH/POST/DELETE into WorkTimeForm

* Fix form side effects when changing values

* Add work time to calendar view

* upgrade to action cache v4

* update upload sarif action to v2.16.1

* update notify-on-failure-gha to v1.4.0

* update github linter

* update all github linter occurences

* bump upload artifact from v3 to v4

* bump rest of DS GH actions to newest commit

* bump trivy action to v0.17.0

* bump docker login action to v3.0.0

* bump sigstore cosign installer to v3.4.0

* update npm dependencies

* Add link to confluence how to project favorite

* Remove text size form angie-link

* Change loading text after log in

* Fix typo in createSessionStorage

* Refetch session to prevent race conditions

* Fix typescript error with session

* Fix existingAttendances might not exist

* Replace unnecessary useEffect

* Parallelize loading of external APIs

* Merge work_time routes

* Get session centrally and commit after loading

* Refactor session is invalid check

* Merge time_entries routes

* Update work_time.($id).tsx

* Refactor PersonioCacheController

* Rename troi to TrackYourTime

* Update time_entries.($id).tsx

* Fix direct object access

* Import Session as type

* Rename fetchers

* Handle LoadingOverlay in projects with useFetchers

* Rename TroiButton to TrackyButton and use it

* Replace LoadingOverlay after login with Spinner

* Use correct type imports for Session

* Update staleWhileRevalidate.ts

* Move type definitions to central files

* Remove unused LoadingOverlay

* Move troiFetcher into Troi component

* Refactor Troi fetcher

* Move working time inputs to separate component

* Use button value to set WorkTimeForm method

* Remove loading prop

* Update logout button

* Add default color to TrackyButton

* Update logout button

* Fix strokeWidth

* Fix typo in descriptionToSegments

* Fix action parameter

* Rename WorkTimeFormData

* Refactor workTime validation

* Update TrackyButton to support type (late commit)

* Refactor workTimeForm validation

* Refactor all dateTime relating code to same file

* Fix minutesToTime bug

* Change time increment to 15 minutes

* Rename WorkingTimeInput to TimeInput

* Change time conversion to also 0-pad hours

* Rename WorkingTimeForm to WorkTimeForm

* Remove seldomly used date formatting util function

* Change TimeEntry validation from yup to zod

* Remove yup

* Move colors to TrackyButton

* Update projects.tsx

* Update section layout

* Move project route to index

* Rename time_entries route to time_entry

* Update _index.tsx

* Remove superfluous TS code

* CommitSession everywhere again

* Rename route time_entry to project_time

* Change component structure to reflect topics

* Move api files into their own folder

* Update entry.server.tsx

* Rename timeEntry to projectTime

* Fix vertical project spacing

* Close project form after update

* Fix task added to wrong description

* Remove zero padding before hour in week table

* Change work times optimistically

* Create start and end date constants

* Revert "Change work times optimistically"

This reverts commit 6d49cd7.

* Update pipeline.yml to run on fix-remix

* Rename value to time

* Fix time input for projects

* Add gap between InfoBanner and WorkTimeForm

* Show date non bold

* Make project headline smaller

* Make work times only editable after edit click

* Remove background image

* Leave form open after delete

* Add input readOnly styling

* Update dateTimeUtils.ts

* Move Meta and LinksFunction to root

* Load personio data after login

* Make WorkTimeForm into full stack component

- move component into route file
- update form based on timestamp
- handle attendances in state instead of session
- remove PersonioCacheController
- update week table after successful action
- change Time type

* Update login.tsx

* Update sessions.server.ts

* Update .talismanrc

* Update .talismanrc

* Refactor getTroiApi

* Dont save Troi data to session and remove caching

* Update project_time.($id).tsx

* Update .talismanrc

* Fix confluence link

* Move ProjectTimeForm to route file

* Update work time html

* Move info banner into week view

* Move heading into section

* Refactor TrackYourTime setup

* Update .talismanrc

* Update .talismanrc

* Update ProjectTimes HTML

* Update index HTML

* Update PersonioApiController.ts

* Refactor session

* Streamline login by parallelizing Promises

- write suitable troi data to session already

* Restructure troiApiController

- get rid of caching complications
- simplify getting troiApiService

* Update project time form HTML

* Make project times state and pass setter

* Update .talismanrc

* Remove debug logging

* Update .talismanrc

* Remove troi-library and update NPM packages

* Remove troi library dependency

- Remove calculationpositionids from getprojecttimes call to make parallelizable
- streamline login

* Update .talismanrc

* Update package-lock.json

* Revert "Update package-lock.json"

This reverts commit 1fdf180.

* Fix URLs in troiApiController

* Update .talismanrc

* Move consts out of component

* Make loadPhase more effcicient

* Load phases in index loader instead of

* Test removal of error handling in APIs

* Update .talismanrc

* Remove troi-library remnants

* Disable failing test

* Update .talismanrc

* Add crypto-js to pro dependencies

* Readd error handling in deleteAttendance

* Remove redundant await

* Fix login test

* Filter calculation positions for timeRecording

* Update .talismanrc

* Update .talismanrc

* Update pipeline.yml

* Update .talismanrc

* Change project times after action in useEffect

* Update _index.tsx

* Move responsibilities of TrackYourTime to children

* Remove redundant error handling in index

* Move TrackYourTime component into index

* Fix capitalization in filenames

* Update .talismanrc

* Move project description to its own component

* Sum up multiple attendances from personio

* Cleanup after bad merge

* Format fixes

* Fix capitalization issues

* Rename nocodbClient.server.ts to NocoDBClient.server.ts

* Rename troi.types.ts to Troi.types.ts

* Rename troiApiController.ts to TroiApiController.ts

* Fix capitalization

* Increase project heading font-size

* Fix task labels for multiple times on position

* Add space between times of same position

* Add Personio and Troi to titles

* Change favicon to own design

* Update Section.tsx

* Use better key for forms

* Handle delete flow with fetcher correctly

* Make TimeInput horizontal

* Disable recurring tasks if no phases for users

* Make working hours more responsive

* Remove frame on small screens

* Update package-lock.json

* Submit form using fetcher

* Allow shift+enter to add newline

* Change hours to text input again

- use @apply and centralize styles

* Improve textarea styling

- remove pre tag

* Use default isBillable for new projectTimes

- clean up props of projecttime
- use useId for labels

* Improve projectTime spacing

* Update projectTimeFormValidator.ts

* Use fieldset and legend instead of label

* Hide hours on allDay events

* Fix typo

* Update .talismanrc

* Log times of loader

* Update styles.css

* Change log out styling back

* Improve TimeInput icons

* Add disabled overlay instead of spinner

* Replace tracky button with styles

* Fix input error styling

* Harmonize controller logging

* Revert "Change log out styling back"

This reverts commit ef29846.

* Update _index.tsx

* Update .talismanrc

* Provide error message on missing credentials

* Load all phases and filter on server

Makes loading more efficient

* Add better logging and timing

* Update .talismanrc

* Fix nocodb stubs for test

* Refactor personio api

* Update .talismanrc

* Add work time validation

* Rename to Total working hours

* Refactor attendance merging

* Add maximum of 10 hours per project per day

* Improve time input styling

* Disable deletion and editing of invoiced times

* Update .talismanrc

* Hide employee information from the logs

* Handle isBillable and isInvoiced correctly

* Update .talismanrc

* Update README.md

* Update .talismanrc

* Switch from NocoDB auth token to API token

* Update .talismanrc

* Lower test timeout to 10s

* Pipe webserver output to stdout

* Refactor PersonioApiController

* Tests adding, updating and deleting work time

* Update .talismanrc

* Update pipeline.yml

* Update .talismanrc

* Update pipeline.yml

* Update .talismanrc

* Update pipeline.yml

* Update .talismanrc

---------

Co-authored-by: Malte Laukötter <[email protected]>
Co-authored-by: Hannes Schaletzky <[email protected]>
Co-authored-by: Christian Kaatz <[email protected]>
  • Loading branch information
4 people authored Mar 18, 2024
1 parent 64f49ab commit f9af43e
Show file tree
Hide file tree
Showing 165 changed files with 21,136 additions and 7,147 deletions.
21 changes: 18 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
node_modules
tests
.github
# Ignore everything
*

# Include files required for building the application (except for node_modules these are installed by docker)
!app
!public
public/build
!LICENSE
!package-lock.json
!package.json
!README.md
!remix.config.js
!remix.env.d.ts
!SECURITY.md
!security.txt
!tailwind.config.js
!tsconfig.json
!start.sh
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NOCODB_BASE_URL="https://metrics.ds4g.dev:38081"
NOCODB_API_TOKEN="NOCODB_API_TOKEN"
SESSION_COOKIE_SECRET="Your secret"
PERSONIO_CLIENT_ID="your-personio-client-id"
PERSONIO_CLIENT_SECRET="your-personio-client-secret"
42 changes: 33 additions & 9 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
module.exports = {
root: true,
extends: ["eslint:recommended", "prettier"],
plugins: ["svelte3"],
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"@remix-run/eslint-config",
"@remix-run/eslint-config/node",
],
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaVersion: 2020,
},
env: {
browser: true,
es2017: true,
node: true,
plugins: ["@typescript-eslint", "react"],
ignorePatterns: ["old"],
rules: {},
settings: {
react: {
version: "detect", // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// It will default to "latest" and warn if missing, and to "detect" in the future
},
},
};
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
# Too much noise with patch releases...
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
# Too much noise with patch releases...
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
129 changes: 0 additions & 129 deletions .github/workflows/ci-pipeline.yml

This file was deleted.

Loading

0 comments on commit f9af43e

Please sign in to comment.