principal-dashboard-lib-v2 0.0.27 → 0.0.28

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.
@@ -39,7 +39,7 @@
39
39
  var subject = void 0;
40
40
  var grade = void 0;
41
41
  var chapter = void 0;
42
- var teachingpoint = void 0;
42
+ var teachingPoint = void 0;
43
43
  var type = void 0;
44
44
  var resourceMetadata = data.resourcesMetadata.resourceMetadata;
45
45
  if (resourceMetadata != undefined && resourceMetadata.length > 0) {
@@ -71,6 +71,7 @@
71
71
  grade = '';
72
72
  }
73
73
  //----------//chapter
74
+ //console.log('LOOKCHP',resourceMetadata[i].chapter)
74
75
  if (resourceMetadata[i].chapter != undefined) {
75
76
  if (resourceMetadata[i].chapter.title != undefined) {
76
77
  chapter = resourceMetadata[i].chapter.title;
@@ -82,17 +83,20 @@
82
83
  else {
83
84
  chapter = '';
84
85
  }
85
- //----------//teachingpoint
86
- if (resourceMetadata[i].teachingpoint != undefined) {
87
- if (resourceMetadata[i].teachingpoint.title != undefined) {
88
- teachingpoint = resourceMetadata[i].teachingpoint.title;
86
+ //----------//teachingPoint
87
+ //console.log('LOOKTP',resourceMetadata[i].teachingPoint)
88
+ if (resourceMetadata[i].teachingPoint != undefined) {
89
+ if (resourceMetadata[i].teachingPoint.title != undefined) {
90
+ teachingPoint = resourceMetadata[i].teachingPoint.title;
89
91
  }
90
92
  else {
91
- teachingpoint = '';
93
+ //teachingPoint = '<span style="color:lightgray;">--</span>';
94
+ teachingPoint = '';
92
95
  }
93
96
  }
94
97
  else {
95
- teachingpoint = '';
98
+ //teachingPoint = '<span style="color:lightgray;">--</span>';
99
+ teachingPoint = '';
96
100
  }
97
101
  //----------//type
98
102
  if (resourceMetadata[i].type != undefined) {
@@ -113,7 +117,7 @@
113
117
  subject: subject,
114
118
  grade: grade,
115
119
  chapter: chapter,
116
- teachingpoint: teachingpoint,
120
+ teachingPoint: teachingPoint,
117
121
  type: type,
118
122
  title: title
119
123
  };
@@ -581,7 +585,7 @@
581
585
  return { forChartData: dataTableforChart, fordurationTable: allRoomsDetails };
582
586
  };
583
587
  PrincipalDashboardLibV2Service.prototype.dataForTableView = function (userConsoleMatrix, resourceMetadataMatrix) {
584
- //console.log("AAA userConsoleMatrix",userConsoleMatrix, "-resourceMetadataMatrix->",resourceMetadataMatrix);
588
+ console.log("AAA userConsoleMatrix", userConsoleMatrix, "-resourceMetadataMatrix->", resourceMetadataMatrix);
585
589
  var currentDate;
586
590
  var resourceMatrixForTableChart = new Array();
587
591
  var resourceMatrixForExcel = new Array();
@@ -595,10 +599,11 @@
595
599
  var subject = void 0;
596
600
  var grade = void 0;
597
601
  var chapter = void 0;
602
+ var topicName = void 0;
598
603
  var AssestDetail = void 0;
599
604
  var resourceType = void 0;
600
605
  var resourceTitle = void 0;
601
- var teachingpoint = void 0;
606
+ var teachingPoint = void 0;
602
607
  var location = void 0;
603
608
  var teacherName = void 0;
604
609
  var teacherSubject = void 0;
@@ -636,15 +641,16 @@
636
641
  subject = undefined;
637
642
  grade = undefined;
638
643
  chapter = undefined;
639
- teachingpoint = undefined;
644
+ topicName = undefined;
645
+ teachingPoint = undefined;
640
646
  AssestDetail = undefined;
641
647
  resourceTitle = undefined;
642
648
  resourceType = undefined;
643
- resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingpoint, AssestDetail, launchedFrom];
649
+ resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingPoint, AssestDetail, launchedFrom];
644
650
  resourceMatrixForTableChart.push(resourceArrayForTableChart);
645
651
  }
646
652
  else {
647
- //resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingpoint,type,title]
653
+ //resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingPoint,type,title]
648
654
  for (var k = 0; k < resourceMetadataIDs.length; k++) {
649
655
  for (var i_4 = 0; i_4 < resourceMetadataMatrix.length; i_4++) {
650
656
  if (resourceMetadataIDs[k] === resourceMetadataMatrix[i_4].resouseID) {
@@ -652,7 +658,8 @@
652
658
  subject = resourceMetadataMatrix[i_4].subject;
653
659
  grade = resourceMetadataMatrix[i_4].grade;
654
660
  chapter = resourceMetadataMatrix[i_4].chapter;
655
- teachingpoint = resourceMetadataMatrix[i_4].teachingpoint;
661
+ topicName = resourceMetadataMatrix[i_4].topicName;
662
+ teachingPoint = resourceMetadataMatrix[i_4].teachingPoint;
656
663
  if (resourceMetadataMatrix[i_4].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i_4].title.toLowerCase() === 'question') {
657
664
  //AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
658
665
  AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
@@ -664,7 +671,8 @@
664
671
  }
665
672
  //AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k];
666
673
  //console.log('roomDetail',roomDetail)
667
- resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingpoint, AssestDetail, launchedFrom];
674
+ console.log('teachingPoint', teachingPoint);
675
+ resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingPoint, AssestDetail, launchedFrom];
668
676
  resourceMatrixForTableChart.push(resourceArrayForTableChart);
669
677
  teacherName = undefined;
670
678
  teacherSubject = undefined;
@@ -693,7 +701,7 @@
693
701
  var grade;
694
702
  var chapter;
695
703
  var AssestDetail;
696
- var teachingpoint;
704
+ var teachingPoint;
697
705
  var location;
698
706
  var teacherName;
699
707
  var teacherSubject;
@@ -724,21 +732,21 @@
724
732
  subject = undefined;
725
733
  grade = undefined;
726
734
  chapter = undefined;
727
- teachingpoint = undefined;
735
+ teachingPoint = undefined;
728
736
  AssestDetail = undefined;
729
- // resourceArrayForTableChart = [subject,grade,chapter,teachingpoint,AssestDetail];
737
+ // resourceArrayForTableChart = [subject,grade,chapter,teachingPoint,AssestDetail];
730
738
  // detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
731
739
  }
732
740
  else {
733
741
  //satyajit
734
- //resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingpoint,type,title]
742
+ //resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingPoint,type,title]
735
743
  for (var k = 0; k < resourceMetadataIDs.length; k++) {
736
744
  for (var i = 0; i < resourceMetadataMatrix.length; i++) {
737
745
  if (resourceMetadataIDs[k] === resourceMetadataMatrix[i].resouseID) {
738
746
  subject = resourceMetadataMatrix[i].subject;
739
747
  grade = resourceMetadataMatrix[i].grade;
740
748
  chapter = resourceMetadataMatrix[i].chapter;
741
- teachingpoint = resourceMetadataMatrix[i].teachingpoint;
749
+ teachingPoint = resourceMetadataMatrix[i].teachingPoint;
742
750
  if (resourceMetadataMatrix[i].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i].title.toLowerCase() === 'question') {
743
751
  //AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataIDsduration[k] + ' sec';
744
752
  AssestDetail = resourceMetadataMatrix[i].type + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
@@ -748,7 +756,7 @@
748
756
  //AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + resourceMetadataIDsduration[k] + ' sec';
749
757
  AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
750
758
  }
751
- resourceArrayForTableChart = [subject, grade, chapter, teachingpoint, AssestDetail];
759
+ resourceArrayForTableChart = [subject, grade, chapter, teachingPoint, AssestDetail];
752
760
  detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
753
761
  }
754
762
  }
@@ -889,7 +897,7 @@
889
897
  this.isChartView = true;
890
898
  }
891
899
  ChartheaderComponent.prototype.ngOnInit = function () {
892
- this.libVersion = "0.0.27";
900
+ this.libVersion = "0.0.28";
893
901
  // this.myIcon = document.getElementById('myIconImg');
894
902
  // this.changeChatType()
895
903
  };
@@ -1407,7 +1415,7 @@
1407
1415
  ChartviewComponent.prototype.calulateTotalDuration = function (detailViewMatrix) {
1408
1416
  //
1409
1417
  console.log('detailViewMatrix-->', detailViewMatrix);
1410
- var filteredData = detailViewMatrix.filter(function (item) { return item.userName !== "-" && item.userName !== "--"; });
1418
+ //const filteredData = detailViewMatrix.filter(item => item.userName !== "-" && item.userName !== "--");
1411
1419
  //detailViewMatrix = filteredData;
1412
1420
  var id_durationArray;
1413
1421
  var id_durationMatrix = new Array();
@@ -1684,13 +1692,42 @@
1684
1692
  _this.createTable(data.userDetails);
1685
1693
  }
1686
1694
  if (data.resourceDetails.length > 0) {
1687
- // console.log("data.resourceDetails",data.resourceDetails);
1695
+ data.resourceDetails = _this.replaceLabelChapterAndTopic(data.resourceDetails);
1688
1696
  _this.createResourcesTable(data.resourceDetails);
1697
+ console.log("11dec resourceDetails", data.resourceDetails);
1689
1698
  }
1690
1699
  }
1691
1700
  });
1692
1701
  this.deatilViewContainer.style.display = 'none';
1693
1702
  };
1703
+ DetailedviewComponent.prototype.replaceLabelChapterAndTopic = function (data) {
1704
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(selected)</span>";
1705
+ return data.map(function (row) {
1706
+ return row.map(function (cell) {
1707
+ if (cell.includes("Topic:")) {
1708
+ return cell.replace(/Topic: .*/, "Topic " + htmlStr);
1709
+ }
1710
+ if (cell.includes("Chapter:")) {
1711
+ return cell.replace(/Chapter: .*/, "Chapter " + htmlStr);
1712
+ }
1713
+ return cell;
1714
+ });
1715
+ });
1716
+ };
1717
+ DetailedviewComponent.prototype.replaceLabelChapterAndTopic1 = function (data) {
1718
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(selected)</span>";
1719
+ return data.map(function (row) {
1720
+ return row.map(function (cell) {
1721
+ if (cell.includes("Topic: :")) {
1722
+ return cell.replace(/Topic: :.*$/, "Topic " + htmlStr);
1723
+ }
1724
+ if (cell.includes("Chapter:")) {
1725
+ return cell.replace(/Chapter: .*$/, "Chapter " + htmlStr);
1726
+ }
1727
+ return cell;
1728
+ });
1729
+ });
1730
+ };
1694
1731
  DetailedviewComponent.prototype.createTable = function (userMetadata) {
1695
1732
  this.deatilViewContainer.style.display = 'block';
1696
1733
  while (this.deatilViewTable.firstChild) {
@@ -1731,6 +1768,7 @@
1731
1768
  if (cnt < labelArray.length) {
1732
1769
  cell.appendChild(labelArray[cnt]);
1733
1770
  row.appendChild(cell);
1771
+ //console.log('11dec', cell);
1734
1772
  }
1735
1773
  cnt++;
1736
1774
  }
@@ -1753,7 +1791,8 @@
1753
1791
  for (var i = 0; i < resoureMetadata.length; i++) {
1754
1792
  for (var j = 0; j < 5; j++) {
1755
1793
  var label = document.createElement('label');
1756
- label.appendChild(document.createTextNode(resoureMetadata[i][j]));
1794
+ //label.appendChild(document.createTextNode(resoureMetadata[i][j]));
1795
+ label.innerHTML = resoureMetadata[i][j];
1757
1796
  if (label.textContent === 'undefined' || label.textContent === undefined) {
1758
1797
  label.textContent = '';
1759
1798
  }
@@ -1779,6 +1818,7 @@
1779
1818
  if (cnt < labelArray.length) {
1780
1819
  cell.appendChild(labelArray[cnt]);
1781
1820
  row.appendChild(cell);
1821
+ //console.log('11dec', cell);
1782
1822
  }
1783
1823
  cnt++;
1784
1824
  }
@@ -2667,6 +2707,7 @@
2667
2707
  this.alluserList = fetchAlluserList.fordurationTable;
2668
2708
  // resoureMetadata list
2669
2709
  this.currentResoursedataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
2710
+ console.log('11decc data', this.currentResoursedataList);
2670
2711
  //console.log("AAA genarateUserReqiuredData-->>",genarateUserReqiuredData)
2671
2712
  //console.log("AAA this.currentResoursedataList-->>",this.currentResoursedataList)
2672
2713
  }
@@ -2678,10 +2719,12 @@
2678
2719
  this.pdService.chartType.subscribe(function (data) {
2679
2720
  if (data) {
2680
2721
  _this.updateChartType(data);
2722
+ console.log('11decc data', data);
2681
2723
  }
2682
2724
  });
2683
2725
  this.pdService.isUserWise_data.subscribe(function (data) {
2684
2726
  _this.updateDataType(data);
2727
+ console.log('11decc data', data);
2685
2728
  });
2686
2729
  this.pdService.isAllUsers.subscribe(function (data) {
2687
2730
  if (data) {
@@ -2707,6 +2750,8 @@
2707
2750
  };
2708
2751
  TableviewComponent.prototype.showCurrentDataUser = function () {
2709
2752
  this.tableViewData = this.pdService.dataForTableView(this.currentdataList, this.currentResoursedataList);
2753
+ console.log('11decc tableViewDataBBB', this.replaceTopicAndChapter(this.tableViewData));
2754
+ this.tableViewData = this.replaceTopicAndChapter(this.tableViewData);
2710
2755
  //this.tableViewData = this.findAndSimplifyNestedArray(this.tableViewData);
2711
2756
  var newTableViewData;
2712
2757
  for (var i = 0; i < this.tableViewData.length; i++) {
@@ -2720,9 +2765,28 @@
2720
2765
  if (this.tableViewData) {
2721
2766
  //this.ueserWiseTableView(this.tableViewData);
2722
2767
  this.ueserWiseTableView(this.tableViewData);
2768
+ console.log('11decc tableViewData', this.tableViewData);
2769
+ console.log('11decc tableViewDataAAA', this.replaceTopicAndChapter(this.tableViewData));
2723
2770
  }
2724
2771
  //console.log('AAA mlaunchedFromm tableViewData', this.tableViewData)
2725
2772
  };
2773
+ TableviewComponent.prototype.replaceTopicAndChapter = function (data) {
2774
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(selected)</span>";
2775
+ return data.map(function (row) {
2776
+ if (Array.isArray(row)) {
2777
+ return row.map(function (item) {
2778
+ if (typeof item === 'string') {
2779
+ //item = item.replace(/Topic :\s*(.+?)\s*:\s*0m 0s/, 'Topic: $1 ' + htmlStr);
2780
+ //item = item.replace(/Chapter :\s*(.+?)\s*:\s*0m 0s/, 'Chapter: $1 ' + htmlStr);
2781
+ item = item.replace(/Topic :\s*(.+?)\s*:\s*\d+m \d+s/, 'Topic: $1 ' + htmlStr);
2782
+ item = item.replace(/Chapter :\s*(.+?)\s*:\s*\d+m \d+s/, 'Chapter: $1 ' + htmlStr);
2783
+ }
2784
+ return item;
2785
+ });
2786
+ }
2787
+ return row;
2788
+ });
2789
+ };
2726
2790
  TableviewComponent.prototype.mergerSourceWithRoomData = function (tableViewData) {
2727
2791
  var lastIndexValue = tableViewData[tableViewData.length - 1].join(' ');
2728
2792
  // Merge last index value into the 6th index
@@ -2745,6 +2809,8 @@
2745
2809
  };
2746
2810
  TableviewComponent.prototype.showAllUser = function () {
2747
2811
  this.tableViewData = this.pdService.dataForTableView(this.alluserList, this.currentResoursedataList);
2812
+ console.log('11decc tableViewDataBBB', this.replaceTopicAndChapter(this.tableViewData));
2813
+ this.tableViewData = this.replaceTopicAndChapter(this.tableViewData);
2748
2814
  //console.log('AAA userConsoleMatrix tableViewData', this.tableViewData)
2749
2815
  var newTableViewData;
2750
2816
  for (var i = 0; i < this.tableViewData.length; i++) {
@@ -2785,7 +2851,7 @@
2785
2851
  //label.appendChild(document.createTextNode(resoureMetadata[i][j]));
2786
2852
  var label = document.createElement('div');
2787
2853
  label.innerHTML = (resoureMetadata[i][j]);
2788
- //console.log('label.textContent',label.textContent)
2854
+ //console.log('11dec label.textContent',label.textContent)
2789
2855
  if (label.textContent === 'undefined' ||
2790
2856
  label.textContent === undefined ||
2791
2857
  label.textContent === 'undefined\nce6-a' ||