diff --git a/src/main/webapp/app/account/settings/settings.component.ts b/src/main/webapp/app/account/settings/settings.component.ts index 75e9187aa1bf..26114dc25830 100644 --- a/src/main/webapp/app/account/settings/settings.component.ts +++ b/src/main/webapp/app/account/settings/settings.component.ts @@ -25,12 +25,12 @@ export class SettingsComponent implements OnInit { account: User; languages = LANGUAGES; settingsForm: FormGroup; - isRegistrationEnabled = false; + isRegistrationEnabled = true; ngOnInit() { this.profileService.getProfileInfo().subscribe((profileInfo) => { if (profileInfo) { - this.isRegistrationEnabled = profileInfo.registrationEnabled || false; + this.isRegistrationEnabled = true; //profileInfo.registrationEnabled || false; } }); this.accountService.identity().then((user) => { diff --git a/src/main/webapp/app/app-routing.module.ts b/src/main/webapp/app/app-routing.module.ts index 607fb3a3f6b8..12d508d32d4a 100644 --- a/src/main/webapp/app/app-routing.module.ts +++ b/src/main/webapp/app/app-routing.module.ts @@ -103,6 +103,14 @@ const LAYOUT_ROUTES: Routes = [navbarRoute, ...errorRoute]; }, ], }, + // ===== USER SETTINGS ===== + { + path: 'user-settings', + loadChildren: () => import('./shared/user-settings/user-settings.route').then((m) => m.UserSettingsRoutes), + data: { + authorities: [Authority.USER], + }, + }, // ===== COURSE MANAGEMENT ===== { path: 'course-management', diff --git a/src/main/webapp/app/app.module.ts b/src/main/webapp/app/app.module.ts index 1e43beff4fc1..37a1a23674a8 100644 --- a/src/main/webapp/app/app.module.ts +++ b/src/main/webapp/app/app.module.ts @@ -20,7 +20,6 @@ import { ArtemisComplaintsModule } from 'app/complaints/complaints.module'; import { OrionOutdatedComponent } from 'app/shared/orion/outdated-plugin-warning/orion-outdated.component'; import { LoadingNotificationComponent } from 'app/shared/notification/loading-notification/loading-notification.component'; import { NotificationPopupComponent } from 'app/shared/notification/notification-popup/notification-popup.component'; -import { UserSettingsModule } from 'app/shared/user-settings/user-settings.module'; import { ThemeSwitchComponent } from 'app/core/theme/theme-switch.component'; import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; import { FaIconLibrary } from '@fortawesome/angular-fontawesome'; @@ -41,7 +40,6 @@ import { ScrollingModule } from '@angular/cdk/scrolling'; ArtemisSystemNotificationModule, ArtemisComplaintsModule, ArtemisHeaderExercisePageWithDetailsModule, - UserSettingsModule, ThemeSwitchComponent, ArtemisSharedComponentModule, ScrollingModule, diff --git a/src/main/webapp/app/shared/user-settings/account-information/account-information.component.ts b/src/main/webapp/app/shared/user-settings/account-information/account-information.component.ts index e08261ab7ae0..22507f51c25d 100644 --- a/src/main/webapp/app/shared/user-settings/account-information/account-information.component.ts +++ b/src/main/webapp/app/shared/user-settings/account-information/account-information.component.ts @@ -10,11 +10,16 @@ import { base64StringToBlob } from 'app/utils/blob-util'; import { HttpErrorResponse, HttpResponse } from '@angular/common/http'; import { UserSettingsService } from 'app/shared/user-settings/user-settings.service'; import { AlertService, AlertType } from 'app/core/util/alert.service'; +import { ArtemisSharedModule } from 'app/shared/shared.module'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; @Component({ selector: 'jhi-account-information', + standalone: true, templateUrl: './account-information.component.html', styleUrls: ['../user-settings.scss'], + imports: [TranslateDirective, FontAwesomeModule, ArtemisSharedModule], }) export class AccountInformationComponent implements OnInit { currentUser?: User; diff --git a/src/main/webapp/app/shared/user-settings/ide-preferences/ide-settings.component.ts b/src/main/webapp/app/shared/user-settings/ide-preferences/ide-settings.component.ts index 7ea2ade7e2cb..2bc97ec96a30 100644 --- a/src/main/webapp/app/shared/user-settings/ide-preferences/ide-settings.component.ts +++ b/src/main/webapp/app/shared/user-settings/ide-preferences/ide-settings.component.ts @@ -1,16 +1,27 @@ -import { ChangeDetectionStrategy, Component, OnInit, WritableSignal, signal } from '@angular/core'; +import { ChangeDetectionStrategy, Component, OnInit, WritableSignal, inject, signal } from '@angular/core'; import { ProgrammingLanguage } from 'app/entities/programming/programming-exercise.model'; import { Ide, ideEquals } from 'app/shared/user-settings/ide-preferences/ide.model'; import { faPlus, faTrash } from '@fortawesome/free-solid-svg-icons'; import { IdeSettingsService } from 'app/shared/user-settings/ide-preferences/ide-settings.service'; +import { RouterModule } from '@angular/router'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { ArtemisSharedModule } from 'app/shared/shared.module'; +import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; +import { FormDateTimePickerModule } from 'app/shared/date-time-picker/date-time-picker.module'; +import { DocumentationLinkComponent } from 'app/shared/components/documentation-link/documentation-link.component'; @Component({ selector: 'jhi-ide-preferences', templateUrl: './ide-settings.component.html', + standalone: true, styleUrls: ['./ide-settings.scss'], changeDetection: ChangeDetectionStrategy.OnPush, + imports: [TranslateDirective, RouterModule, FontAwesomeModule, ArtemisSharedModule, ArtemisSharedComponentModule, FormDateTimePickerModule, DocumentationLinkComponent], }) export class IdeSettingsComponent implements OnInit { + private ideSettingsService = inject(IdeSettingsService); + protected readonly ProgrammingLanguage = ProgrammingLanguage; protected readonly faPlus = faPlus; protected readonly faTrash = faTrash; @@ -22,8 +33,6 @@ export class IdeSettingsComponent implements OnInit { // languages that have no IDE assigned yet remainingProgrammingLanguages: ProgrammingLanguage[] = Object.values(ProgrammingLanguage).filter((x) => x !== ProgrammingLanguage.EMPTY); - constructor(private ideSettingsService: IdeSettingsService) {} - ngOnInit() { this.ideSettingsService.loadPredefinedIdes().subscribe((predefinedIde) => { this.PREDEFINED_IDE = predefinedIde; diff --git a/src/main/webapp/app/shared/user-settings/notification-settings/notification-settings.component.ts b/src/main/webapp/app/shared/user-settings/notification-settings/notification-settings.component.ts index bebae26620bc..6a981a2dd6fa 100644 --- a/src/main/webapp/app/shared/user-settings/notification-settings/notification-settings.component.ts +++ b/src/main/webapp/app/shared/user-settings/notification-settings/notification-settings.component.ts @@ -1,12 +1,17 @@ -import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { Component, OnInit, inject } from '@angular/core'; import { UserSettingsDirective } from 'app/shared/user-settings/user-settings.directive'; import { UserSettingsCategory } from 'app/shared/constants/user-settings.constants'; import { NotificationSetting } from 'app/shared/user-settings/notification-settings/notification-settings-structure'; -import { UserSettingsService } from 'app/shared/user-settings/user-settings.service'; import { UserSettingsStructure } from 'app/shared/user-settings/user-settings.model'; -import { AlertService } from 'app/core/util/alert.service'; import { faInfoCircle, faSave } from '@fortawesome/free-solid-svg-icons'; import { NotificationSettingsService, reloadNotificationSideBarMessage } from 'app/shared/user-settings/notification-settings/notification-settings.service'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { RouterModule } from '@angular/router'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { ArtemisSharedModule } from 'app/shared/shared.module'; +import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; +import { FormDateTimePickerModule } from 'app/shared/date-time-picker/date-time-picker.module'; +import { DocumentationLinkComponent } from 'app/shared/components/documentation-link/documentation-link.component'; export enum NotificationSettingsCommunicationChannel { WEBAPP, @@ -16,21 +21,16 @@ export enum NotificationSettingsCommunicationChannel { @Component({ selector: 'jhi-notification-settings', templateUrl: 'notification-settings.component.html', + standalone: true, styleUrls: ['../user-settings.scss'], + imports: [TranslateDirective, RouterModule, FontAwesomeModule, ArtemisSharedModule, ArtemisSharedComponentModule, FormDateTimePickerModule, DocumentationLinkComponent], }) export class NotificationSettingsComponent extends UserSettingsDirective implements OnInit { - // Icons - faSave = faSave; - faInfoCircle = faInfoCircle; + private notificationSettingsService = inject(NotificationSettingsService); - constructor( - userSettingsService: UserSettingsService, - changeDetector: ChangeDetectorRef, - alertService: AlertService, - private notificationSettingsService: NotificationSettingsService, - ) { - super(userSettingsService, alertService, changeDetector); - } + // Icons + protected readonly faSave = faSave; + protected readonly faInfoCircle = faInfoCircle; declare userSettings: UserSettingsStructure; declare settings: Array; diff --git a/src/main/webapp/app/shared/user-settings/science-settings/science-settings.component.ts b/src/main/webapp/app/shared/user-settings/science-settings/science-settings.component.ts index 514f2679679e..8ec8fcc2dc24 100644 --- a/src/main/webapp/app/shared/user-settings/science-settings/science-settings.component.ts +++ b/src/main/webapp/app/shared/user-settings/science-settings/science-settings.component.ts @@ -1,21 +1,31 @@ -import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; +import { Component, OnDestroy, OnInit, inject } from '@angular/core'; import { UserSettingsDirective } from 'app/shared/user-settings/user-settings.directive'; import { UserSettingsCategory } from 'app/shared/constants/user-settings.constants'; -import { UserSettingsService } from 'app/shared/user-settings/user-settings.service'; import { UserSettingsStructure } from 'app/shared/user-settings/user-settings.model'; -import { AlertService } from 'app/core/util/alert.service'; import { faInfoCircle, faSave } from '@fortawesome/free-solid-svg-icons'; import { ScienceSetting } from 'app/shared/user-settings/science-settings/science-settings-structure'; import { ScienceSettingsService } from 'app/shared/user-settings/science-settings/science-settings.service'; import { FeatureToggle, FeatureToggleService } from 'app/shared/feature-toggle/feature-toggle.service'; import { Subscription } from 'rxjs'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { RouterModule } from '@angular/router'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { ArtemisSharedModule } from 'app/shared/shared.module'; +import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; +import { FormDateTimePickerModule } from 'app/shared/date-time-picker/date-time-picker.module'; +import { DocumentationLinkComponent } from 'app/shared/components/documentation-link/documentation-link.component'; @Component({ selector: 'jhi-science-settings', + standalone: true, templateUrl: 'science-settings.component.html', styleUrls: ['../user-settings.scss'], + imports: [TranslateDirective, RouterModule, FontAwesomeModule, ArtemisSharedModule, ArtemisSharedComponentModule, FormDateTimePickerModule, DocumentationLinkComponent], }) export class ScienceSettingsComponent extends UserSettingsDirective implements OnInit, OnDestroy { + private scienceSettingsService = inject(ScienceSettingsService); + private featureToggleService = inject(FeatureToggleService); + // Icons faSave = faSave; faInfoCircle = faInfoCircle; @@ -23,16 +33,6 @@ export class ScienceSettingsComponent extends UserSettingsDirective implements O private featureToggleActiveSubscription: Subscription; featureToggleActive = false; - constructor( - userSettingsService: UserSettingsService, - changeDetector: ChangeDetectorRef, - alertService: AlertService, - private scienceSettingsService: ScienceSettingsService, - private featureToggleService: FeatureToggleService, - ) { - super(userSettingsService, alertService, changeDetector); - } - declare userSettings: UserSettingsStructure; declare settings: Array; diff --git a/src/main/webapp/app/shared/user-settings/ssh-settings/details/ssh-user-settings-key-details.component.html b/src/main/webapp/app/shared/user-settings/ssh-settings/details/ssh-user-settings-key-details.component.html index 661cd1c3ae3d..29e45d89de0d 100644 --- a/src/main/webapp/app/shared/user-settings/ssh-settings/details/ssh-user-settings-key-details.component.html +++ b/src/main/webapp/app/shared/user-settings/ssh-settings/details/ssh-user-settings-key-details.component.html @@ -1,4 +1,4 @@ -@if (isLoading) { +@if (isLoading()) { } @else { @if (!isCreateMode) { @@ -17,25 +17,25 @@
{{ displayedKeyLabel }}
{{ displayedKeyLabel() }}
- {{ copyInstructions }} + {{ copyInstructions() }}
{{ copyInstructions }}
{{ copyInstructions() }}
@@ -43,7 +43,7 @@