@eric-emg/symphiq-components 1.2.446 → 1.2.448

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,24 @@ 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
+ if (!q.id || !answers)
89155
89155
  return [];
89156
89156
  return answers
89157
- .filter(a => a.profileQuestionId === questionId)
89157
+ .filter(a => a.profileQuestionId === q.id)
89158
89158
  .map(answer => ({
89159
89159
  answer,
89160
89160
  user: allUsers.find(u => u.id === answer.creatorUserId)
89161
89161
  }));
89162
89162
  }, ...(ngDevMode ? [{ debugName: "questionAnswers" }] : []));
89163
89163
  this.displayAnswers = computed(() => {
89164
- const questionId = this.question().id;
89164
+ const q = this.question();
89165
89165
  const current = this.questionAnswers();
89166
89166
  const allUsers = this.users();
89167
89167
  const removedAnswers = this.animationService.removedAnswers()
89168
- .filter(a => a.profileQuestionId === questionId)
89168
+ .filter(a => a.profileQuestionId === q.id)
89169
89169
  .map(answer => ({
89170
89170
  answer,
89171
89171
  user: allUsers.find(u => u.id === answer.creatorUserId)
@@ -89175,18 +89175,18 @@ class ProfileQuestionCardComponent {
89175
89175
  return [...current, ...uniqueRemoved];
89176
89176
  }, ...(ngDevMode ? [{ debugName: "displayAnswers" }] : []));
89177
89177
  this.isAnswered = computed(() => {
89178
- return this.questionAnswers().length > 0;
89178
+ return this.question().answered === true;
89179
89179
  }, ...(ngDevMode ? [{ debugName: "isAnswered" }] : []));
89180
89180
  this.relatedFocusAreas = computed(() => {
89181
89181
  const q = this.question();
89182
89182
  return 'focusAreaDomains' in q ? (q.focusAreaDomains || []) : [];
89183
89183
  }, ...(ngDevMode ? [{ debugName: "relatedFocusAreas" }] : []));
89184
89184
  this.hasHistory = computed(() => {
89185
- const questionId = this.question().id;
89185
+ const q = this.question();
89186
89186
  const histories = this.profileAnswerHistories();
89187
- if (!questionId || !histories)
89187
+ if (!q.id || !histories)
89188
89188
  return false;
89189
- return histories.some(h => h.profileQuestionId === questionId);
89189
+ return histories.some(h => h.profileQuestionId === q.id);
89190
89190
  }, ...(ngDevMode ? [{ debugName: "hasHistory" }] : []));
89191
89191
  }
89192
89192
  isNewAnswer(answerId) {
@@ -90167,6 +90167,9 @@ function ProfileQuestionsModalComponent_Conditional_0_Template(rf, ctx) { if (rf
90167
90167
  i0.ɵɵconditional(ctx_r1.historyModeActive() ? 8 : !ctx_r1.answerModeActive() ? 9 : 10);
90168
90168
  } }
90169
90169
  class ProfileQuestionsModalComponent {
90170
+ isQuestionAnswered(q) {
90171
+ return q.answered === true;
90172
+ }
90170
90173
  constructor() {
90171
90174
  this.isOpen = input(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
90172
90175
  this.questions = input([], ...(ngDevMode ? [{ debugName: "questions" }] : []));
@@ -90247,8 +90250,7 @@ class ProfileQuestionsModalComponent {
90247
90250
  return [];
90248
90251
  }, ...(ngDevMode ? [{ debugName: "filteredQuestions" }] : []));
90249
90252
  this.answeredCount = computed(() => {
90250
- const answers = this.profileAnswers();
90251
- return this.filteredQuestions().filter(q => answers.some(a => a.profileQuestionId === q.id)).length;
90253
+ return this.filteredQuestions().filter(q => this.isQuestionAnswered(q)).length;
90252
90254
  }, ...(ngDevMode ? [{ debugName: "answeredCount" }] : []));
90253
90255
  this.totalCount = computed(() => {
90254
90256
  return this.filteredQuestions().length;
@@ -90267,9 +90269,7 @@ class ProfileQuestionsModalComponent {
90267
90269
  this.moveModalToBody();
90268
90270
  this.modalReady.set(true);
90269
90271
  if (this.startDirectAnswer()) {
90270
- const answers = this.profileAnswers();
90271
- const isAnswered = (q) => answers.some(a => a.profileQuestionId === q.id);
90272
- const firstUnanswered = this.filteredQuestions().find(q => !isAnswered(q));
90272
+ const firstUnanswered = this.filteredQuestions().find(q => !this.isQuestionAnswered(q));
90273
90273
  if (firstUnanswered) {
90274
90274
  this.answerModeActive.set(true);
90275
90275
  this.questionForAnswer.set(firstUnanswered);
@@ -90853,11 +90853,8 @@ function ProfileStatusCardComponent_Conditional_26_Template(rf, ctx) { if (rf &
90853
90853
  i0.ɵɵconditional(ctx_r1.unansweredQuestions() > 0 ? 2 : -1);
90854
90854
  } }
90855
90855
  class ProfileStatusCardComponent {
90856
- isQuestionAnswered(q, answers) {
90857
- if ('answered' in q && typeof q.answered === 'boolean') {
90858
- return q.answered;
90859
- }
90860
- return answers.some(a => a.profileQuestionId === q.id);
90856
+ isQuestionAnswered(q) {
90857
+ return q.answered === true;
90861
90858
  }
90862
90859
  constructor() {
90863
90860
  this.viewMode = input(ViewModeEnum.LIGHT, ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
@@ -90903,8 +90900,7 @@ class ProfileStatusCardComponent {
90903
90900
  }, ...(ngDevMode ? [{ debugName: "viewToggleOptions" }] : []));
90904
90901
  this.computedAnsweredCount = computed(() => {
90905
90902
  const questions = this.questions();
90906
- const answers = this.profileAnswers();
90907
- return questions.filter(q => this.isQuestionAnswered(q, answers)).length;
90903
+ return questions.filter(q => this.isQuestionAnswered(q)).length;
90908
90904
  }, ...(ngDevMode ? [{ debugName: "computedAnsweredCount" }] : []));
90909
90905
  this.completionPercentage = computed(() => {
90910
90906
  const total = this.totalQuestions();
@@ -90926,7 +90922,6 @@ class ProfileStatusCardComponent {
90926
90922
  }, ...(ngDevMode ? [{ debugName: "unansweredQuestions" }] : []));
90927
90923
  this.questionsByCategory = computed(() => {
90928
90924
  const questions = this.questions();
90929
- const answers = this.profileAnswers();
90930
90925
  const categoryMap = new Map();
90931
90926
  const groupFn = this.questionGroupByCategory();
90932
90927
  const gc = this.groupConfig();
@@ -90946,7 +90941,7 @@ class ProfileStatusCardComponent {
90946
90941
  });
90947
90942
  const items = [];
90948
90943
  categoryMap.forEach((categoryQuestions, category) => {
90949
- const answeredCount = categoryQuestions.filter(q => this.isQuestionAnswered(q, answers)).length;
90944
+ const answeredCount = categoryQuestions.filter(q => this.isQuestionAnswered(q)).length;
90950
90945
  const totalCount = categoryQuestions.length;
90951
90946
  const progress = totalCount > 0 ? (answeredCount / totalCount) * 100 : 0;
90952
90947
  items.push({
@@ -90962,7 +90957,6 @@ class ProfileStatusCardComponent {
90962
90957
  }, ...(ngDevMode ? [{ debugName: "questionsByCategory" }] : []));
90963
90958
  this.questionsByFocusArea = computed(() => {
90964
90959
  const questions = this.questions();
90965
- const answers = this.profileAnswers();
90966
90960
  const focusAreaMap = new Map();
90967
90961
  const groupFn = this.questionGroupByFocusArea();
90968
90962
  const gc = this.groupConfig();
@@ -90992,7 +90986,7 @@ class ProfileStatusCardComponent {
90992
90986
  });
90993
90987
  const items = [];
90994
90988
  focusAreaMap.forEach((faQuestions, focusArea) => {
90995
- const answeredCount = faQuestions.filter(q => this.isQuestionAnswered(q, answers)).length;
90989
+ const answeredCount = faQuestions.filter(q => this.isQuestionAnswered(q)).length;
90996
90990
  const totalCount = faQuestions.length;
90997
90991
  const progress = totalCount > 0 ? (answeredCount / totalCount) * 100 : 0;
90998
90992
  items.push({
@@ -94975,7 +94969,10 @@ class SymphiqProfileFocusAreasAnalysesDashboardComponent {
94975
94969
  };
94976
94970
  const focusAreaDetailsMap = new Map(focusAreaDetailsData?.map(fad => [fad.focusAreaDomain, fad]));
94977
94971
  const profileFocusAreasMap = new Map(profileFocusAreasData?.map(pfa => [pfa.focusAreaDomain, pfa]));
94978
- const profileAnalysesMap = new Map(profileAnalysesData?.map(pa => [pa.focusAreaDomain, pa]));
94972
+ const profileFocusAreaIdToDomainMap = new Map(profileFocusAreasData?.map(pfa => [pfa.id, pfa.focusAreaDomain]));
94973
+ const profileAnalysesMap = new Map(profileAnalysesData
94974
+ ?.filter(pa => pa.profileFocusAreaId !== undefined)
94975
+ .map(pa => [profileFocusAreaIdToDomainMap.get(pa.profileFocusAreaId), pa]));
94979
94976
  const itemStatusesMap = new Map(itemStatusesData?.map(is => [is.itemId, is]));
94980
94977
  return allDomains.map(domain => {
94981
94978
  let questionsAnswered = 0;