Skip to content

Commit 5a54005

Browse files
authored
Merge pull request #28 from LibreCodeCoop/feat/date-field-type
feat: support date profile fields
2 parents 95ceaa9 + 573972d commit 5a54005

31 files changed

+493
-20
lines changed
0 Bytes
Loading
310 KB
Loading
-1.05 KB
Loading
-1.69 KB
Loading
0 Bytes
Loading
0 Bytes
Loading

lib/Enum/FieldType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
enum FieldType: string {
1313
case TEXT = 'text';
1414
case NUMBER = 'number';
15+
case DATE = 'date';
1516
case SELECT = 'select';
1617
case MULTISELECT = 'multiselect';
1718

@@ -22,6 +23,7 @@ public static function values(): array {
2223
return [
2324
self::TEXT->value,
2425
self::NUMBER->value,
26+
self::DATE->value,
2527
self::SELECT->value,
2628
self::MULTISELECT->value,
2729
];

lib/ResponseDefinitions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace OCA\ProfileFields;
1111

1212
/**
13-
* @psalm-type ProfileFieldsType = 'text'|'number'|'select'|'multiselect'
13+
* @psalm-type ProfileFieldsType = 'text'|'number'|'date'|'select'|'multiselect'
1414
* @psalm-type ProfileFieldsVisibility = 'private'|'users'|'public'
1515
* @psalm-type ProfileFieldsEditPolicy = 'admins'|'users'
1616
* @psalm-type ProfileFieldsExposurePolicy = 'hidden'|'private'|'users'|'public'

lib/Service/DataImportService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function import(array $payload, bool $dryRun = false): array {
6969
* @param list<array{
7070
* field_key: non-empty-string,
7171
* label: non-empty-string,
72-
* type: 'text'|'number',
72+
* type: 'text'|'number'|'date'|'select'|'multiselect',
7373
* edit_policy: 'admins'|'users',
7474
* exposure_policy: 'hidden'|'private'|'users'|'public',
7575
* sort_order: int,
@@ -148,7 +148,7 @@ private function collectValueSummary(array $values, array &$summary): void {
148148
* @param list<array{
149149
* field_key: non-empty-string,
150150
* label: non-empty-string,
151-
* type: 'text'|'number',
151+
* type: 'text'|'number'|'date'|'select'|'multiselect',
152152
* edit_policy: 'admins'|'users',
153153
* exposure_policy: 'hidden'|'private'|'users'|'public',
154154
* sort_order: int,
@@ -248,7 +248,7 @@ private function persistValues(array $values, array $definitionsByFieldKey, arra
248248
* @param array{
249249
* field_key: non-empty-string,
250250
* label: non-empty-string,
251-
* type: 'text'|'number',
251+
* type: 'text'|'number'|'date'|'select'|'multiselect',
252252
* edit_policy: 'admins'|'users',
253253
* exposure_policy: 'hidden'|'private'|'users'|'public',
254254
* sort_order: int,

lib/Service/FieldDefinitionValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class FieldDefinitionValidator {
2929
* @return array{
3030
* field_key: non-empty-string,
3131
* label: non-empty-string,
32-
* type: 'text'|'number'|'select'|'multiselect',
32+
* type: 'text'|'number'|'date'|'select'|'multiselect',
3333
* edit_policy: 'admins'|'users',
3434
* exposure_policy: 'hidden'|'private'|'users'|'public',
3535
* sort_order: int,

0 commit comments

Comments
 (0)