Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/registration-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface Question extends AbstractQuestion {
title: string;
nav: string;
help?: string;
readonly?: boolean;
}

export interface Page {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,21 @@ export default class ValidatedText<M extends DS.Model> extends BaseValidatedComp
readonly: boolean = defaultTo(this.readonly, false);

didInsertElement() {
if (this.datetimeUpdated instanceof Date && !isNaN(this.datetimeUpdated.getTime())
&& this.datetimeInitiated instanceof Date
&& !isNaN(this.datetimeInitiated.getTime())) {
const diffInMs = this.datetimeUpdated.getTime() - this.datetimeInitiated.getTime();
const diffInMinutes = diffInMs / 1000 / 60;

if (
(this.retrievalTitle === 'auto_retrieval' || this.retrievalTitle === 'dual_retrieval')
&& diffInMinutes <= 1
) {
if (this.retrievalTitle === 'auto_retrieval' || this.retrievalTitle === 'dual_retrieval') {
if (!this.value) { // 空の場合のみ
this.set('value', this.title);
}

if (
(this.retrievalDate === 'auto_retrieval' || this.retrievalDate === 'dual_retrieval')
&& diffInMinutes <= 1
) {
}
if (this.retrievalDate === 'auto_retrieval' || this.retrievalDate === 'dual_retrieval') {
if (!this.value) { // 空の場合のみ
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const date = String(now.getDate()).padStart(2, '0');

this.set('value', `${year}-${month}-${date}`);
}
} else {
// Invalid date values for datetimeInitiated or datetimeUpdated.
}

this.set('readonly', this.readonly === true);

if (this.retrievalVersion !== '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export default class RightNav extends Component {

for (const page of registrationSchema.schema.pages) {
for (const question of page.questions) {
if (question.readonly) {
continue;
}
const regKey = question.qid;
isMetadataUsed = false;

Expand Down