diff --git a/frontend/package.json b/frontend/package.json index 001b0f00a..d88275828 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,7 +23,7 @@ "@angular/router": "^16.2.9", "@angular/service-worker": "^16.2.9", "@ctrl/ngx-codemirror": "^7.0.0", - "@mean-stream/ngbx": "^0.11.0", + "@mean-stream/ngbx": "^0.12.0", "@ng-bootstrap/ng-bootstrap": "^15.1.1", "@popperjs/core": "^2.11.8", "@sentry/angular-ivy": "^7.74.0", @@ -32,6 +32,7 @@ "bootstrap": "~5.2.3", "bootstrap-darkmode": "^5.0.1", "bootstrap-icons": "^1.11.1", + "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "codemirror": "^5.65.15", "file-saver": "^2.0.5", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 4f515d636..98bc34099 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -45,8 +45,8 @@ dependencies: specifier: ^7.0.0 version: 7.0.0(@angular/core@16.2.9)(@angular/forms@16.2.9)(codemirror@5.65.15) '@mean-stream/ngbx': - specifier: ^0.11.0 - version: 0.11.0(@angular/common@16.2.9)(@angular/core@16.2.9)(@angular/forms@16.2.9)(@angular/router@16.2.9)(@ng-bootstrap/ng-bootstrap@15.1.1)(bootstrap-darkmode@5.0.1)(bootstrap@5.2.3)(class-validator@0.14.0)(rxjs@7.8.1) + specifier: ^0.12.0 + version: 0.12.0(@angular/common@16.2.9)(@angular/core@16.2.9)(@angular/router@16.2.9)(@ng-bootstrap/ng-bootstrap@15.1.1)(bootstrap-darkmode@5.0.1)(bootstrap@5.2.3)(class-validator@0.14.0) '@ng-bootstrap/ng-bootstrap': specifier: ^15.1.1 version: 15.1.1(@angular/common@16.2.9)(@angular/core@16.2.9)(@angular/forms@16.2.9)(@angular/localize@16.2.9)(@popperjs/core@2.11.8)(rxjs@7.8.1) @@ -71,6 +71,9 @@ dependencies: bootstrap-icons: specifier: ^1.11.1 version: 1.11.1 + class-transformer: + specifier: ^0.5.1 + version: 0.5.1 class-validator: specifier: ^0.14.0 version: 0.14.0 @@ -2288,19 +2291,17 @@ packages: resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==} dev: true - /@mean-stream/ngbx@0.11.0(@angular/common@16.2.9)(@angular/core@16.2.9)(@angular/forms@16.2.9)(@angular/router@16.2.9)(@ng-bootstrap/ng-bootstrap@15.1.1)(bootstrap-darkmode@5.0.1)(bootstrap@5.2.3)(class-validator@0.14.0)(rxjs@7.8.1): - resolution: {integrity: sha512-KYtpF3VlaoLb2QCQg4EPl/mD54207tYwzj1PKqYWa9m3AvIUBzt0HLYvJtNJL9LholwhGV1kxEdp9YJ0r3JgKQ==} + /@mean-stream/ngbx@0.12.0(@angular/common@16.2.9)(@angular/core@16.2.9)(@angular/router@16.2.9)(@ng-bootstrap/ng-bootstrap@15.1.1)(bootstrap-darkmode@5.0.1)(bootstrap@5.2.3)(class-validator@0.14.0): + resolution: {integrity: sha512-rXuaI0YrZUSFToMD+XTyQSBI/KFRVbNo4NpSQ2cBjD+ck8kon0xNflq/BnzgSxUuO9T6FDlpZED17Cnnj0p7/Q==} peerDependencies: - '@angular/common': ^15.2.0 - '@angular/core': ^15.2.0 - '@angular/forms': 15.2.8 - '@angular/router': ^15.2.0 - '@ng-bootstrap/ng-bootstrap': ^14.0.0 + '@angular/common': ^16.2.0 + '@angular/core': ^16.2.0 + '@angular/router': ^16.2.0 + '@ng-bootstrap/ng-bootstrap': ^15.1.0 bootstrap: ^5.2.3 bootstrap-darkmode: ^0.9.1 class-validator: ^0.14.0 reflect-metadata: ^0.1.13 - rxjs: 7.8.1 peerDependenciesMeta: bootstrap-darkmode: optional: true @@ -2311,13 +2312,11 @@ packages: dependencies: '@angular/common': 16.2.9(@angular/core@16.2.9)(rxjs@7.8.1) '@angular/core': 16.2.9(rxjs@7.8.1)(zone.js@0.13.3) - '@angular/forms': 16.2.9(@angular/common@16.2.9)(@angular/core@16.2.9)(@angular/platform-browser@16.2.9)(rxjs@7.8.1) '@angular/router': 16.2.9(@angular/common@16.2.9)(@angular/core@16.2.9)(@angular/platform-browser@16.2.9)(rxjs@7.8.1) '@ng-bootstrap/ng-bootstrap': 15.1.1(@angular/common@16.2.9)(@angular/core@16.2.9)(@angular/forms@16.2.9)(@angular/localize@16.2.9)(@popperjs/core@2.11.8)(rxjs@7.8.1) bootstrap: 5.2.3(@popperjs/core@2.11.8) bootstrap-darkmode: 5.0.1(bootstrap@5.2.3) class-validator: 0.14.0 - rxjs: 7.8.1 tslib: 2.6.2 dev: false @@ -3905,6 +3904,10 @@ packages: engines: {node: '>=6.0'} dev: true + /class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + dev: false + /class-validator@0.14.0: resolution: {integrity: sha512-ct3ltplN8I9fOwUd8GrP8UQixwff129BkEtuWDKL5W45cQuLd19xqmTLu5ge78YDm/fdje6FMt0hGOhl0lii3A==} dependencies: @@ -7177,6 +7180,7 @@ packages: /prr@1.0.1: resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} + requiresBuild: true dev: true optional: true @@ -7494,6 +7498,7 @@ packages: /sax@1.3.0: resolution: {integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==} + requiresBuild: true dev: true optional: true diff --git a/frontend/src/app/assignment/assignment.module.ts b/frontend/src/app/assignment/assignment.module.ts index 36c0ca247..006c76ed3 100644 --- a/frontend/src/app/assignment/assignment.module.ts +++ b/frontend/src/app/assignment/assignment.module.ts @@ -4,14 +4,13 @@ import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {ModalModule} from '@mean-stream/ngbx'; +import {FormsModule as NgbxFormsModule, ModalModule} from '@mean-stream/ngbx'; import {ClipboardModule} from 'ngx-clipboard'; import {DndModule} from 'ngx-drag-drop'; import {SharedModule} from '../shared/shared.module'; import {AssignmentRoutingModule} from './assignment-routing.module'; import {AssignmentSharedModule} from './modules/shared/shared.module'; -import {ConfigFormComponent} from './pages/config-form/config-form.component'; import {CreateSolutionComponent} from './pages/create-solution/create-solution.component'; import {MyAssignmentsComponent} from './pages/my-assignments/my-assignments.component'; import {MySolutionsComponent} from './pages/my-solutions/my-solutions.component'; @@ -42,7 +41,6 @@ import {KeycloakBearerInterceptor} from "keycloak-angular"; TokenModalComponent, OverviewComponent, SettingsComponent, - ConfigFormComponent, ], imports: [ CommonModule, @@ -55,6 +53,7 @@ import {KeycloakBearerInterceptor} from "keycloak-angular"; AssignmentRoutingModule, DndModule, ModalModule, + NgbxFormsModule, ], providers: [ { diff --git a/frontend/src/app/assignment/model/config.ts b/frontend/src/app/assignment/model/config.ts new file mode 100644 index 000000000..aa5125020 --- /dev/null +++ b/frontend/src/app/assignment/model/config.ts @@ -0,0 +1,75 @@ +import {IsBoolean, IsEmail, IsIn, IsNotEmpty, IsString} from "class-validator"; +import {Presentation} from "@mean-stream/ngbx"; +import {Transform} from "class-transformer"; + +export class Config { + @Presentation({ + description: 'Your full name for use in assignments, solutions, comments and evaluations.', + }) + @IsString() + @IsNotEmpty() + name: string = ''; + + @Presentation({ + label: 'E-Mail Address', + description: 'Your email address for use in assignments, solutions, comments and evaluations.', + }) + @IsEmail() + email: string = ''; + + @Presentation({ + label: 'IDE', + description: 'Your preferred IDE for cloning repositories.', + optionLabels: { + vscode: 'VSCode', + 'code-oss': 'Code - OSS', + vscodium: 'VSCodium', + }, + }) + @IsIn(['vscode', 'code-oss', 'vscodium']) + ide: 'vscode' | 'code-oss' | 'vscodium' = 'vscode'; + + @Presentation({ + label: 'Git Clone Protocol', + description: 'The protocol to use when cloning a repository.', + optionLabels: { + https: 'HTTPS', + ssh: 'SSH', + }, + }) + @IsIn(['https', 'ssh']) + cloneProtocol: 'https' | 'ssh' = 'https'; + + @Presentation({ + label: 'Git Clone Ref', + description: 'The ref to use when cloning a repository. ' + + 'Tags are only supported in VSCode v1.74+ and Assignments imported after 2022-12-21.', + optionLabels: { + none: 'None', + tag: 'Tag', + }, + }) + @IsIn(['none', 'tag']) + cloneRef: 'none' | 'tag' = 'tag'; + + @Presentation({ + description: 'Enable Code Search globally.', + }) + @IsBoolean() + @Transform(({value}) => value === 'true') + codeSearch = true; + + @Presentation({ + description: 'Enable Similar Solutions globally.', + }) + @IsBoolean() + @Transform(({value}) => value === 'true') + similarSolutions = true; + + @Presentation({ + description: 'Enable Snippet Suggestions globally.', + }) + @IsBoolean() + @Transform(({value}) => value === 'true') + snippetSuggestions = true; +} diff --git a/frontend/src/app/assignment/modules/assignment/solution-table/solution-table.component.html b/frontend/src/app/assignment/modules/assignment/solution-table/solution-table.component.html index 8c6d188a5..7234d22e1 100644 --- a/frontend/src/app/assignment/modules/assignment/solution-table/solution-table.component.html +++ b/frontend/src/app/assignment/modules/assignment/solution-table/solution-table.component.html @@ -54,34 +54,6 @@ -
- -
- - - - - - - All Settings... - -
-