principal-dashboard-lib-v2 0.0.14 → 0.0.15

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.
@@ -228,7 +228,7 @@
228
228
  }
229
229
  }
230
230
  if (userConsole != null && userConsole.length > 0) {
231
- for (var index = 0; index < userConsole.length; index++) {
231
+ var _loop_1 = function (index) {
232
232
  var userId = void 0;
233
233
  var startTime = void 0;
234
234
  var endTime = void 0;
@@ -237,7 +237,8 @@
237
237
  var terminalIP = void 0;
238
238
  var userConsoleResources = void 0;
239
239
  var resourceMetadataIDS = void 0;
240
- var resourceMetauserConsoleData = new Array();
240
+ var resourceMetauserConsoleData = [];
241
+ var resourceDurationFromConsole = [];
241
242
  var userName = void 0;
242
243
  var userSubjects = void 0;
243
244
  var terminalLocation = void 0;
@@ -258,7 +259,7 @@
258
259
  //----------// endTime
259
260
  if (userConsole[index].endTime !== undefined) {
260
261
  endTime = userConsole[index].endTime; // get name of user w.r.t. ID
261
- this.myEndTime = endTime;
262
+ this_1.myEndTime = endTime;
262
263
  }
263
264
  else {
264
265
  endTime = '';
@@ -293,10 +294,16 @@
293
294
  }
294
295
  if (userConsoleResources != null) {
295
296
  if (userConsoleResources.userConsoleResource !== undefined) {
296
- resourceMetauserConsoleData = userConsoleResources.userConsoleResource; // get name of user w.r.t. ID
297
+ // satyajit resource wise duration added
298
+ userConsoleResources.userConsoleResource.forEach(function (item) {
299
+ resourceMetauserConsoleData.push(item.resourceId); // get name of user w.r.t. ID
300
+ resourceDurationFromConsole.push(item.duration);
301
+ });
302
+ // resourceMetauserConsoleData = userConsoleResources.userConsoleResource[index]resourceId; // get name of user w.r.t. ID
297
303
  }
298
304
  else {
299
305
  resourceMetauserConsoleData = [];
306
+ resourceDurationFromConsole = [];
300
307
  }
301
308
  }
302
309
  //----------// userName and userSubjects
@@ -315,9 +322,12 @@
315
322
  break;
316
323
  }
317
324
  else {
318
- terminalLocation = "location";
325
+ terminalLocation = '';
319
326
  }
320
327
  }
328
+ if (terminalLocation === undefined || terminalLocation === 'undefined') {
329
+ terminalLocation = '';
330
+ }
321
331
  var userData = {
322
332
  userId: userId,
323
333
  userName: userName,
@@ -325,13 +335,18 @@
325
335
  endTime: new Date(endTime),
326
336
  terminalIP: terminalIP,
327
337
  resourceMetauserConsoleData: resourceMetauserConsoleData,
338
+ resourceDurationFromConsole: resourceDurationFromConsole,
328
339
  duration: duration,
329
340
  terminalLocation: terminalLocation,
330
341
  userSubjects: userSubjects
331
342
  };
332
343
  userConsoleMatrix.push(userData);
333
- this.userConsoleData = userConsoleMatrix;
334
- this.isUserReqiuredDataReady.next(true);
344
+ this_1.userConsoleData = userConsoleMatrix;
345
+ this_1.isUserReqiuredDataReady.next(true);
346
+ };
347
+ var this_1 = this;
348
+ for (var index = 0; index < userConsole.length; index++) {
349
+ _loop_1(index);
335
350
  }
336
351
  }
337
352
  }
@@ -452,6 +467,7 @@
452
467
  return { forChartData: dataTableforChart, fordurationTable: allRoomsDetails };
453
468
  };
454
469
  PrincipalDashboardLibV2Service.prototype.dataForTableView = function (userConsoleMatrix, resourceMetadataMatrix) {
470
+ console.log("AAA userConsoleMatrix", userConsoleMatrix);
455
471
  var currentDate;
456
472
  var resourceMatrixForTableChart = new Array();
457
473
  var resourceMatrixForExcel = new Array();
@@ -473,6 +489,7 @@
473
489
  var teacherName = void 0;
474
490
  var teacherSubject = void 0;
475
491
  var resourceMetadataIDs = void 0;
492
+ var resourceMetadataIDsDuration = void 0;
476
493
  var resourceArrayForExcel = new Array();
477
494
  var resourceArrayForTableChart = new Array();
478
495
  var userConsoleDataMatrix = new Array();
@@ -494,7 +511,8 @@
494
511
  terminalIP = userConsoleMatrix[i].terminalIP;
495
512
  var roomDetail = location + ' ' + terminalIP;
496
513
  resourceMetadataIDs = userConsoleMatrix[i].resourceMetauserConsoleData;
497
- if (resourceMetadataIDs.length == 0) {
514
+ resourceMetadataIDsDuration = userConsoleMatrix[i].resourceDurationFromConsole;
515
+ if (resourceMetadataIDs.length === 0) {
498
516
  subject = undefined;
499
517
  grade = undefined;
500
518
  chapter = undefined;
@@ -510,11 +528,18 @@
510
528
  for (var k = 0; k < resourceMetadataIDs.length; k++) {
511
529
  for (var i_4 = 0; i_4 < resourceMetadataMatrix.length; i_4++) {
512
530
  if (resourceMetadataIDs[k] === resourceMetadataMatrix[i_4].resouseID) {
531
+ // satyajit
513
532
  subject = resourceMetadataMatrix[i_4].subject;
514
533
  grade = resourceMetadataMatrix[i_4].grade;
515
534
  chapter = resourceMetadataMatrix[i_4].chapter;
516
535
  teachingpoint = resourceMetadataMatrix[i_4].teachingpoint;
517
- AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + ": " + resourceMetadataMatrix[i_4].title;
536
+ if (resourceMetadataMatrix[i_4].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i_4].title.toLowerCase() === 'question') {
537
+ AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
538
+ }
539
+ else {
540
+ AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + " : " + resourceMetadataMatrix[i_4].title + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
541
+ }
542
+ //AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k];
518
543
  resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingpoint, AssestDetail];
519
544
  resourceMatrixForTableChart.push(resourceArrayForTableChart);
520
545
  teacherName = undefined;
@@ -550,6 +575,7 @@
550
575
  var teacherSubject;
551
576
  var currentDate;
552
577
  var resourceMetadataIDs;
578
+ var resourceMetadataIDsduration;
553
579
  var resourceArrayForTableChart = new Array();
554
580
  resourceArrayForTableChart = [];
555
581
  //----------------- for subject and Name
@@ -568,6 +594,7 @@
568
594
  terminalIP = userConsoleMatrix[rowLabel].terminalIP;
569
595
  var roomDetail = location + ' ' + terminalIP;
570
596
  resourceMetadataIDs = userConsoleMatrix[rowLabel].resourceMetauserConsoleData;
597
+ resourceMetadataIDsduration = userConsoleMatrix[rowLabel].resourceDurationFromConsole;
571
598
  detailedView_UserDataMatrix = [teacherName, startTime, teacherSubject, endTime, roomDetail];
572
599
  if (resourceMetadataIDs.length == 0) {
573
600
  subject = undefined;
@@ -579,6 +606,7 @@
579
606
  // detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
580
607
  }
581
608
  else {
609
+ //satyajit
582
610
  //resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingpoint,type,title]
583
611
  for (var k = 0; k < resourceMetadataIDs.length; k++) {
584
612
  for (var i = 0; i < resourceMetadataMatrix.length; i++) {
@@ -587,7 +615,12 @@
587
615
  grade = resourceMetadataMatrix[i].grade;
588
616
  chapter = resourceMetadataMatrix[i].chapter;
589
617
  teachingpoint = resourceMetadataMatrix[i].teachingpoint;
590
- AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title;
618
+ if (resourceMetadataMatrix[i].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i].title.toLowerCase() === 'question') {
619
+ AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataIDsduration[k] + ' sec';
620
+ }
621
+ else {
622
+ AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + resourceMetadataIDsduration[k] + ' sec';
623
+ }
591
624
  resourceArrayForTableChart = [subject, grade, chapter, teachingpoint, AssestDetail];
592
625
  detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
593
626
  }
@@ -724,7 +757,7 @@
724
757
  this.isChartView = true;
725
758
  }
726
759
  ChartheaderComponent.prototype.ngOnInit = function () {
727
- this.libVersion = "0.0.14";
760
+ this.libVersion = "0.0.15";
728
761
  // this.myIcon = document.getElementById('myIconImg');
729
762
  // this.changeChatType()
730
763
  };
@@ -1795,7 +1828,7 @@
1795
1828
  }
1796
1829
  }
1797
1830
  if (userConsole != null && userConsole.length > 0) {
1798
- for (var index = 0; index < userConsole.length; index++) {
1831
+ var _loop_1 = function (index) {
1799
1832
  var userId = void 0;
1800
1833
  var startTime = void 0;
1801
1834
  var endTime = void 0;
@@ -1804,7 +1837,8 @@
1804
1837
  var terminalIP = void 0;
1805
1838
  var userConsoleResources = void 0;
1806
1839
  var resourceMetadataIDS = void 0;
1807
- var resourceMetauserConsoleData = new Array();
1840
+ var resourceMetauserConsoleData = [];
1841
+ var resourceDurationFromConsole = [];
1808
1842
  var userName = void 0;
1809
1843
  var userSubjects = void 0;
1810
1844
  var terminalLocation = void 0;
@@ -1825,7 +1859,7 @@
1825
1859
  //----------// endTime
1826
1860
  if (userConsole[index].endTime !== undefined) {
1827
1861
  endTime = userConsole[index].endTime; // get name of user w.r.t. ID
1828
- this.myEndTime = endTime;
1862
+ this_1.myEndTime = endTime;
1829
1863
  }
1830
1864
  else {
1831
1865
  endTime = '';
@@ -1860,10 +1894,16 @@
1860
1894
  }
1861
1895
  if (userConsoleResources != null) {
1862
1896
  if (userConsoleResources.userConsoleResource !== undefined) {
1863
- resourceMetauserConsoleData = userConsoleResources.userConsoleResource; // get name of user w.r.t. ID
1897
+ // satyajit resource wise duration added
1898
+ userConsoleResources.userConsoleResource.forEach(function (item) {
1899
+ resourceMetauserConsoleData.push(item.resourceId); // get name of user w.r.t. ID
1900
+ resourceDurationFromConsole.push(item.duration);
1901
+ });
1902
+ // resourceMetauserConsoleData = userConsoleResources.userConsoleResource; // get name of user w.r.t. ID
1864
1903
  }
1865
1904
  else {
1866
1905
  resourceMetauserConsoleData = [];
1906
+ resourceDurationFromConsole = [];
1867
1907
  }
1868
1908
  }
1869
1909
  //----------// userName and userSubjects
@@ -1888,9 +1928,14 @@
1888
1928
  resourceMetauserConsoleData: resourceMetauserConsoleData,
1889
1929
  duration: duration,
1890
1930
  terminalLocation: terminalLocation,
1891
- userSubjects: userSubjects
1931
+ userSubjects: userSubjects,
1932
+ resourceDurationFromConsole: resourceDurationFromConsole
1892
1933
  };
1893
1934
  userConsoleMatrix.push(userData);
1935
+ };
1936
+ var this_1 = this;
1937
+ for (var index = 0; index < userConsole.length; index++) {
1938
+ _loop_1(index);
1894
1939
  }
1895
1940
  }
1896
1941
  return { usersMetadata: usersMetadataMatrix, schoolTerminalData: schoolTerminalMatrix, userConsoleData: userConsoleMatrix };
@@ -1916,6 +1961,7 @@
1916
1961
  var teacherName = void 0;
1917
1962
  var teacherSubject = void 0;
1918
1963
  var resourceMetadataIDs = void 0;
1964
+ var resourceMetadataIDsDuration = void 0;
1919
1965
  var resourceArrayForExcel = new Array();
1920
1966
  userID = userConsoleMatrix[i].userId;
1921
1967
  //----------------- for subject and Name
@@ -1936,6 +1982,7 @@
1936
1982
  var locationName = location;
1937
1983
  var terminalIPAddress = terminalIP;
1938
1984
  resourceMetadataIDs = userConsoleMatrix[i].resourceMetauserConsoleData;
1985
+ resourceMetadataIDsDuration = userConsoleMatrix[i].resourceDurationFromConsole;
1939
1986
  if (resourceMetadataIDs.length == 0) {
1940
1987
  subject = '';
1941
1988
  grade = '';
@@ -1964,7 +2011,7 @@
1964
2011
  resourceTitle = resourceMetadataMatrix[i_4].title;
1965
2012
  resourceType = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type);
1966
2013
  // FOR EXCEL
1967
- resourceArrayForExcel = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, locationName, terminalIPAddress, subject, grade, chapter, teachingpoint, resourceTitle, resourceType, userID];
2014
+ resourceArrayForExcel = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, locationName, terminalIPAddress, subject, grade, chapter, teachingpoint, resourceTitle, resourceType, userID, resourceMetadataIDsDuration[k]];
1968
2015
  resourceMatrixForExcel.push(resourceArrayForExcel);
1969
2016
  teacherName = '';
1970
2017
  teacherSubject = '';
@@ -2002,6 +2049,7 @@
2002
2049
  tpTitle: resourceMatrixForExcel[i][11],
2003
2050
  resourceTitle: resourceMatrixForExcel[i][12],
2004
2051
  resourceType: resourceMatrixForExcel[i][13],
2052
+ 'resourceDuration(sec)': resourceMatrixForExcel[i][15],
2005
2053
  };
2006
2054
  userList.push(data);
2007
2055
  }
@@ -2103,7 +2151,7 @@
2103
2151
  }
2104
2152
  // console.log("userObjectList",userObjectList)
2105
2153
  var userSummaryList = new Array();
2106
- var _loop_1 = function (i) {
2154
+ var _loop_2 = function (i) {
2107
2155
  var Assetcounts = [];
2108
2156
  //find count of present asset type
2109
2157
  var presentAsset = userObjectList[i].AssetType;
@@ -2113,7 +2161,7 @@
2113
2161
  var sampleArray = userObjectList[i].AssetType;
2114
2162
  sampleArray.forEach(function (x) { Assetcounts[x] = (Assetcounts[x] || 0) + 1; });
2115
2163
  // find missing assets
2116
- var missingAssets = this_1.resourceTypes.filter(function (n) { return !presentAsset.includes(n); });
2164
+ var missingAssets = this_2.resourceTypes.filter(function (n) { return !presentAsset.includes(n); });
2117
2165
  // adding missing asset with count 0 in list
2118
2166
  missingAssets.forEach(function (element) {
2119
2167
  Assetcounts[element] = 0;
@@ -2133,9 +2181,9 @@
2133
2181
  var returnedTarget = Object.assign(asset_media, Assetcounts);
2134
2182
  userSummaryList.push(returnedTarget);
2135
2183
  };
2136
- var this_1 = this;
2184
+ var this_2 = this;
2137
2185
  for (var i = 0; i < userObjectList.length; i++) {
2138
- _loop_1(i);
2186
+ _loop_2(i);
2139
2187
  }
2140
2188
  // console.log("userSummaryList",userSummaryList);
2141
2189
  return userSummaryList;
@@ -2425,6 +2473,8 @@
2425
2473
  this.alluserList = fetchAlluserList.fordurationTable;
2426
2474
  // resoureMetadata list
2427
2475
  this.currentResoursedataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
2476
+ console.log("AAA genarateUserReqiuredData-->>", genarateUserReqiuredData);
2477
+ console.log("AAA this.currentResoursedataList-->>", this.currentResoursedataList);
2428
2478
  }
2429
2479
  }
2430
2480
  this.tableViewDiv = document.getElementById('tableViewDiv');
@@ -2473,6 +2523,7 @@
2473
2523
  }
2474
2524
  };
2475
2525
  TableviewComponent.prototype.ueserWiseTableView = function (resoureMetadata) {
2526
+ console.log('AAA resoureMetadata', resoureMetadata);
2476
2527
  // this.deleterow("tableRow");
2477
2528
  document.getElementById("tblBody").innerHTML = "";
2478
2529
  var labelArray = new Array();
@@ -2508,8 +2559,8 @@
2508
2559
  TableviewComponent.decorators = [
2509
2560
  { type: i0.Component, args: [{
2510
2561
  selector: 'lib-tableview',
2511
- template: "\r\n <div id=\"tableViewDiv\" class=\"pd-tableViewDiv\">\r\n \r\n <table class=\"table table-bordered\" id=\"tableRow\">\r\n <thead>\r\n <tr class=\"table-headerRow\">\r\n <th scope=\"col\">Teacher Name</th>\r\n <th scope=\"col\">Subjects</th>\r\n <th scope=\"col\">Date</th>\r\n <th scope=\"col\">Start Time</th>\r\n <th scope=\"col\">End Time</th>\r\n <th scope=\"col\">Duration (mins)</th>\r\n <th scope=\"col\">Room</th>\r\n <th scope=\"col\">Subject</th>\r\n <th scope=\"col\">Topic of Class</th>\r\n <th scope=\"col\">Chapter Name</th>\r\n <th scope=\"col\">Topic Name</th>\r\n <th scope=\"col\">Assets Details</th>\r\n </tr>\r\n </thead>\r\n <tbody id=\"tblBody\">\r\n \r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n",
2512
- styles: [".pd-tableViewDiv{width:100%;height:484px;overflow:scroll}.pd-tableViewDiv #tableRow{font-size:small;width:100%;margin-left:24px;margin-top:10px}.pd-tableViewDiv .table-headerRow{font-weight:700}"]
2562
+ template: "\r\n <div id=\"tableViewDiv\" class=\"pd-tableViewDiv\">\r\n \r\n <table class=\"table table-bordered\" id=\"tableRow\">\r\n <thead class=\"table-head\">\r\n <tr class=\"table-headerRow\">\r\n <th scope=\"col\">Teacher Name</th>\r\n <th scope=\"col\">Subjects</th>\r\n <th scope=\"col\">Date</th>\r\n <th scope=\"col\">Start Time</th>\r\n <th scope=\"col\">End Time</th>\r\n <th scope=\"col\">Duration (mins)</th>\r\n <th scope=\"col\">Room</th>\r\n <th scope=\"col\">Subject</th>\r\n <th scope=\"col\">Topic of Class</th>\r\n <th scope=\"col\">Chapter Name</th>\r\n <th scope=\"col\">Topic Name</th>\r\n <th scope=\"col\">Assets Details</th>\r\n </tr>\r\n </thead>\r\n <tbody id=\"tblBody\">\r\n \r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n",
2563
+ styles: [".pd-tableViewDiv{width:100%;height:484px;overflow:scroll}.pd-tableViewDiv #tableRow{font-size:small;width:100%;margin-left:24px;margin-top:10px}.pd-tableViewDiv .table-headerRow{font-weight:700}.pd-tableViewDiv .table-head{position:sticky;top:0;background:#fff}"]
2513
2564
  },] }
2514
2565
  ];
2515
2566
  TableviewComponent.ctorParameters = function () { return [