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

Function renderProfileForm

deployments/desktop/static/desktop.js:5044–5063  ·  view source on GitHub ↗
(data = {})

Source from the content-addressed store, hash-verified

5042 }
5043
5044 function renderProfileForm(data = {}) {
5045 const profile = data.profile || {};
5046 const raw = data.raw || {};
5047 const userId = firstText(raw.user_id, profile.user_id, currentUser()) || "user_demo";
5048 const userInfo = selectedUserInfo(userId);
5049 const directions = sortedProfilePairs(profile, raw, "top_directions", "core_directions");
5050 const topics = sortedProfilePairs(profile, raw, "top_topics", "topic_weights");
5051
5052 state.currentProfile = { profile, raw };
5053 $("profileUserId").value = userId;
5054 $("scholarUrl").value = firstText(raw.scholar_url, raw.scholar_profile?.url, raw.source_inputs?.scholar_url);
5055 $("homepageUrl").value = firstText(raw.homepage_url, raw.homepage_profile?.url, raw.source_inputs?.homepage_url);
5056 $("pdfPaths").value = firstText(raw.pdf_paths, raw.source_pdfs, raw.source_inputs?.pdf_paths);
5057 renderProfileInfoGrid(profile, raw, userInfo, { userId, directions, topics });
5058 $("resetProfile").checked = false;
5059
5060 const updatedAt = firstText(profile.updated_at, raw.updated_at, userInfo.updated_at);
5061 const labels = ui().settings.profileFields;
5062 setProfileSyncStatus(updatedAt ? `${labels.loaded} · ${updatedAt}` : (userInfo.has_profile ? labels.loaded : labels.missing));
5063 }
5064
5065 async function loadCurrentProfile() {
5066 const userId = currentUser();

Callers 3

setLocaleFunction · 0.85
loadCurrentProfileFunction · 0.85
saveProfileFunction · 0.85

Calls 8

firstTextFunction · 0.85
currentUserFunction · 0.85
selectedUserInfoFunction · 0.85
sortedProfilePairsFunction · 0.85
renderProfileInfoGridFunction · 0.85
uiFunction · 0.85
setProfileSyncStatusFunction · 0.85
$Function · 0.70

Tested by

no test coverage detected