@eric-emg/symphiq-components 1.2.447 → 1.2.449

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89148,24 +89148,31 @@ class ProfileQuestionCardComponent {
89148
89148
  this.answerClick = output();
89149
89149
  this.historyClick = output();
89150
89150
  this.questionAnswers = computed(() => {
89151
- const questionId = this.question().id;
89151
+ const q = this.question();
89152
89152
  const answers = this.profileAnswers();
89153
89153
  const allUsers = this.users();
89154
- if (!questionId || !answers)
89154
+ console.log('[ProfileQuestionCard] questionAnswers computed:', {
89155
+ questionId: q.id,
89156
+ questionText: q.question?.substring(0, 50),
89157
+ answered: q.answered,
89158
+ profileAnswersCount: answers?.length ?? 0,
89159
+ profileAnswerIds: answers?.map(a => ({ id: a.id, profileQuestionId: a.profileQuestionId }))
89160
+ });
89161
+ if (!q.id || !answers)
89155
89162
  return [];
89156
- return answers
89157
- .filter(a => a.profileQuestionId === questionId)
89158
- .map(answer => ({
89163
+ const matched = answers.filter(a => a.profileQuestionId === q.id);
89164
+ console.log('[ProfileQuestionCard] matched answers:', matched.length, matched);
89165
+ return matched.map(answer => ({
89159
89166
  answer,
89160
89167
  user: allUsers.find(u => u.id === answer.creatorUserId)
89161
89168
  }));
89162
89169
  }, ...(ngDevMode ? [{ debugName: "questionAnswers" }] : []));
89163
89170
  this.displayAnswers = computed(() => {
89164
- const questionId = this.question().id;
89171
+ const q = this.question();
89165
89172
  const current = this.questionAnswers();
89166
89173
  const allUsers = this.users();
89167
89174
  const removedAnswers = this.animationService.removedAnswers()
89168
- .filter(a => a.profileQuestionId === questionId)
89175
+ .filter(a => a.profileQuestionId === q.id)
89169
89176
  .map(answer => ({
89170
89177
  answer,
89171
89178
  user: allUsers.find(u => u.id === answer.creatorUserId)
@@ -89175,22 +89182,18 @@ class ProfileQuestionCardComponent {
89175
89182
  return [...current, ...uniqueRemoved];
89176
89183
  }, ...(ngDevMode ? [{ debugName: "displayAnswers" }] : []));
89177
89184
  this.isAnswered = computed(() => {
89178
- const q = this.question();
89179
- if ('answered' in q && typeof q.answered === 'boolean') {
89180
- return q.answered;
89181
- }
89182
- return this.questionAnswers().length > 0;
89185
+ return this.question().answered === true;
89183
89186
  }, ...(ngDevMode ? [{ debugName: "isAnswered" }] : []));
89184
89187
  this.relatedFocusAreas = computed(() => {
89185
89188
  const q = this.question();
89186
89189
  return 'focusAreaDomains' in q ? (q.focusAreaDomains || []) : [];
89187
89190
  }, ...(ngDevMode ? [{ debugName: "relatedFocusAreas" }] : []));
89188
89191
  this.hasHistory = computed(() => {
89189
- const questionId = this.question().id;
89192
+ const q = this.question();
89190
89193
  const histories = this.profileAnswerHistories();
89191
- if (!questionId || !histories)
89194
+ if (!q.id || !histories)
89192
89195
  return false;
89193
- return histories.some(h => h.profileQuestionId === questionId);
89196
+ return histories.some(h => h.profileQuestionId === q.id);
89194
89197
  }, ...(ngDevMode ? [{ debugName: "hasHistory" }] : []));
89195
89198
  }
89196
89199
  isNewAnswer(answerId) {
@@ -90171,11 +90174,8 @@ function ProfileQuestionsModalComponent_Conditional_0_Template(rf, ctx) { if (rf
90171
90174
  i0.ɵɵconditional(ctx_r1.historyModeActive() ? 8 : !ctx_r1.answerModeActive() ? 9 : 10);
90172
90175
  } }
90173
90176
  class ProfileQuestionsModalComponent {
90174
- isQuestionAnswered(q, answers) {
90175
- if ('answered' in q && typeof q.answered === 'boolean') {
90176
- return q.answered;
90177
- }
90178
- return answers.some(a => a.profileQuestionId === q.id);
90177
+ isQuestionAnswered(q) {
90178
+ return q.answered === true;
90179
90179
  }
90180
90180
  constructor() {
90181
90181
  this.isOpen = input(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
@@ -90257,8 +90257,7 @@ class ProfileQuestionsModalComponent {
90257
90257
  return [];
90258
90258
  }, ...(ngDevMode ? [{ debugName: "filteredQuestions" }] : []));
90259
90259
  this.answeredCount = computed(() => {
90260
- const answers = this.profileAnswers();
90261
- return this.filteredQuestions().filter(q => this.isQuestionAnswered(q, answers)).length;
90260
+ return this.filteredQuestions().filter(q => this.isQuestionAnswered(q)).length;
90262
90261
  }, ...(ngDevMode ? [{ debugName: "answeredCount" }] : []));
90263
90262
  this.totalCount = computed(() => {
90264
90263
  return this.filteredQuestions().length;
@@ -90277,8 +90276,7 @@ class ProfileQuestionsModalComponent {
90277
90276
  this.moveModalToBody();
90278
90277
  this.modalReady.set(true);
90279
90278
  if (this.startDirectAnswer()) {
90280
- const answers = this.profileAnswers();
90281
- const firstUnanswered = this.filteredQuestions().find(q => !this.isQuestionAnswered(q, answers));
90279
+ const firstUnanswered = this.filteredQuestions().find(q => !this.isQuestionAnswered(q));
90282
90280
  if (firstUnanswered) {
90283
90281
  this.answerModeActive.set(true);
90284
90282
  this.questionForAnswer.set(firstUnanswered);
@@ -90862,11 +90860,8 @@ function ProfileStatusCardComponent_Conditional_26_Template(rf, ctx) { if (rf &
90862
90860
  i0.ɵɵconditional(ctx_r1.unansweredQuestions() > 0 ? 2 : -1);
90863
90861
  } }
90864
90862
  class ProfileStatusCardComponent {
90865
- isQuestionAnswered(q, answers) {
90866
- if ('answered' in q && typeof q.answered === 'boolean') {
90867
- return q.answered;
90868
- }
90869
- return answers.some(a => a.profileQuestionId === q.id);
90863
+ isQuestionAnswered(q) {
90864
+ return q.answered === true;
90870
90865
  }
90871
90866
  constructor() {
90872
90867
  this.viewMode = input(ViewModeEnum.LIGHT, ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
@@ -90912,8 +90907,7 @@ class ProfileStatusCardComponent {
90912
90907
  }, ...(ngDevMode ? [{ debugName: "viewToggleOptions" }] : []));
90913
90908
  this.computedAnsweredCount = computed(() => {
90914
90909
  const questions = this.questions();
90915
- const answers = this.profileAnswers();
90916
- return questions.filter(q => this.isQuestionAnswered(q, answers)).length;
90910
+ return questions.filter(q => this.isQuestionAnswered(q)).length;
90917
90911
  }, ...(ngDevMode ? [{ debugName: "computedAnsweredCount" }] : []));
90918
90912
  this.completionPercentage = computed(() => {
90919
90913
  const total = this.totalQuestions();
@@ -90935,7 +90929,6 @@ class ProfileStatusCardComponent {
90935
90929
  }, ...(ngDevMode ? [{ debugName: "unansweredQuestions" }] : []));
90936
90930
  this.questionsByCategory = computed(() => {
90937
90931
  const questions = this.questions();
90938
- const answers = this.profileAnswers();
90939
90932
  const categoryMap = new Map();
90940
90933
  const groupFn = this.questionGroupByCategory();
90941
90934
  const gc = this.groupConfig();
@@ -90955,7 +90948,7 @@ class ProfileStatusCardComponent {
90955
90948
  });
90956
90949
  const items = [];
90957
90950
  categoryMap.forEach((categoryQuestions, category) => {
90958
- const answeredCount = categoryQuestions.filter(q => this.isQuestionAnswered(q, answers)).length;
90951
+ const answeredCount = categoryQuestions.filter(q => this.isQuestionAnswered(q)).length;
90959
90952
  const totalCount = categoryQuestions.length;
90960
90953
  const progress = totalCount > 0 ? (answeredCount / totalCount) * 100 : 0;
90961
90954
  items.push({
@@ -90971,7 +90964,6 @@ class ProfileStatusCardComponent {
90971
90964
  }, ...(ngDevMode ? [{ debugName: "questionsByCategory" }] : []));
90972
90965
  this.questionsByFocusArea = computed(() => {
90973
90966
  const questions = this.questions();
90974
- const answers = this.profileAnswers();
90975
90967
  const focusAreaMap = new Map();
90976
90968
  const groupFn = this.questionGroupByFocusArea();
90977
90969
  const gc = this.groupConfig();
@@ -91001,7 +90993,7 @@ class ProfileStatusCardComponent {
91001
90993
  });
91002
90994
  const items = [];
91003
90995
  focusAreaMap.forEach((faQuestions, focusArea) => {
91004
- const answeredCount = faQuestions.filter(q => this.isQuestionAnswered(q, answers)).length;
90996
+ const answeredCount = faQuestions.filter(q => this.isQuestionAnswered(q)).length;
91005
90997
  const totalCount = faQuestions.length;
91006
90998
  const progress = totalCount > 0 ? (answeredCount / totalCount) * 100 : 0;
91007
90999
  items.push({
@@ -91028,6 +91020,16 @@ class ProfileStatusCardComponent {
91028
91020
  const notStartedPct = this.notStartedPercentage();
91029
91021
  this.updateChartData(completionPct, notStartedPct);
91030
91022
  });
91023
+ effect(() => {
91024
+ const questions = this.questions();
91025
+ const answers = this.profileAnswers();
91026
+ console.log('[ProfileStatusCard] inputs:', {
91027
+ questionsCount: questions.length,
91028
+ profileAnswersCount: answers.length,
91029
+ sampleQuestionIds: questions.slice(0, 3).map(q => q.id),
91030
+ sampleAnswerProfileQuestionIds: answers.slice(0, 3).map(a => a.profileQuestionId)
91031
+ });
91032
+ });
91031
91033
  }
91032
91034
  updateChartData(completionPct, notStartedPct) {
91033
91035
  if (!this.chartSeries || !this.centerLabel)
@@ -94984,7 +94986,10 @@ class SymphiqProfileFocusAreasAnalysesDashboardComponent {
94984
94986
  };
94985
94987
  const focusAreaDetailsMap = new Map(focusAreaDetailsData?.map(fad => [fad.focusAreaDomain, fad]));
94986
94988
  const profileFocusAreasMap = new Map(profileFocusAreasData?.map(pfa => [pfa.focusAreaDomain, pfa]));
94987
- const profileAnalysesMap = new Map(profileAnalysesData?.map(pa => [pa.focusAreaDomain, pa]));
94989
+ const profileFocusAreaIdToDomainMap = new Map(profileFocusAreasData?.map(pfa => [pfa.id, pfa.focusAreaDomain]));
94990
+ const profileAnalysesMap = new Map(profileAnalysesData
94991
+ ?.filter(pa => pa.profileFocusAreaId !== undefined)
94992
+ .map(pa => [profileFocusAreaIdToDomainMap.get(pa.profileFocusAreaId), pa]));
94988
94993
  const itemStatusesMap = new Map(itemStatusesData?.map(is => [is.itemId, is]));
94989
94994
  return allDomains.map(domain => {
94990
94995
  let questionsAnswered = 0;