Skip to content
Merged
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
48 changes: 48 additions & 0 deletions src/features/bioCheck/BioCheckPerson.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class BioCheckPerson {
bio: "",
hasName: false,
privacyLevel: 0,
researchStatus: 0,
isMember: false,
isOrphan: false,
hasLocation: false,
Expand Down Expand Up @@ -188,6 +189,12 @@ export class BioCheckPerson {
this.person.motherDnaConfirmed = true;
}
}

// Populate researchStatus from returned value
if (profileObj.ResearchStatus != null) {
this.person.researchStatus = profileObj.ResearchStatus;
}

// can use if logged in user is the same as Manager
if (this.person.privacyLevel < BioCheckPerson.MIN_PRIVACY) {
if (userId === 0) {
Expand Down Expand Up @@ -403,6 +410,45 @@ export class BioCheckPerson {
}
return privacyString;
}
/**
* Get the research status
* @returns {Number} numeric research status
*/
getResearchStatus() {
return this.person.researchStatus;
}
/**
* Get the research status as a string to be displayed to the user
* @returns {String} research status string
*/
getResearchStatusString() {
let researchString = "";
switch (this.person.researchStatus) {
case 0:
researchString = " "; // No status
break;
case 10: // Unfinished
researchString = "Unfinished";
break;
case 20: // Help Requested
researchString = "Help Requested";
break;
case 30: // Sources to Review
researchString = "Sources to Review";
break;
case 40: // Silver Standard
researchString = "Silver Research";
break;
case 50: // Gold Standard Candidate
researchString = "Pending Review";
break;
case 60: // Gold Standard: Genealogically Complete and Peer Reviewed
researchString = "Peer Reviewed ";
break;
}
return researchString;
}

/**
* Was profile not checked due to privacy
* @returns {Boolean} true if profile could not be checked due to privacy
Expand Down Expand Up @@ -511,6 +557,8 @@ export class BioCheckPerson {
if (emailElements.length > 0) {
this.person.isMember = true;
}

// TODO set researchStatus
}

/*
Expand Down
12 changes: 12 additions & 0 deletions src/features/bioCheck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ Get the privacy as a string to be displayed to the user

Returns **[String][8]** privacy string (i.e., the color)

### getResearchStatus

Get the research status

Returns **[Number][9]** numeric research status

### getResearchStatusString

Get the research status as a string to be displayed to the user

Returns **[String][8]** research status string

### isUncheckedDueToPrivacy

Was profile not checked due to privacy
Expand Down
4 changes: 1 addition & 3 deletions src/features/bioCheck/SourceRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -1001,9 +1001,7 @@ class SourceRules {
projectBox.status = templates[i].status.toLowerCase().trim();
this.#projectBox.push(projectBox);
}
// TODO hack that Notability may be set to the wrong type
if ((templates[i].type.toLowerCase().trim() === 'formatting') ||
(templates[i].type.toLowerCase().trim() === 'formattingtemplate')) {
if (templates[i].type.toLowerCase().trim() === 'formattingtemplate') {
let formattingTemplate = {
name: "",
status: "",
Expand Down
Loading