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
Date Value #35
Conversation
# Conflicts: # package-lock.json # package.json # projects/knora-ui/src/lib/viewer/operations/display-edit/display-edit.component.html # projects/knora-ui/src/lib/viewer/viewer.module.ts # src/app/app.component.ts
since you moved the jdn-datepicker to the values folder, can you remove it from the time component since it's redundant now please? Also fix the import in the time-input.component :) |
will do! |
note to myself: take a look at Guide: Material's component harnesses in your tests and Harness Overview. |
# Conflicts: # projects/knora-ui/src/lib/viewer/operations/display-edit/display-edit.component.html # projects/knora-ui/src/lib/viewer/values/time-value/time-input/time-input.component.html # projects/knora-ui/src/lib/viewer/viewer.module.ts # src/app/app.component.html # src/app/app.component.ts
done in 87462a5 |
…alendar in a period
…before end in a period
the class name should be adapted to "date-input-container" That's all I could find, it looks good otherwise! Of course, the css will need to be worked on but that can be another PR once you finish all the logic. |
good catch, done in b243a4b |
|
||
@Component({ | ||
selector: 'kui-calendar-header', | ||
template: ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should move this to the template file to keep it consistent with the way we've been creating all the other components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in d7e2127
Start date is <strong>required</strong> | ||
</mat-error> | ||
<mat-error *ngIf="startDateControl.hasError('sameCalendarRequired')"> | ||
In a period, start and end date must have the same <strong>calendar</strong> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change wording from "must have" to "must use" for a clearer error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in ec7687d
* | ||
* @param date the given KnoraDate. | ||
*/ | ||
createCalendarDate(date: KnoraDate): GregorianCalendarDate | JulianCalendarDate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about moving this logic to the js-lib inside a ConvertUtil
or CalendarUtil
class? Might be nice to have in case we need to convert from a KnoraDate
somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an excellent idea. I created https://dasch.myjetbrains.com/youtrack/issue/DSP-139.
import {DateInputComponent} from "./date-input/date-input.component"; | ||
|
||
/** Error when invalid control is dirty, touched, or submitted. */ | ||
export class IntervalErrorStateMatcher implements ErrorStateMatcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class name should be adapted to "DateErrorStateMatcher"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in f5d7a65
|
||
valueChangesSubscription: Subscription; | ||
|
||
// TODO: check that both dates have the same calendar in case of a KnoraPeriod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this TODO
still relevant? I believe you're checking for the calendar consistency in time-input.component.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in f5d7a65
# Conflicts: # projects/knora-ui/src/lib/viewer/operations/display-edit/display-edit.component.spec.ts # projects/knora-ui/src/lib/viewer/operations/display-edit/display-edit.component.ts
@mdelez I will have a look at Angular Material Harness (#35 (comment)) to see if this simplifies the access to the HTML elements when using Material Components. Edit: Often I find myself copying and pasting code from the Material repo to make the tests work because they involve complex async logic, and I think that's unnecessary because we don't want to duplicate their tests for our components. I created https://dasch.myjetbrains.com/youtrack/issue/DSP-140 and https://dasch.myjetbrains.com/youtrack/issue/DSP-141. |
@mdelez Thanks, I will merge as soon as the tests have passed. Found a small typo in the specs ... |
closes #11