-
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.
core(*): dynamic default values for form fields (#1796)
schemaField.defaultValue allows to define a value that is automatically set in UI form fields for new entities. The default values support dynamic placeholders for current time or user. Replace hard-coded defaults in factory methods and use current date and user in the property schema closes #1671, closes #1672 --------- Co-authored-by: Lukas Scheller <lukasscheller@mbp-von-lukas.speedport.ip> Co-authored-by: Simon <simon@aam-digital.com> Co-authored-by: Sebastian Leidig <sebastian.leidig@gmail.com>
- Loading branch information
1 parent
ab55a4e
commit 34fee07
Showing
18 changed files
with
128 additions
and
52 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
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
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
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
6 changes: 5 additions & 1 deletion
6
src/app/features/historical-data/model/historical-entity-data.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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { Entity } from "../../../core/entity/model/entity"; | ||
import { DatabaseEntity } from "../../../core/entity/database-entity.decorator"; | ||
import { DatabaseField } from "../../../core/entity/database-field.decorator"; | ||
import { PLACEHOLDERS } from "../../../core/entity/schema/entity-schema-field"; | ||
|
||
/** | ||
* A general class that represents data that is collected for a entity over time. | ||
* Further attributes can be added through the config. | ||
*/ | ||
@DatabaseEntity("HistoricalEntityData") | ||
export class HistoricalEntityData extends Entity { | ||
@DatabaseField({ label: $localize`:Label for date of historical data:Date` }) | ||
@DatabaseField({ | ||
label: $localize`:Label for date of historical data:Date`, | ||
defaultValue: PLACEHOLDERS.NOW, | ||
}) | ||
date: Date; | ||
@DatabaseField() relatedEntity: string; | ||
} |
Oops, something went wrong.