Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Value #35

Merged
merged 67 commits into from Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3c9b4cc
feature (value): add component for date value
Feb 25, 2020
6d6f3d2
feature (value): add component for date input
Feb 25, 2020
9329685
feature (value): write updated date to Knora
Feb 26, 2020
fc97275
feature (value): handle single dates and periods correctly
Feb 26, 2020
f304cda
feature (value): try to determine active calendar dynamically
Feb 26, 2020
051e989
feature (value): set active calendar via directive (ongoing)
Mar 10, 2020
2752ae1
feature (values): add calendar header
Mar 10, 2020
3e3cd54
refactor (values): rename variable
Mar 10, 2020
0f6c620
Merge branch 'master' into wip/11-date-value
Mar 16, 2020
b8463c3
refactor (value): unify use of jdndatepicker directive
Mar 16, 2020
95348f2
refactor (value): unify use of jdndatepicker directive
Mar 16, 2020
1f1b847
test (value): add test component for date
Mar 16, 2020
9d55821
chore (package.json): use new version of date adapter
Mar 16, 2020
5f603d8
test (value): add test calendar header
Mar 16, 2020
9228f68
test (value): add test calendar header
Mar 16, 2020
ced59d5
test (value): add test calendar header
Mar 17, 2020
82f395a
test (value): add test calendar header
Mar 17, 2020
fe26c80
test (value): add test calendar header
Mar 17, 2020
00b5cfb
feature (values): handle calendar initialization
Mar 17, 2020
867cecb
test (value): specs for jdn datepicker directive
Mar 17, 2020
e8704fc
test (value): specs for jdn datepicker directive
Mar 17, 2020
15d6d09
test (value): specs for date input component
Mar 17, 2020
da95792
test (value): specs for date value component
Mar 17, 2020
4c7676d
feature (values): override standardValidatorFunc for dates
Mar 20, 2020
5c517e7
feature (values): populate update and creation value
Mar 20, 2020
3f90159
tests (values): add test for date value component
Mar 23, 2020
a4ff803
tests (values): add test for date value component
Mar 23, 2020
83c3766
tests (values): add test for date value component
Mar 25, 2020
7496acb
tests (values): add test for date value component
Mar 25, 2020
afdba7f
tests (values): add test for date value component
Mar 25, 2020
3e22967
tests (values): add test for date value component
Mar 25, 2020
1190f97
tests (values): add test for date value component
Mar 25, 2020
95165e5
tests (values): add test for date value component
Mar 25, 2020
57414eb
tests (values): add test for date value component
Mar 25, 2020
346be3d
Merge branch 'master' into wip/11-date-value
Apr 1, 2020
e950b17
Merge branch 'master' into wip/11-date-value
Apr 2, 2020
b436ed7
Merge branch 'master' into wip/11-date-value
Apr 2, 2020
b458483
Merge branch 'master' into wip/11-date-value
tobiasschweizer Apr 2, 2020
37c9605
feature (value): handle periods in dates values
Apr 2, 2020
c3aea1d
test (value): fix spec
Apr 2, 2020
616bce3
test (value): fix spec
Apr 2, 2020
f9749d6
feature (value): handle periods in dates values
Apr 2, 2020
8e9847e
feature (value): handle periods in dates values
Apr 3, 2020
9aed5b6
tests (value): add test for date value comp.
Apr 3, 2020
3eb99cb
tests (value): add test for date input comp.
Apr 3, 2020
f32f59c
tests (value): add test for date input comp.
Apr 3, 2020
8a0e021
tests (value): add test for date input comp.
Apr 3, 2020
2df7562
tests (value): add test for date input comp.
Apr 3, 2020
a777eff
tests (value): add test for date input comp.
Apr 3, 2020
3bff9e7
tests (value): add test for date input comp.
Apr 3, 2020
d6ed773
tests (value): add test for date input comp.
Apr 3, 2020
853c432
tests (value): adapt test for date input comp.
Apr 3, 2020
c406458
fix (value): make input readonly in date input
Apr 3, 2020
8771aa3
Merge branch 'master' into wip/11-date-value
Apr 6, 2020
87462a5
fix (value): remove obsolete file
Apr 6, 2020
def47c9
feature (value): adapt date to common value comp. structure
Apr 6, 2020
333b776
tests (value): adapt tests for date comp. comment
Apr 6, 2020
dabcc2e
refactor (value): define validator for date input to check for same c…
Apr 7, 2020
7f20d79
refactor (value): define validator for date input to check for start …
Apr 7, 2020
0bee998
tests (value): adapt assertions for date input comp. comment
Apr 7, 2020
720106f
fix (value): remove <br> in date value comp. template
Apr 7, 2020
b243a4b
fix (value): fix class name in date input comp. template
Apr 7, 2020
3a343dd
Merge branch 'master' into wip/11-date-value
Apr 8, 2020
d7e2127
refactor (value): move calendar header HTML to template file
Apr 8, 2020
ec7687d
refactor (value): provide better error message for date input comp.
Apr 8, 2020
f5d7a65
refactor (value): small adaptions in date value comp.
Apr 8, 2020
6117cdd
tests (value): small adaption in date value spec
Apr 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
109 changes: 58 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -26,7 +26,7 @@
"@angular/router": "~8.2.14",
"@knora/api": "file:.yalc/@knora/api",
"jdnconvertiblecalendar": "^0.0.5",
"jdnconvertiblecalendardateadapter": "^0.0.10",
"jdnconvertiblecalendardateadapter": "^0.0.12",
"ngx-color-picker": "^8.2.0",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
Expand Down
4 changes: 3 additions & 1 deletion projects/knora-ui/package.json
Expand Up @@ -6,6 +6,8 @@
"@angular/core": "^8.2.14",
"@angular/material": "^8.2.3",
"@angular/cdk": "^8.2.3",
"@knora/api": "file:.yalc/@knora/api"
"@knora/api": "file:.yalc/@knora/api",
"jdnconvertiblecalendar": "^0.0.5",
"jdnconvertiblecalendardateadapter": "^0.0.12"
}
}
Expand Up @@ -23,6 +23,7 @@ <h4 class="label">
<kui-geoname-value #displayVal *ngSwitchCase="constants.GeonameValue" [mode]="mode" [displayValue]="displayValue"></kui-geoname-value>
<kui-link-value class="parent-value-component" #displayVal *ngSwitchCase="constants.LinkValue" [mode]="mode" [displayValue]="displayValue"
[parentResource]="parentResource" [propIri]="displayValue.property"></kui-link-value>
<kui-date-value #displayVal *ngSwitchCase="constants.DateValue" [mode]="mode" [displayValue]="displayValue"></kui-date-value>
<kui-list-value #displayVal *ngSwitchCase="constants.ListValue" [mode]="mode" [displayValue]="displayValue"
[propertyDef]="parentResource.entityInfo.properties[displayValue.property]"></kui-list-value>
<span *ngSwitchDefault>{{displayValue.strval}}</span>
Expand Down
Expand Up @@ -183,6 +183,16 @@ class TestGeonameValueComponent {

}

@Component({
selector: `kui-date-value`,
template: ``
})
class TestDateValueComponent {
@Input() mode;

@Input() displayValue;
}

/**
* Test host component to simulate parent component.
*/
Expand Down Expand Up @@ -253,7 +263,8 @@ describe('DisplayEditComponent', () => {
TestDecimalValueComponent,
TestGeonameValueComponent,
TestTimeValueComponent,
TestColorValueComponent
TestColorValueComponent,
TestDateValueComponent
],
providers: [
{
Expand Down
Expand Up @@ -40,7 +40,7 @@ export class DisplayEditComponent implements OnInit {
editModeActive = false;

shouldShowCommentToggle: boolean;

// type of given displayValue
// or knora-api-js-lib class representing the value
valueTypeOrClass: string;
Expand Down Expand Up @@ -135,7 +135,7 @@ export class DisplayEditComponent implements OnInit {
checkCommentToggleVisibility() {
this.shouldShowCommentToggle = (this.mode === 'read' && this.displayValue.valueHasComment !== '' && this.displayValue.valueHasComment !== undefined);
}

/**
* Given a value, determines the type or class representing it.
*
Expand Down Expand Up @@ -174,7 +174,6 @@ export class DisplayEditComponent implements OnInit {
isReadOnly(valueTypeOrClass: string): boolean {
return valueTypeOrClass === this.readTextValueAsHtml ||
valueTypeOrClass === this.readTextValueAsXml ||
valueTypeOrClass === this.constants.DateValue ||
valueTypeOrClass === this.constants.GeomValue;
}
}
@@ -0,0 +1,4 @@
<mat-select placeholder="Calendar" class="kui-calendar-header" [formControl]="formControl">
<mat-option *ngFor="let cal of supportedCalendars" [value]="cal">{{cal}}</mat-option>
</mat-select>
<mat-calendar-header></mat-calendar-header>
@@ -0,0 +1,6 @@
:host {
.mat-select.kui-calendar-header {
margin: 16px 16px 0 16px !important;
width: calc(100% - 32px) !important;
}
}