Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular/build:dev-server",
"configurations": {
"development": {
"buildTarget": "kompakkt-repo:build:development"
Expand Down
1,394 changes: 611 additions & 783 deletions bun.lock

Large diffs are not rendered by default.

46 changes: 24 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,37 @@
"bun": ">=1.0.0"
},
"dependencies": {
"@angular/animations": "21.2.6",
"@angular/cdk": "21.2.4",
"@angular/common": "21.2.6",
"@angular/compiler": "21.2.6",
"@angular/core": "21.2.6",
"@angular/forms": "21.2.6",
"@angular/material": "21.2.4",
"@angular/platform-browser": "21.2.6",
"@angular/platform-browser-dynamic": "21.2.6",
"@angular/router": "21.2.6",
"@kompakkt/common": "git+https://github.com/Kompakkt/Common.git#49b7d222f9d6edd719ae7183ba53c96acedd9d0f",
"@kompakkt/komponents": "git+https://github.com/Kompakkt/Komponents.git#2bd681606d9b50f24856d6764b5aaf56953a4a39",
"@kompakkt/plugins": "git+https://github.com/Kompakkt/Plugins.git#3ce5c36c4a82683c984fed0ca259217c49878e91",
"@angular/animations": "22.2.3",
"@angular/cdk": "22.2.4",
"@angular/common": "22.2.3",
"@angular/compiler": "22.2.3",
"@angular/core": "22.2.3",
"@angular/forms": "22.2.3",
"@angular/material": "22.2.4",
"@angular/platform-browser": "22.2.3",
"@angular/platform-browser-dynamic": "22.2.3",
"@angular/router": "22.2.3",
"@kompakkt/common": "git+https://github.com/Kompakkt/Common.git#1ff4f862a5464d8cd236755a900f3722202552a9",
"@kompakkt/komponents": "git+https://github.com/Kompakkt/Komponents.git#7d4ad1ec8fa03e09ead55bbf667afea5db97f9f7",
"@kompakkt/plugins": "git+https://github.com/Kompakkt/Plugins.git#4e2c0f4665f01be50104df4417cc08c5bb97bbba",
"@kompakkt/server-openapi": "git+https://github.com/Kompakkt/Server.git#d73de702a6b2a94c4824f95e5fef008ac18d572b",
"bson-objectid": "^2.0.4",
"fast-deep-equal": "^3.1.3",
"fast-is-equal": "^1.3.3",
"fscreen": "1.2.0",
"idb": "^8.0.3",
"pluralize": "^8.0.0",
"rfdc": "^1.4.1",
"rxjs": "7.8.2",
"spark-md5": "^3.0.2",
"tslib": "^2.8.1",
"zone.js": "0.16.1"
"zone.js": "^0.16.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "21.2.5",
"@angular/cli": "21.2.5",
"@angular/compiler-cli": "21.2.6",
"@angular/language-service": "21.2.6",
"@angular-devkit/build-angular": "22.2.5",
"@angular/cli": "22.2.5",
"@angular/compiler-cli": "22.2.3",
"@angular/language-service": "22.2.3",
"@types/bun": "^1.4.3",
"@types/fscreen": "1.0.4",
"@types/node": "^25.5.0",
Expand All @@ -81,19 +82,20 @@
"oxlint": "^1.57.0",
"oxlint-tsgolint": "^0.18.1",
"ts-node": "~10.9.2",
"typescript": "^5.9.3",
"typescript": "^6.0.3",
"wait-on": "^9.0.4"
},
"overrides": {
"@kompakkt/komponents": {
"@angular/core": "21.2.6"
"@angular/core": "22.2.3"
},
"@kompakkt/plugins": {
"@angular/core": "21.2.6",
"@kompakkt/common": "git+https://github.com/Kompakkt/Common.git#49b7d222f9d6edd719ae7183ba53c96acedd9d0f"
"@angular/core": "22.2.3",
"@kompakkt/common": "git+https://github.com/Kompakkt/Common.git#1ff4f862a5464d8cd236755a900f3722202552a9"
}
},
"trustedDependencies": [
"@kompakkt/common",
"@kompakkt/plugins"
]
}
39 changes: 12 additions & 27 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import {
AfterContentChecked,
AfterViewInit,
ChangeDetectorRef,
Component,
effect,
ElementRef,
HostBinding,
inject,
signal,
viewChild,
} from '@angular/core';

import { MatSidenavModule } from '@angular/material/sidenav';
import { RouterOutlet } from '@angular/router';
import { CustomBrandingPlugin } from '@kompakkt/plugins/custom-branding';
import { AccountService, QueryActionService, SnackbarService } from 'src/app/services';
import { FooterComponent } from './components/navigation/footer/footer.component';
import { NavbarComponent } from './components/navigation/navbar/navbar.component';
import { SidenavContainerComponent } from './components/sidenav-container/sidenav-container.component';
import { NotificationAreaComponent } from './components/notification-area/notification-area.component';
import { environment } from 'src/environment';
import { MatButtonModule } from '@angular/material/button';
import { AccountService } from './services/account.service';
import { SnackbarService } from './services/snackbar.service';
import { QueryActionService } from './services/query-action.service';

@Component({
selector: 'app-root',
Expand All @@ -35,39 +33,34 @@ import { MatButtonModule } from '@angular/material/button';
SidenavContainerComponent,
NotificationAreaComponent,
],
host: {
'[style.--navbar-height]': 'contentHeights().navbar',
'[style.--footer-height]': 'contentHeights().footer',
'[style.--brand-color]': 'customPrimaryColor()',
},
})
export class AppComponent implements AfterViewInit, AfterContentChecked {
export class AppComponent implements AfterViewInit {
#account = inject(AccountService);
#snackbar = inject(SnackbarService);
#queryAction = inject(QueryActionService);
#changeDetector = inject(ChangeDetectorRef);
#customBrandingPlugin = inject<CustomBrandingPlugin>(CustomBrandingPlugin.providerToken, {
optional: true,
});
#customPrimaryColor = 'var(--brand-color);';
customPrimaryColor = signal('var(--brand-color);');

navbar = viewChild.required<ElementRef, ElementRef>('navbar', { read: ElementRef });
footer = viewChild.required<ElementRef, ElementRef>('footer', { read: ElementRef });
contentHeights = signal({ navbar: '67px', footer: '48px' });

@HostBinding('style.--navbar-height') get navbarHeight() {
return this.contentHeights().navbar;
}
@HostBinding('style.--footer-height') get footerHeight() {
return this.contentHeights().footer;
}

showDevInstanceWarning = signal(
'isDevelopmentInstance' in environment && !!environment.isDevelopmentInstance,
);

constructor() {
effect(() => {
const settings = this.#customBrandingPlugin?.settings();

if (settings?.customBrandColors) {
this.#customPrimaryColor = settings.customBrandColors.primary;
}
if (settings?.customBrandColors)
this.customPrimaryColor.set(settings.customBrandColors.primary);
});
}

Expand Down Expand Up @@ -99,12 +92,4 @@ export class AppComponent implements AfterViewInit, AfterContentChecked {

this.#queryAction.evaluateAction();
}

ngAfterContentChecked(): void {
this.#changeDetector.detectChanges();
}

@HostBinding('style.--brand-color') get brandColor() {
return this.#customPrimaryColor;
}
}
51 changes: 22 additions & 29 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { DragDropModule } from '@angular/cdk/drag-drop';
import { CommonModule, DATE_PIPE_DEFAULT_OPTIONS } from '@angular/common';
import { provideHttpClient, withFetch, withInterceptors } from '@angular/common/http';
import { APP_INITIALIZER, ApplicationConfig, LOCALE_ID, importProvidersFrom } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import {
ApplicationConfig,
LOCALE_ID,
importProvidersFrom,
inject,
provideAppInitializer,
} from '@angular/core';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
Expand Down Expand Up @@ -30,15 +35,19 @@ import { MatTableModule } from '@angular/material/table';
import { MatTabsModule } from '@angular/material/tabs';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { BrowserModule } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { RouteReuseStrategy, provideRouter, withRouterConfig } from '@angular/router';
import {
RouteReuseStrategy,
provideRouter,
withComponentInputBinding,
withRouterConfig,
withRouterResources,
} from '@angular/router';
import { TranslatePipe } from 'src/app/pipes/translate.pipe';
import { RouteReuse } from 'src/app/route-reuse-strategy';
import { exploreTimingInterceptor } from 'src/app/services/interceptors/explore-timing-interceptor';
import { httpErrorInterceptor } from 'src/app/services/interceptors/http-error-interceptor';
import { httpOptionsInterceptor } from 'src/app/services/interceptors/http-options-interceptor';
import { requestProgressInterceptor } from 'src/app/services/interceptors/request-progress-interceptor';
import { jwtInterceptor } from './services/interceptors/jwt-interceptor';
import { TranslateService } from 'src/app/services/translate.service';
import { pluginProviders } from './app.plugin';
Expand All @@ -48,7 +57,6 @@ export const appConfig: ApplicationConfig = {
providers: [
importProvidersFrom(
CommonModule,
BrowserModule,
DragDropModule,
MatAutocompleteModule,
MatSidenavModule,
Expand Down Expand Up @@ -77,42 +85,27 @@ export const appConfig: ApplicationConfig = {
MatPaginatorModule,
MatProgressBarModule,
MatSortModule,
FormsModule,
ReactiveFormsModule,
),
TranslateService,
TranslatePipe,
{
provide: [APP_INITIALIZER, RouteReuseStrategy],
useFactory: (service: TranslateService) => service.requestLanguage(),
deps: [TranslateService],
useClass: RouteReuse,
multi: true,
},
{
provide: DATE_PIPE_DEFAULT_OPTIONS,
useValue: { dateFormat: 'full' },
},
{
provide: LOCALE_ID,
useValue: 'en-US',
},
{ provide: RouteReuseStrategy, useClass: RouteReuse },
provideRouter(
routes,
withRouterConfig({
onSameUrlNavigation: 'reload',
}),
withRouterConfig({ onSameUrlNavigation: 'reload' }),
withComponentInputBinding(),
withRouterResources(),
),
provideAppInitializer(() => inject(TranslateService).requestLanguage('en')),
{ provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: { dateFormat: 'full' } },
{ provide: LOCALE_ID, useValue: 'en-US' },
provideAnimations(),
provideHttpClient(
withInterceptors([
exploreTimingInterceptor,
httpErrorInterceptor,
httpOptionsInterceptor,
requestProgressInterceptor,
jwtInterceptor,
]),
withFetch(),
),
pluginProviders,
],
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.plugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { provideExtender } from '@kompakkt/plugins/extender';
import { BackendService } from './services';
import { TranslatePipe } from './pipes';
import { TranslatePipe } from 'src/app/pipes/translate.pipe';

import plugins from './custom-plugins';
import { BackendService } from './services/backend.service';

export const pluginProviders = provideExtender({
plugins,
Expand Down
Loading
Loading