MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / renderProfileInfoGrid

Function renderProfileInfoGrid

deployments/desktop/static/desktop.js:5017–5037  ·  view source on GitHub ↗
(profile, raw, userInfo, details)

Source from the content-addressed store, hash-verified

5015 }
5016
5017 function renderProfileInfoGrid(profile, raw, userInfo, details) {
5018 const target = $("profileInfoGrid");
5019 if (!target) return;
5020 const mustRead = profileMustReadValues(profile, raw);
5021 const drift = profile?.drift_state || raw?.drift_state || {};
5022 const updatedAt = firstText(profile?.updated_at, raw?.updated_at, userInfo?.updated_at);
5023 const labels = ui().settings.profileFields;
5024 target.innerHTML = [
5025 profileInfoItem(labels.user, details.userId),
5026 profileInfoItem(labels.role, userInfo?.role_name || userInfo?.label || ""),
5027 profileInfoItem(labels.version, firstText(profile?.version, raw?.version)),
5028 profileInfoItem(labels.updatedAt, updatedAt),
5029 profileInfoItem(labels.affiliation, profileAffiliation(raw, userInfo), "wide"),
5030 profileEditItem(labels.directions, "profileDirectionsInput", editableWeightedValue(raw?.core_directions || profile?.core_directions, details.directions), "wide", true, labels.weightedHint),
5031 profileEditItem(labels.keywords, "profileKeywordsInput", editableListValue(mustRead.keywords), "wide", true, labels.listHint),
5032 profileEditItem(labels.authors, "profileAuthorsInput", editableListValue(mustRead.authors), "wide", true, labels.listHint),
5033 profileEditItem(labels.institutions, "profileInstitutionsInput", editableListValue(mustRead.institutions), "wide", true, labels.listHint),
5034 profileEditItem(labels.topics, "profileTopicsInput", editableWeightedValue(raw?.topic_weights || profile?.topic_weights, details.topics), "wide", true, labels.topicHint),
5035 profileInfoItem(labels.drift, firstText(drift.status, raw?.drift_status), "wide")
5036 ].join("");
5037 }
5038
5039 function setProfileSyncStatus(message) {
5040 const target = $("profileSyncStatus");

Callers 1

renderProfileFormFunction · 0.85

Calls 9

profileMustReadValuesFunction · 0.85
firstTextFunction · 0.85
uiFunction · 0.85
profileInfoItemFunction · 0.85
profileAffiliationFunction · 0.85
profileEditItemFunction · 0.85
editableWeightedValueFunction · 0.85
editableListValueFunction · 0.85
$Function · 0.70

Tested by

no test coverage detected