Skip to content

Commit 5d82840

Browse files
committed
Splitting out note id to its own property
1 parent af85e63 commit 5d82840

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

src/RealtimeServer/scriptureforge/models/question.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ export interface Question extends ProjectData {
3030
dateModified: string;
3131
dateCreated: string;
3232
transceleratorQuestionId?: string;
33+
paratextNoteId?: string;
3334
}

src/RealtimeServer/scriptureforge/services/question-service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ export class QuestionService extends SFProjectDataService<Question> {
189189
},
190190
transceleratorQuestionId: {
191191
bsonType: 'string'
192+
},
193+
paratextNoteId: {
194+
bsonType: 'string'
192195
}
193196
},
194197
additionalProperties: false

src/SIL.XForge.Scripture/ClientApp/src/app/checking/import-questions-dialog/import-questions-dialog.component.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,10 @@ export class ImportQuestionsDialogComponent implements OnDestroy {
343343
// Questions imported from a file should be skipped only if they are exactly the same as what is currently in SF.
344344
const sfVersionOfQuestion: QuestionDoc | undefined = questionQuery.docs.find(
345345
doc =>
346-
doc.data != null &&
347-
(useQuestionIds ? doc.data.transceleratorQuestionId === question.id : doc.data.text === question.text) &&
348-
toVerseRef(doc.data.verseRef).equals(question.verseRef)
346+
(doc.data != null &&
347+
(useQuestionIds ? doc.data.transceleratorQuestionId === question.id : doc.data.text === question.text) &&
348+
toVerseRef(doc.data.verseRef).equals(question.verseRef)) ||
349+
(useQuestionIds ? doc.data?.paratextNoteId === question.id : doc.data?.text === question.text)
349350
);
350351

351352
this.questionList.push({
@@ -414,6 +415,7 @@ export class ImportQuestionsDialogComponent implements OnDestroy {
414415

415416
async importQuestions(): Promise<void> {
416417
this.importClicked = true;
418+
const status = this.status; //capture the state before we update it
417419

418420
if (this.selectedCount < 1) {
419421
return;
@@ -442,9 +444,15 @@ export class ImportQuestionsDialogComponent implements OnDestroy {
442444
answers: [],
443445
isArchived: false,
444446
dateCreated: currentDate,
445-
dateModified: currentDate,
446-
transceleratorQuestionId: listItem.question.id
447+
dateModified: currentDate
447448
};
449+
450+
if (status === 'filter_questions') {
451+
newQuestion.transceleratorQuestionId = listItem.question.id;
452+
} else if (status === 'filter_notes') {
453+
newQuestion.paratextNoteId = listItem.question.id;
454+
}
455+
448456
await this.zone.runOutsideAngular(() =>
449457
this.checkingQuestionsService.createQuestion(this.data.projectId, newQuestion, undefined, undefined)
450458
);

src/SIL.XForge.Scripture/Models/Question.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ public class Question : ProjectData
1616
public DateTime DateModified { get; set; }
1717
public DateTime DateCreated { get; set; }
1818
public string TransceleratorQuestionId { get; set; }
19+
public string ParatextNoteId { get; set; }
1920
}

0 commit comments

Comments
 (0)