-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin): Basic Admin UI to add and edit fields of entity and deta…
…ils view (#2057) closes #2047 , closes #2048 --------- This functionality has been developed for the project “codo”. codo is developed under the projects “Landungsbrücken – Patenschaften in Hamburg stärken” and “openTransfer Patenschaften”. It is funded through the program “Menschen stärken Menschen” by the German Federal Ministry of Family Affairs, Senior Citizens, Women and Youth. More information at https://github.com/codo-mentoring “Landungsbrücken – Patenschaften in Hamburg stärken” is a project of BürgerStiftung Hamburg in cooperation with the Mentor.Ring Hamburg. With a mix of networking opportunities, capacity building and financial support the project strengthens Hamburg’s scene of mentoring projects since its founding in 2016. The “Stiftung Bürgermut” foundation since 2007 supports the digital and real exchange of experiences and connections of active citizens. Within the federal program “Menschen stärken Menschen” the foundation as part of its program “openTransfer Patenschaften” offers support services for connecting, spreading and upskilling mentoring organisations across Germany. Diese Funktion wurde entwickelt für das Projekt codo. codo wird entwickelt im Rahmen der Projekte Landungsbrücken – Patenschaften in Hamburg stärken und openTransfer Patenschaften. Er ist gefördert durch das Bundesprogramm Menschen stärken Menschen des Bundesministeriums für Familie, Senioren, Frauen und Jugend. Mehr Informationen unter https://github.com/codo-mentoring “Landungsbrücken – Patenschaften in Hamburg stärken” ist ein Projekt der BürgerStiftung Hamburg in Kooperation mit dem Mentor.Ring Hamburg. Mit einer Mischung aus Vernetzungsangeboten, Qualifizierungsmaßnahmen und finanzieller Förderung stärkt das Projekt die Hamburger Szene der Patenschaftsprojekte seit der Gründung im Jahr 2016. Die Stiftung Bürgermut fördert seit 2007 den digitalen und realen Erfahrungsaustausch und die Vernetzung von engagierten Bürger:innen. Innerhalb des Bundesprogramms „Menschen stärken Menschen” bietet die Stiftung im Rahmen ihres Programms openTransfer Patenschaften Unterstützungsleistungen zur Vernetzung, Verbreitung und Qualifizierung von Patenschafts- und Mentoringorganisationen bundesweit. Co-authored-by: codo-mentoring <117934638+codo-mentoring@users.noreply.github.com> Co-authored-by: Simon <simon@aam-digital.com>
- Loading branch information
1 parent
9d650ec
commit 3b4168b
Showing
126 changed files
with
2,980 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/child-dev-project/attendance/attendance-manager/attendance-manager.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/app/child-dev-project/attendance/model/event-attendance.datatype.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { testDatatype } from "../../../core/entity/schema/entity-schema.service.spec"; | ||
import { EventAttendanceDatatype } from "./event-attendance.datatype"; | ||
import { EventAttendance } from "./event-attendance"; | ||
import { defaultAttendanceStatusTypes } from "../../../core/config/default-config/default-attendance-status-types"; | ||
import { DefaultDatatype } from "../../../core/entity/default-datatype/default.datatype"; | ||
import { StringDatatype } from "../../../core/basic-datatypes/string/string.datatype"; | ||
import { ConfigurableEnumDatatype } from "../../../core/basic-datatypes/configurable-enum/configurable-enum-datatype/configurable-enum.datatype"; | ||
import { ConfigurableEnumService } from "../../../core/basic-datatypes/configurable-enum/configurable-enum.service"; | ||
|
||
describe("Schema data type: event-attendance", () => { | ||
testDatatype( | ||
EventAttendanceDatatype, | ||
new EventAttendance(defaultAttendanceStatusTypes[0], "test remark"), | ||
{ | ||
status: defaultAttendanceStatusTypes[0].id, | ||
remarks: "test remark", | ||
}, | ||
undefined, | ||
[ | ||
{ provide: DefaultDatatype, useClass: StringDatatype, multi: true }, | ||
{ | ||
provide: DefaultDatatype, | ||
useClass: ConfigurableEnumDatatype, | ||
multi: true, | ||
}, | ||
{ | ||
provide: ConfigurableEnumService, | ||
useValue: { getEnumValues: () => defaultAttendanceStatusTypes }, | ||
}, | ||
], | ||
); | ||
}); |
16 changes: 16 additions & 0 deletions
16
src/app/child-dev-project/attendance/model/event-attendance.datatype.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Injectable } from "@angular/core"; | ||
import { SchemaEmbedDatatype } from "../../../core/basic-datatypes/schema-embed/schema-embed.datatype"; | ||
import { EntitySchemaService } from "../../../core/entity/schema/entity-schema.service"; | ||
import { EntityConstructor } from "../../../core/entity/model/entity"; | ||
import { EventAttendance } from "./event-attendance"; | ||
|
||
@Injectable() | ||
export class EventAttendanceDatatype extends SchemaEmbedDatatype { | ||
static override dataType = EventAttendance.DATA_TYPE; | ||
|
||
override embeddedType = EventAttendance as unknown as EntityConstructor; | ||
|
||
constructor(schemaService: EntitySchemaService) { | ||
super(schemaService); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
188 changes: 188 additions & 0 deletions
188
src/app/core/admin/admin-entity-details/admin-entity-field/admin-entity-field.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
<h2 mat-dialog-title i18n>Configure Field "{{ entitySchemaField.label }}"</h2> | ||
<app-dialog-close mat-dialog-close></app-dialog-close> | ||
|
||
<mat-dialog-content> | ||
<p i18n> | ||
The field settings here apply to the record type overall and affect both the | ||
field here in the current view as well as all other forms and lists where | ||
this field is displayed. | ||
</p> | ||
|
||
<form [formGroup]="form"> | ||
<mat-tab-group formGroupName="schemaFields"> | ||
<mat-tab label="Basics" i18n-label> | ||
<div class="grid-layout margin-top-regular"> | ||
<div class="entity-form-cell"> | ||
<mat-form-field> | ||
<mat-label>Label</mat-label> | ||
<input formControlName="label" matInput #formLabel /> | ||
</mat-form-field> | ||
|
||
<mat-form-field floatLabel="always"> | ||
<mat-label> | ||
Label (short) | ||
<fa-icon | ||
icon="question-circle" | ||
matTooltip="Optionally you can define an additional shorter label to be displayed in table headers and other places where space is limited." | ||
i18n-matTooltip | ||
></fa-icon> | ||
</mat-label> | ||
<input | ||
formControlName="labelShort" | ||
matInput | ||
[placeholder]="formLabel.value" | ||
/> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<mat-label i18n> | ||
Description | ||
<fa-icon | ||
icon="question-circle" | ||
matTooltip="The description provides additional explanation or context about this field. It is usually displayed as a help icon with tooltip." | ||
i18n-matTooltip | ||
></fa-icon> | ||
</mat-label> | ||
<textarea | ||
formControlName="description" | ||
matInput | ||
rows="3" | ||
></textarea> | ||
</mat-form-field> | ||
</div> | ||
|
||
<div class="entity-form-cell"> | ||
<mat-form-field> | ||
<mat-label i18n> | ||
Field ID (readonly) | ||
<fa-icon | ||
icon="question-circle" | ||
matTooltip="The internal ID of the field is used at a technical level in the database. The ID cannot be changed after the field has been created." | ||
i18n-matTooltip | ||
></fa-icon> | ||
</mat-label> | ||
<input [formControl]="fieldIdForm" matInput /> | ||
<fa-icon | ||
*ngIf="fieldIdForm.disabled" | ||
icon="lock" | ||
matSuffix | ||
></fa-icon> | ||
<mat-error *ngIf="fieldIdForm.hasError('uniqueId')"> | ||
{{ fieldIdForm.getError("uniqueId") }} | ||
</mat-error> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<mat-label>Type</mat-label> | ||
<app-basic-autocomplete | ||
formControlName="dataType" | ||
#formDataType | ||
[options]="dataTypes" | ||
[optionToString]="objectToLabel" | ||
[valueMapper]="objectToValue" | ||
></app-basic-autocomplete> | ||
</mat-form-field> | ||
|
||
<!-- "additional" for enum datatype --> | ||
<mat-form-field | ||
*ngIf=" | ||
typeAdditionalOptions && | ||
formDataType.value === 'configurable-enum' | ||
" | ||
> | ||
<mat-label i18n> | ||
Type Details (dropdown options set) | ||
<fa-icon | ||
icon="question-circle" | ||
matTooltip="Select an existing set of options to share between multiple fields or create a new, independent list of dropdown options." | ||
i18n-matTooltip | ||
></fa-icon> | ||
</mat-label> | ||
|
||
<app-basic-autocomplete | ||
formControlName="additional" | ||
[options]="typeAdditionalOptions ?? []" | ||
[optionToString]="objectToLabel" | ||
[valueMapper]="objectToValue" | ||
[createOption]="createNewAdditionalOption" | ||
></app-basic-autocomplete> | ||
|
||
<button | ||
mat-icon-button | ||
matSuffix | ||
(click)="openEnumOptions($event)" | ||
> | ||
<fa-icon icon="wrench"></fa-icon> | ||
</button> | ||
</mat-form-field> | ||
|
||
<!-- "additional" for entity ref datatypes --> | ||
<mat-form-field | ||
*ngIf=" | ||
(typeAdditionalOptions && formDataType.value === 'entity') || | ||
formDataType.value === 'entity-array' | ||
" | ||
> | ||
<mat-label i18n> | ||
Type Details (target record type) | ||
<fa-icon | ||
icon="question-circle" | ||
matTooltip="Select from which type of records the user can select and link to with this field." | ||
i18n-matTooltip | ||
></fa-icon> | ||
</mat-label> | ||
|
||
<app-basic-autocomplete | ||
formControlName="additional" | ||
[options]="typeAdditionalOptions ?? []" | ||
[optionToString]="objectToLabel" | ||
[valueMapper]="objectToValue" | ||
[createOption]="createNewAdditionalOption" | ||
></app-basic-autocomplete> | ||
</mat-form-field> | ||
</div> | ||
</div> | ||
</mat-tab> | ||
|
||
<!-- | ||
ADVANCED SETTINGS | ||
--> | ||
<mat-tab | ||
label="Advanced Options & Validation [COMING SOON]" | ||
i18n-label | ||
[disabled]="true" | ||
> | ||
<div class="grid-layout margin-top-regular"> | ||
<div class="entity-form-cell"> | ||
<mat-form-field> | ||
<mat-label>Default Value</mat-label> | ||
<input formControlName="defaultValue" matInput /> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<mat-label>Anonymize</mat-label> | ||
<input formControlName="anonymize" matInput /> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<mat-label>Searchable</mat-label> | ||
<input formControlName="searchable" matInput /> | ||
</mat-form-field> | ||
</div> | ||
|
||
<div class="entity-form-cell"> | ||
<mat-form-field> | ||
<mat-label>Field Validation</mat-label> | ||
<input formControlName="validators" matInput /> | ||
</mat-form-field> | ||
</div> | ||
</div> | ||
</mat-tab> | ||
</mat-tab-group> | ||
</form> | ||
</mat-dialog-content> | ||
|
||
<mat-dialog-actions> | ||
<button mat-button (click)="save()">Save</button> | ||
<button mat-button mat-dialog-close>Cancel</button> | ||
</mat-dialog-actions> |
Oops, something went wrong.