diff --git a/src/js/src/lib/action/tracker-action.ts b/src/js/src/lib/action/tracker-action.ts index 6bab4e4..7d2b4c6 100644 --- a/src/js/src/lib/action/tracker-action.ts +++ b/src/js/src/lib/action/tracker-action.ts @@ -2,7 +2,7 @@ import { KimaiApi } from "../api/kimai-api"; import { KimaiApiTrackerConnector } from "../api/kimai-api-tracker-connector"; import { ActionKey, StateKey } from "../constants"; import { Store } from "../store/store"; -import { Tracker } from "../tracker"; +import { Tracker, TrackerEvent } from "../tracker"; import { AppState } from "../types"; export function initTrackerAction() { @@ -15,7 +15,9 @@ export function initTrackerAction() { if (!Tracker.has(context)) { return console.warn("Tracker not found", { context }); } - Tracker.get(context)!.settings = settings; + const tracker = Tracker.get(context)!; + tracker.settings = settings; + tracker.dispatchEvent(new Event(TrackerEvent.requestWorkedToday)); } ); diff --git a/src/ui/angular.json b/src/ui/angular.json index 9ebb244..317fcd0 100644 --- a/src/ui/angular.json +++ b/src/ui/angular.json @@ -3,79 +3,6 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "ui": { - "projectType": "application", - "schematics": {}, - "root": "", - "sourceRoot": "src", - "prefix": "app", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:application", - "options": { - "outputPath": "dist/ui", - "index": "src/index.html", - "browser": "src/main.ts", - "polyfills": ["zone.js"], - "tsConfig": "tsconfig.app.json", - "assets": ["src/favicon.ico", "src/assets"], - "styles": ["src/styles.css"], - "scripts": [] - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "outputHashing": "all" - }, - "development": { - "optimization": false, - "extractLicenses": false, - "sourceMap": true - } - }, - "defaultConfiguration": "production" - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "configurations": { - "production": { - "buildTarget": "ui:build:production" - }, - "development": { - "buildTarget": "ui:build:development" - } - }, - "defaultConfiguration": "development" - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "buildTarget": "ui:build" - } - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "polyfills": ["zone.js", "zone.js/testing"], - "tsConfig": "tsconfig.spec.json", - "assets": ["src/favicon.ico", "src/assets"], - "styles": ["src/styles.css"], - "scripts": [] - } - } - } - }, "action-track-pi": { "projectType": "application", "schematics": {}, diff --git a/src/ui/src/app/app.component.css b/src/ui/src/app/app.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/ui/src/app/app.component.html b/src/ui/src/app/app.component.html deleted file mode 100644 index 1b7f2c3..0000000 --- a/src/ui/src/app/app.component.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - - - - - - - -
-
-
- -

Hello, {{ title }}

-

Congratulations! Your app is running. 🎉

-
- -
-
- @for (item of [ - { title: 'Explore the Docs', link: 'https://angular.dev' }, - { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, - { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, - { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, - { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, - ]; track item.title) { - - {{ item.title }} - - - - - } -
- -
-
-
- - - - - - - - - - - diff --git a/src/ui/src/app/app.component.spec.ts b/src/ui/src/app/app.component.spec.ts deleted file mode 100644 index 7f740ce..0000000 --- a/src/ui/src/app/app.component.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { AppComponent } from './app.component'; - -describe('AppComponent', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [AppComponent], - }).compileComponents(); - }); - - it('should create the app', () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); - - it(`should have the 'ui' title`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app.title).toEqual('ui'); - }); - - it('should render title', () => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('h1')?.textContent).toContain('Hello, ui'); - }); -}); diff --git a/src/ui/src/app/app.component.ts b/src/ui/src/app/app.component.ts deleted file mode 100644 index 532c60a..0000000 --- a/src/ui/src/app/app.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterOutlet } from '@angular/router'; - -@Component({ - selector: 'app-root', - standalone: true, - imports: [CommonModule, RouterOutlet], - templateUrl: './app.component.html', - styleUrl: './app.component.css' -}) -export class AppComponent { - title = 'ui'; -} diff --git a/src/ui/src/app/app.config.ts b/src/ui/src/app/app.config.ts deleted file mode 100644 index 6c6ef60..0000000 --- a/src/ui/src/app/app.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ApplicationConfig } from '@angular/core'; -import { provideRouter } from '@angular/router'; - -import { routes } from './app.routes'; - -export const appConfig: ApplicationConfig = { - providers: [provideRouter(routes)] -}; diff --git a/src/ui/src/app/app.routes.ts b/src/ui/src/app/app.routes.ts deleted file mode 100644 index dc39edb..0000000 --- a/src/ui/src/app/app.routes.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Routes } from '@angular/router'; - -export const routes: Routes = []; diff --git a/src/ui/src/assets/.gitkeep b/src/ui/src/assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/ui/src/index.html b/src/ui/src/index.html deleted file mode 100644 index e4a618e..0000000 --- a/src/ui/src/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Ui - - - - - - - - diff --git a/src/ui/src/main.ts b/src/ui/src/main.ts deleted file mode 100644 index 35b00f3..0000000 --- a/src/ui/src/main.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { bootstrapApplication } from '@angular/platform-browser'; -import { appConfig } from './app/app.config'; -import { AppComponent } from './app/app.component'; - -bootstrapApplication(AppComponent, appConfig) - .catch((err) => console.error(err)); diff --git a/src/ui/src/styles.css b/src/ui/src/styles.css deleted file mode 100644 index 90d4ee0..0000000 --- a/src/ui/src/styles.css +++ /dev/null @@ -1 +0,0 @@ -/* You can add global styles to this file, and also import other style files */