principal-dashboard-lib-v2 0.0.27 → 0.0.29

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,31 +732,29 @@
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
- //AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataIDsduration[k] + ' sec';
744
- AssestDetail = resourceMetadataMatrix[i].type + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
745
- //convertSeconds
751
+ //AssestDetail = resourceMetadataMatrix[i].type + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
746
752
  }
747
753
  else {
748
- //AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + resourceMetadataIDsduration[k] + ' sec';
749
- AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
754
+ //AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
750
755
  }
751
- resourceArrayForTableChart = [subject, grade, chapter, teachingpoint, AssestDetail];
756
+ AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
757
+ resourceArrayForTableChart = [subject, grade, chapter, teachingPoint, AssestDetail];
752
758
  detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
753
759
  }
754
760
  }
@@ -815,6 +821,14 @@
815
821
  type: "video",
816
822
  display: "Video"
817
823
  },
824
+ {
825
+ type: "tools",
826
+ display: "Tools"
827
+ },
828
+ {
829
+ type: "feature",
830
+ display: "Feature"
831
+ },
818
832
  ];
819
833
  var displayValue = key;
820
834
  assetTypeConfig.forEach(function (value) {
@@ -889,7 +903,7 @@
889
903
  this.isChartView = true;
890
904
  }
891
905
  ChartheaderComponent.prototype.ngOnInit = function () {
892
- this.libVersion = "0.0.27";
906
+ this.libVersion = "0.0.29";
893
907
  // this.myIcon = document.getElementById('myIconImg');
894
908
  // this.changeChatType()
895
909
  };
@@ -1407,7 +1421,7 @@
1407
1421
  ChartviewComponent.prototype.calulateTotalDuration = function (detailViewMatrix) {
1408
1422
  //
1409
1423
  console.log('detailViewMatrix-->', detailViewMatrix);
1410
- var filteredData = detailViewMatrix.filter(function (item) { return item.userName !== "-" && item.userName !== "--"; });
1424
+ //const filteredData = detailViewMatrix.filter(item => item.userName !== "-" && item.userName !== "--");
1411
1425
  //detailViewMatrix = filteredData;
1412
1426
  var id_durationArray;
1413
1427
  var id_durationMatrix = new Array();
@@ -1684,13 +1698,42 @@
1684
1698
  _this.createTable(data.userDetails);
1685
1699
  }
1686
1700
  if (data.resourceDetails.length > 0) {
1687
- // console.log("data.resourceDetails",data.resourceDetails);
1701
+ data.resourceDetails = _this.replaceLabelChapterAndTopic(data.resourceDetails);
1688
1702
  _this.createResourcesTable(data.resourceDetails);
1703
+ console.log("11dec resourceDetails", data.resourceDetails);
1689
1704
  }
1690
1705
  }
1691
1706
  });
1692
1707
  this.deatilViewContainer.style.display = 'none';
1693
1708
  };
1709
+ DetailedviewComponent.prototype.replaceLabelChapterAndTopic = function (data) {
1710
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(seen)</span>";
1711
+ return data.map(function (row) {
1712
+ return row.map(function (cell) {
1713
+ if (cell.includes("Topic:")) {
1714
+ return cell.replace(/Topic: .*/, "Topic " + htmlStr);
1715
+ }
1716
+ if (cell.includes("Chapter:")) {
1717
+ return cell.replace(/Chapter: .*/, "Chapter " + htmlStr);
1718
+ }
1719
+ return cell;
1720
+ });
1721
+ });
1722
+ };
1723
+ DetailedviewComponent.prototype.replaceLabelChapterAndTopic1 = function (data) {
1724
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(selected)</span>";
1725
+ return data.map(function (row) {
1726
+ return row.map(function (cell) {
1727
+ if (cell.includes("Topic: :")) {
1728
+ return cell.replace(/Topic: :.*$/, "Topic " + htmlStr);
1729
+ }
1730
+ if (cell.includes("Chapter:")) {
1731
+ return cell.replace(/Chapter: .*$/, "Chapter " + htmlStr);
1732
+ }
1733
+ return cell;
1734
+ });
1735
+ });
1736
+ };
1694
1737
  DetailedviewComponent.prototype.createTable = function (userMetadata) {
1695
1738
  this.deatilViewContainer.style.display = 'block';
1696
1739
  while (this.deatilViewTable.firstChild) {
@@ -1731,6 +1774,7 @@
1731
1774
  if (cnt < labelArray.length) {
1732
1775
  cell.appendChild(labelArray[cnt]);
1733
1776
  row.appendChild(cell);
1777
+ //console.log('11dec', cell);
1734
1778
  }
1735
1779
  cnt++;
1736
1780
  }
@@ -1753,7 +1797,8 @@
1753
1797
  for (var i = 0; i < resoureMetadata.length; i++) {
1754
1798
  for (var j = 0; j < 5; j++) {
1755
1799
  var label = document.createElement('label');
1756
- label.appendChild(document.createTextNode(resoureMetadata[i][j]));
1800
+ //label.appendChild(document.createTextNode(resoureMetadata[i][j]));
1801
+ label.innerHTML = resoureMetadata[i][j];
1757
1802
  if (label.textContent === 'undefined' || label.textContent === undefined) {
1758
1803
  label.textContent = '';
1759
1804
  }
@@ -1779,6 +1824,7 @@
1779
1824
  if (cnt < labelArray.length) {
1780
1825
  cell.appendChild(labelArray[cnt]);
1781
1826
  row.appendChild(cell);
1827
+ //console.log('11dec', cell);
1782
1828
  }
1783
1829
  cnt++;
1784
1830
  }
@@ -2667,6 +2713,7 @@
2667
2713
  this.alluserList = fetchAlluserList.fordurationTable;
2668
2714
  // resoureMetadata list
2669
2715
  this.currentResoursedataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
2716
+ console.log('11decc data', this.currentResoursedataList);
2670
2717
  //console.log("AAA genarateUserReqiuredData-->>",genarateUserReqiuredData)
2671
2718
  //console.log("AAA this.currentResoursedataList-->>",this.currentResoursedataList)
2672
2719
  }
@@ -2678,10 +2725,12 @@
2678
2725
  this.pdService.chartType.subscribe(function (data) {
2679
2726
  if (data) {
2680
2727
  _this.updateChartType(data);
2728
+ console.log('11decc data', data);
2681
2729
  }
2682
2730
  });
2683
2731
  this.pdService.isUserWise_data.subscribe(function (data) {
2684
2732
  _this.updateDataType(data);
2733
+ console.log('11decc data', data);
2685
2734
  });
2686
2735
  this.pdService.isAllUsers.subscribe(function (data) {
2687
2736
  if (data) {
@@ -2707,6 +2756,8 @@
2707
2756
  };
2708
2757
  TableviewComponent.prototype.showCurrentDataUser = function () {
2709
2758
  this.tableViewData = this.pdService.dataForTableView(this.currentdataList, this.currentResoursedataList);
2759
+ console.log('11decc tableViewDataBBB', this.replaceTopicAndChapter(this.tableViewData));
2760
+ this.tableViewData = this.replaceTopicAndChapter(this.tableViewData);
2710
2761
  //this.tableViewData = this.findAndSimplifyNestedArray(this.tableViewData);
2711
2762
  var newTableViewData;
2712
2763
  for (var i = 0; i < this.tableViewData.length; i++) {
@@ -2720,9 +2771,28 @@
2720
2771
  if (this.tableViewData) {
2721
2772
  //this.ueserWiseTableView(this.tableViewData);
2722
2773
  this.ueserWiseTableView(this.tableViewData);
2774
+ console.log('11decc tableViewData', this.tableViewData);
2775
+ console.log('11decc tableViewDataAAA', this.replaceTopicAndChapter(this.tableViewData));
2723
2776
  }
2724
2777
  //console.log('AAA mlaunchedFromm tableViewData', this.tableViewData)
2725
2778
  };
2779
+ TableviewComponent.prototype.replaceTopicAndChapter = function (data) {
2780
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(seen)</span>";
2781
+ return data.map(function (row) {
2782
+ if (Array.isArray(row)) {
2783
+ return row.map(function (item) {
2784
+ if (typeof item === 'string') {
2785
+ //item = item.replace(/Topic :\s*(.+?)\s*:\s*0m 0s/, 'Topic: $1 ' + htmlStr);
2786
+ //item = item.replace(/Chapter :\s*(.+?)\s*:\s*0m 0s/, 'Chapter: $1 ' + htmlStr);
2787
+ item = item.replace(/Topic :\s*(.+?)\s*:\s*\d+m \d+s/, 'Topic: $1 ' + htmlStr);
2788
+ item = item.replace(/Chapter :\s*(.+?)\s*:\s*\d+m \d+s/, 'Chapter: $1 ' + htmlStr);
2789
+ }
2790
+ return item;
2791
+ });
2792
+ }
2793
+ return row;
2794
+ });
2795
+ };
2726
2796
  TableviewComponent.prototype.mergerSourceWithRoomData = function (tableViewData) {
2727
2797
  var lastIndexValue = tableViewData[tableViewData.length - 1].join(' ');
2728
2798
  // Merge last index value into the 6th index
@@ -2745,6 +2815,8 @@
2745
2815
  };
2746
2816
  TableviewComponent.prototype.showAllUser = function () {
2747
2817
  this.tableViewData = this.pdService.dataForTableView(this.alluserList, this.currentResoursedataList);
2818
+ console.log('11decc tableViewDataBBB', this.replaceTopicAndChapter(this.tableViewData));
2819
+ this.tableViewData = this.replaceTopicAndChapter(this.tableViewData);
2748
2820
  //console.log('AAA userConsoleMatrix tableViewData', this.tableViewData)
2749
2821
  var newTableViewData;
2750
2822
  for (var i = 0; i < this.tableViewData.length; i++) {
@@ -2785,7 +2857,7 @@
2785
2857
  //label.appendChild(document.createTextNode(resoureMetadata[i][j]));
2786
2858
  var label = document.createElement('div');
2787
2859
  label.innerHTML = (resoureMetadata[i][j]);
2788
- //console.log('label.textContent',label.textContent)
2860
+ //console.log('11dec label.textContent',label.textContent)
2789
2861
  if (label.textContent === 'undefined' ||
2790
2862
  label.textContent === undefined ||
2791
2863
  label.textContent === 'undefined\nce6-a' ||