principal-dashboard-lib-v2 0.0.29 → 0.0.30
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.
- package/bundles/principal-dashboard-lib-v2.umd.js +199 -34
- package/bundles/principal-dashboard-lib-v2.umd.js.map +1 -1
- package/bundles/principal-dashboard-lib-v2.umd.min.js +1 -1
- package/bundles/principal-dashboard-lib-v2.umd.min.js.map +1 -1
- package/esm2015/lib/chartheader/chartheader.component.js +2 -2
- package/esm2015/lib/chartview/chartview.component.js +2 -8
- package/esm2015/lib/detailedview/detailedview.component.js +2 -2
- package/esm2015/lib/full-table-view/full-table-view.component.js +183 -0
- package/esm2015/lib/principal-dashboard-lib-v2.component.js +2 -2
- package/esm2015/lib/principal-dashboard-lib-v2.module.js +4 -2
- package/esm2015/lib/principal-dashboard-lib-v2.service.js +4 -18
- package/esm2015/lib/tableview/tableview.component.js +2 -7
- package/esm2015/principal-dashboard-lib-v2.js +2 -1
- package/fesm2015/principal-dashboard-lib-v2.js +192 -35
- package/fesm2015/principal-dashboard-lib-v2.js.map +1 -1
- package/lib/full-table-view/full-table-view.component.d.ts +21 -0
- package/package.json +1 -1
- package/principal-dashboard-lib-v2.d.ts +1 -0
- package/principal-dashboard-lib-v2.metadata.json +1 -1
|
@@ -190,7 +190,6 @@
|
|
|
190
190
|
// const randomNumber = document.createElement('span');
|
|
191
191
|
// randomNumber.innerHTML = i.toString();
|
|
192
192
|
//usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName + " --- " + i;
|
|
193
|
-
//satyajit 28 aug 2024 removed count from userName
|
|
194
193
|
usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName;
|
|
195
194
|
usersMetadataMatrix.push(usermetadataMatrixUpdated[i]); //adding same name users in usermetadataMatrix with some random charators
|
|
196
195
|
this.usersMetaData = usersMetadataMatrix;
|
|
@@ -312,7 +311,6 @@
|
|
|
312
311
|
}
|
|
313
312
|
if (userConsoleResources != null) {
|
|
314
313
|
if (userConsoleResources.userConsoleResource !== undefined) {
|
|
315
|
-
// satyajit resource wise duration added
|
|
316
314
|
userConsoleResources.userConsoleResource.forEach(function (item) {
|
|
317
315
|
//console.log("lookingFor: ",item)
|
|
318
316
|
resourceMetauserConsoleData.push(item.resourceId); // get name of user w.r.t. ID
|
|
@@ -395,7 +393,6 @@
|
|
|
395
393
|
if (typeof this.userConsoleData[i].userName === undefined) {
|
|
396
394
|
this.userConsoleData[i].userName = (Math.floor(Math.random() * 100)).toString();
|
|
397
395
|
}
|
|
398
|
-
/// SATYAJIT TO CHECK 19 SEPT.
|
|
399
396
|
if (this.userConsoleData[i].userName === undefined) {
|
|
400
397
|
this.userConsoleData[i].userName = "-";
|
|
401
398
|
//console.log('pakad',this.userConsoleData[i].userName = "-", this.userConsoleData[i].userId)
|
|
@@ -585,7 +582,6 @@
|
|
|
585
582
|
return { forChartData: dataTableforChart, fordurationTable: allRoomsDetails };
|
|
586
583
|
};
|
|
587
584
|
PrincipalDashboardLibV2Service.prototype.dataForTableView = function (userConsoleMatrix, resourceMetadataMatrix) {
|
|
588
|
-
console.log("AAA userConsoleMatrix", userConsoleMatrix, "-resourceMetadataMatrix->", resourceMetadataMatrix);
|
|
589
585
|
var currentDate;
|
|
590
586
|
var resourceMatrixForTableChart = new Array();
|
|
591
587
|
var resourceMatrixForExcel = new Array();
|
|
@@ -654,24 +650,18 @@
|
|
|
654
650
|
for (var k = 0; k < resourceMetadataIDs.length; k++) {
|
|
655
651
|
for (var i_4 = 0; i_4 < resourceMetadataMatrix.length; i_4++) {
|
|
656
652
|
if (resourceMetadataIDs[k] === resourceMetadataMatrix[i_4].resouseID) {
|
|
657
|
-
// satyajit
|
|
658
653
|
subject = resourceMetadataMatrix[i_4].subject;
|
|
659
654
|
grade = resourceMetadataMatrix[i_4].grade;
|
|
660
655
|
chapter = resourceMetadataMatrix[i_4].chapter;
|
|
661
656
|
topicName = resourceMetadataMatrix[i_4].topicName;
|
|
662
657
|
teachingPoint = resourceMetadataMatrix[i_4].teachingPoint;
|
|
663
658
|
if (resourceMetadataMatrix[i_4].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i_4].title.toLowerCase() === 'question') {
|
|
664
|
-
//AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
|
|
665
659
|
AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
|
|
666
|
-
//convertSeconds
|
|
667
660
|
}
|
|
668
661
|
else {
|
|
669
|
-
//AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
|
|
670
662
|
AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + " : " + resourceMetadataMatrix[i_4].title + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
|
|
671
663
|
}
|
|
672
664
|
//AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k];
|
|
673
|
-
//console.log('roomDetail',roomDetail)
|
|
674
|
-
console.log('teachingPoint', teachingPoint);
|
|
675
665
|
resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingPoint, AssestDetail, launchedFrom];
|
|
676
666
|
resourceMatrixForTableChart.push(resourceArrayForTableChart);
|
|
677
667
|
teacherName = undefined;
|
|
@@ -734,12 +724,8 @@
|
|
|
734
724
|
chapter = undefined;
|
|
735
725
|
teachingPoint = undefined;
|
|
736
726
|
AssestDetail = undefined;
|
|
737
|
-
// resourceArrayForTableChart = [subject,grade,chapter,teachingPoint,AssestDetail];
|
|
738
|
-
// detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
|
|
739
727
|
}
|
|
740
728
|
else {
|
|
741
|
-
//satyajit
|
|
742
|
-
//resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingPoint,type,title]
|
|
743
729
|
for (var k = 0; k < resourceMetadataIDs.length; k++) {
|
|
744
730
|
for (var i = 0; i < resourceMetadataMatrix.length; i++) {
|
|
745
731
|
if (resourceMetadataIDs[k] === resourceMetadataMatrix[i].resouseID) {
|
|
@@ -748,12 +734,12 @@
|
|
|
748
734
|
chapter = resourceMetadataMatrix[i].chapter;
|
|
749
735
|
teachingPoint = resourceMetadataMatrix[i].teachingPoint;
|
|
750
736
|
if (resourceMetadataMatrix[i].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i].title.toLowerCase() === 'question') {
|
|
751
|
-
|
|
737
|
+
AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
|
|
752
738
|
}
|
|
753
739
|
else {
|
|
754
|
-
|
|
740
|
+
AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
|
|
755
741
|
}
|
|
756
|
-
AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
|
|
742
|
+
//AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
|
|
757
743
|
resourceArrayForTableChart = [subject, grade, chapter, teachingPoint, AssestDetail];
|
|
758
744
|
detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
|
|
759
745
|
}
|
|
@@ -882,7 +868,7 @@
|
|
|
882
868
|
PrincipalDashboardLibV2Component.decorators = [
|
|
883
869
|
{ type: i0.Component, args: [{
|
|
884
870
|
selector: 'lib-principal-dashboard-lib-v2',
|
|
885
|
-
template: "<div id=\"reprtModule\">\n <div id=\"pd-mainDiv\" class=\"pd-mainContainer\">\n <lib-header [data]=\"data\" (userSelectedDate)=\"onUserSelectDate($event)\">\n </lib-header>\n <lib-chartheader></lib-chartheader>\n \n <div id=\"pd-preloader\" class=\"pd-preloaderDiv\" *ngIf=\"responseStatus !== 'true' && !data\">\n {{messageForUser}} \n </div>\n <lib-chartview *ngIf=\"data\" [data]=\"data\"></lib-chartview>\n <lib-tableview *ngIf=\"data\" [data]=\"data\"></lib-tableview>\n <lib-detailedview *ngIf=\"data\" [data]=\"data\"></lib-detailedview>\n \n </div>\n</div>\n ",
|
|
871
|
+
template: "<div id=\"reprtModule\">\n <div id=\"pd-mainDiv\" class=\"pd-mainContainer\">\n <lib-header [data]=\"data\" (userSelectedDate)=\"onUserSelectDate($event)\">\n </lib-header>\n <lib-chartheader></lib-chartheader>\n \n <div id=\"pd-preloader\" class=\"pd-preloaderDiv\" *ngIf=\"responseStatus !== 'true' && !data\">\n {{messageForUser}} \n </div>\n <lib-chartview *ngIf=\"data\" [data]=\"data\"></lib-chartview>\n <!-- <lib-tableview *ngIf=\"data\" [data]=\"data\"></lib-tableview> -->\n <lib-full-table-view *ngIf=\"data\" [data]=\"data\"></lib-full-table-view>\n <lib-detailedview *ngIf=\"data\" [data]=\"data\"></lib-detailedview>\n \n </div>\n</div>\n ",
|
|
886
872
|
styles: [".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;z-index:2}.bs-datepicker-head{background-color:#000!important}"]
|
|
887
873
|
},] }
|
|
888
874
|
];
|
|
@@ -903,7 +889,7 @@
|
|
|
903
889
|
this.isChartView = true;
|
|
904
890
|
}
|
|
905
891
|
ChartheaderComponent.prototype.ngOnInit = function () {
|
|
906
|
-
this.libVersion = "0.0.
|
|
892
|
+
this.libVersion = "0.0.30";
|
|
907
893
|
// this.myIcon = document.getElementById('myIconImg');
|
|
908
894
|
// this.changeChatType()
|
|
909
895
|
};
|
|
@@ -1382,7 +1368,7 @@
|
|
|
1382
1368
|
}else{
|
|
1383
1369
|
this.chartDataTable = this.myChartDataMatrix;
|
|
1384
1370
|
}*/
|
|
1385
|
-
console.log("this.myChartDataMatrix",
|
|
1371
|
+
//console.log("this.myChartDataMatrix",this.myChartDataMatrix);
|
|
1386
1372
|
(this.myChartOptions = {
|
|
1387
1373
|
tooltip: {
|
|
1388
1374
|
trigger: 'none',
|
|
@@ -1403,16 +1389,11 @@
|
|
|
1403
1389
|
}, 1000);
|
|
1404
1390
|
};
|
|
1405
1391
|
ChartviewComponent.prototype.filterUserHasDash = function (callee) {
|
|
1406
|
-
console.log('6dec callee', callee);
|
|
1407
|
-
console.log('6dec left', this.myChartDataMatrix);
|
|
1408
|
-
console.log('6dec right', this.currentdataList.userConsoleData);
|
|
1409
1392
|
var leftData = this.myChartDataMatrix;
|
|
1410
1393
|
var rightData = this.currentdataList.userConsoleData;
|
|
1411
1394
|
var updatedChartData = leftData.filter(function (row) { return row[0] !== "-"; });
|
|
1412
1395
|
// Filter out objects in rightData where the userName is "-"
|
|
1413
1396
|
var updatedRightData = rightData.filter(function (item) { return item.userName !== "-"; });
|
|
1414
|
-
console.log('6dec updatedChartData left', updatedChartData);
|
|
1415
|
-
console.log('6dec updatedRightData right', updatedRightData);
|
|
1416
1397
|
return {
|
|
1417
1398
|
updatedChartData: updatedChartData,
|
|
1418
1399
|
updatedRightData: updatedRightData
|
|
@@ -1420,7 +1401,6 @@
|
|
|
1420
1401
|
};
|
|
1421
1402
|
ChartviewComponent.prototype.calulateTotalDuration = function (detailViewMatrix) {
|
|
1422
1403
|
//
|
|
1423
|
-
console.log('detailViewMatrix-->', detailViewMatrix);
|
|
1424
1404
|
//const filteredData = detailViewMatrix.filter(item => item.userName !== "-" && item.userName !== "--");
|
|
1425
1405
|
//detailViewMatrix = filteredData;
|
|
1426
1406
|
var id_durationArray;
|
|
@@ -1700,7 +1680,7 @@
|
|
|
1700
1680
|
if (data.resourceDetails.length > 0) {
|
|
1701
1681
|
data.resourceDetails = _this.replaceLabelChapterAndTopic(data.resourceDetails);
|
|
1702
1682
|
_this.createResourcesTable(data.resourceDetails);
|
|
1703
|
-
console.log("11dec resourceDetails",
|
|
1683
|
+
//console.log("11dec resourceDetails",data.resourceDetails);
|
|
1704
1684
|
}
|
|
1705
1685
|
}
|
|
1706
1686
|
});
|
|
@@ -2699,6 +2679,7 @@
|
|
|
2699
2679
|
};
|
|
2700
2680
|
TableviewComponent.prototype.loadTable = function (response) {
|
|
2701
2681
|
var _this = this;
|
|
2682
|
+
console.log('mresponse: ', response);
|
|
2702
2683
|
// let parse = new DOMParser();
|
|
2703
2684
|
// this.myXmlData = parse.parseFromString(response, 'application/xml');
|
|
2704
2685
|
if (response) {
|
|
@@ -2713,7 +2694,6 @@
|
|
|
2713
2694
|
this.alluserList = fetchAlluserList.fordurationTable;
|
|
2714
2695
|
// resoureMetadata list
|
|
2715
2696
|
this.currentResoursedataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
|
|
2716
|
-
console.log('11decc data', this.currentResoursedataList);
|
|
2717
2697
|
//console.log("AAA genarateUserReqiuredData-->>",genarateUserReqiuredData)
|
|
2718
2698
|
//console.log("AAA this.currentResoursedataList-->>",this.currentResoursedataList)
|
|
2719
2699
|
}
|
|
@@ -2725,12 +2705,10 @@
|
|
|
2725
2705
|
this.pdService.chartType.subscribe(function (data) {
|
|
2726
2706
|
if (data) {
|
|
2727
2707
|
_this.updateChartType(data);
|
|
2728
|
-
console.log('11decc data', data);
|
|
2729
2708
|
}
|
|
2730
2709
|
});
|
|
2731
2710
|
this.pdService.isUserWise_data.subscribe(function (data) {
|
|
2732
2711
|
_this.updateDataType(data);
|
|
2733
|
-
console.log('11decc data', data);
|
|
2734
2712
|
});
|
|
2735
2713
|
this.pdService.isAllUsers.subscribe(function (data) {
|
|
2736
2714
|
if (data) {
|
|
@@ -2756,7 +2734,6 @@
|
|
|
2756
2734
|
};
|
|
2757
2735
|
TableviewComponent.prototype.showCurrentDataUser = function () {
|
|
2758
2736
|
this.tableViewData = this.pdService.dataForTableView(this.currentdataList, this.currentResoursedataList);
|
|
2759
|
-
console.log('11decc tableViewDataBBB', this.replaceTopicAndChapter(this.tableViewData));
|
|
2760
2737
|
this.tableViewData = this.replaceTopicAndChapter(this.tableViewData);
|
|
2761
2738
|
//this.tableViewData = this.findAndSimplifyNestedArray(this.tableViewData);
|
|
2762
2739
|
var newTableViewData;
|
|
@@ -2771,8 +2748,6 @@
|
|
|
2771
2748
|
if (this.tableViewData) {
|
|
2772
2749
|
//this.ueserWiseTableView(this.tableViewData);
|
|
2773
2750
|
this.ueserWiseTableView(this.tableViewData);
|
|
2774
|
-
console.log('11decc tableViewData', this.tableViewData);
|
|
2775
|
-
console.log('11decc tableViewDataAAA', this.replaceTopicAndChapter(this.tableViewData));
|
|
2776
2751
|
}
|
|
2777
2752
|
//console.log('AAA mlaunchedFromm tableViewData', this.tableViewData)
|
|
2778
2753
|
};
|
|
@@ -2908,6 +2883,194 @@
|
|
|
2908
2883
|
data: [{ type: i0.Input }]
|
|
2909
2884
|
};
|
|
2910
2885
|
|
|
2886
|
+
var FullTableViewComponent = /** @class */ (function () {
|
|
2887
|
+
function FullTableViewComponent(pdService) {
|
|
2888
|
+
this.pdService = pdService;
|
|
2889
|
+
this.currentUserArray = [];
|
|
2890
|
+
this.remaningUsers = [];
|
|
2891
|
+
this.allUsers = [];
|
|
2892
|
+
this.usersCheckboxChecked = false;
|
|
2893
|
+
this.isDisplay = false;
|
|
2894
|
+
}
|
|
2895
|
+
Object.defineProperty(FullTableViewComponent.prototype, "data", {
|
|
2896
|
+
set: function (res) {
|
|
2897
|
+
if (res !== null) {
|
|
2898
|
+
console.log('newtable', JSON.parse(res));
|
|
2899
|
+
this.jsonResponse = JSON.parse(res);
|
|
2900
|
+
}
|
|
2901
|
+
},
|
|
2902
|
+
enumerable: false,
|
|
2903
|
+
configurable: true
|
|
2904
|
+
});
|
|
2905
|
+
FullTableViewComponent.prototype.ngOnInit = function () {
|
|
2906
|
+
var _this = this;
|
|
2907
|
+
this.loadUserData();
|
|
2908
|
+
this.pdService.chartType.subscribe(function (data) {
|
|
2909
|
+
if (data) {
|
|
2910
|
+
console.log('newTable', data);
|
|
2911
|
+
_this.isDisplay = data === "Table";
|
|
2912
|
+
}
|
|
2913
|
+
});
|
|
2914
|
+
};
|
|
2915
|
+
FullTableViewComponent.prototype.loadUserData = function () {
|
|
2916
|
+
var _this = this;
|
|
2917
|
+
var json = this.jsonResponse;
|
|
2918
|
+
var usersConsole = json.usersConsole.userConsole;
|
|
2919
|
+
var usersMetadata = json.usersMetadata.userMetadata;
|
|
2920
|
+
var resourcesMetadata = json.resourcesMetadata.resourceMetadata;
|
|
2921
|
+
usersConsole.forEach(function (user) {
|
|
2922
|
+
var _a;
|
|
2923
|
+
var userDetails = usersMetadata.find(function (userMeta) { return userMeta.userId === user.userId; });
|
|
2924
|
+
if (user === null || user === void 0 ? void 0 : user.userConsoleResources) {
|
|
2925
|
+
var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
|
|
2926
|
+
if (userConsoleResource && userConsoleResource.length > 0) {
|
|
2927
|
+
userConsoleResource.forEach(function (userResource, userIndex) {
|
|
2928
|
+
var _a, _b, _c, _d;
|
|
2929
|
+
var resourceId = userResource.resourceId;
|
|
2930
|
+
var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
|
|
2931
|
+
userResource.type === resource.type; });
|
|
2932
|
+
var prefix = _this.getDisplayTypeValue(userResource.type);
|
|
2933
|
+
var title = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title;
|
|
2934
|
+
var tp = (_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title;
|
|
2935
|
+
var subject = (_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title;
|
|
2936
|
+
var chapter = (_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title;
|
|
2937
|
+
var grade = (_d = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.grade) === null || _d === void 0 ? void 0 : _d.title;
|
|
2938
|
+
var startTime = new Date(user === null || user === void 0 ? void 0 : user.startTime);
|
|
2939
|
+
var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
|
|
2940
|
+
var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
|
|
2941
|
+
var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
|
|
2942
|
+
duration = duration === 0 ? "<span style='colore:red;'>(Seen)</span>" : _this.formatTime(duration);
|
|
2943
|
+
_this.currentUserArray.push({
|
|
2944
|
+
userId: user.userId,
|
|
2945
|
+
teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
|
|
2946
|
+
subjects: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.userSubjects : '',
|
|
2947
|
+
date: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.selectedDate : '',
|
|
2948
|
+
startTime: userIndex === 0 ? _this.formatDate(startTime) : '',
|
|
2949
|
+
endtime: userIndex === 0 ? _this.formatDate(endTime) : '',
|
|
2950
|
+
totalDuration: userIndex === 0 ? totalDuration : '',
|
|
2951
|
+
room: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.terminalIP : '',
|
|
2952
|
+
tp: tp,
|
|
2953
|
+
subject: subject,
|
|
2954
|
+
chapter: chapter,
|
|
2955
|
+
grade: grade,
|
|
2956
|
+
details: prefix + " : " + title + " : " + duration,
|
|
2957
|
+
});
|
|
2958
|
+
});
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
});
|
|
2962
|
+
var currentUserIds = this.currentUserArray
|
|
2963
|
+
.map(function (x) { return x.userId; })
|
|
2964
|
+
.filter(function (x, i, a) { return a.indexOf(x) === i; });
|
|
2965
|
+
this.remaningUsers = usersMetadata
|
|
2966
|
+
.filter(function (user) { return !currentUserIds.includes(user.userId); })
|
|
2967
|
+
.map(function (user) {
|
|
2968
|
+
return {
|
|
2969
|
+
userId: user.userId,
|
|
2970
|
+
teacherName: user === null || user === void 0 ? void 0 : user.fullName,
|
|
2971
|
+
subjects: user === null || user === void 0 ? void 0 : user.userSubjects,
|
|
2972
|
+
date: '',
|
|
2973
|
+
startTime: '',
|
|
2974
|
+
endtime: '',
|
|
2975
|
+
totalDuration: '0s',
|
|
2976
|
+
room: '',
|
|
2977
|
+
tp: '',
|
|
2978
|
+
subject: '',
|
|
2979
|
+
chapter: '',
|
|
2980
|
+
grade: '',
|
|
2981
|
+
details: '',
|
|
2982
|
+
};
|
|
2983
|
+
});
|
|
2984
|
+
this.allUsers = __spread(this.currentUserArray, this.remaningUsers);
|
|
2985
|
+
this.loadTable(this.currentUserArray);
|
|
2986
|
+
};
|
|
2987
|
+
FullTableViewComponent.prototype.getDisplayTypeValue = function (key) {
|
|
2988
|
+
var assetTypeConfig = [
|
|
2989
|
+
{ type: 'asset_media', display: 'Media' },
|
|
2990
|
+
{ type: 'asset_print', display: 'Print' },
|
|
2991
|
+
{ type: 'quiz', display: 'Quiz' },
|
|
2992
|
+
{ type: 'question', display: 'Question' },
|
|
2993
|
+
{ type: 'chapter', display: 'Chapter' },
|
|
2994
|
+
{ type: 'tp', display: 'Topic' },
|
|
2995
|
+
{ type: 'whiteboard', display: 'Whiteboard' },
|
|
2996
|
+
{ type: 'widget', display: 'Widget' },
|
|
2997
|
+
{ type: 'casset_media', display: 'cMedia' },
|
|
2998
|
+
{ type: 'casset_print', display: 'cPrint' },
|
|
2999
|
+
{ type: 'cquiz', display: 'cQuiz' },
|
|
3000
|
+
{ type: 'cquestion', display: 'cQuestion' },
|
|
3001
|
+
{ type: 'image', display: 'Image' },
|
|
3002
|
+
{ type: 'video', display: 'Video' },
|
|
3003
|
+
{ type: 'tools', display: 'Tools' },
|
|
3004
|
+
{ type: 'feature', display: 'Feature' },
|
|
3005
|
+
];
|
|
3006
|
+
var asset = assetTypeConfig.find(function (value) { return value.type === key; });
|
|
3007
|
+
return asset ? asset.display : key;
|
|
3008
|
+
};
|
|
3009
|
+
FullTableViewComponent.prototype.formatDate = function (now) {
|
|
3010
|
+
var hours = now.getHours();
|
|
3011
|
+
var minutes = now.getMinutes();
|
|
3012
|
+
var seconds = now.getSeconds();
|
|
3013
|
+
var ampm = hours >= 12 ? 'PM' : 'AM';
|
|
3014
|
+
hours = hours % 12 || 12;
|
|
3015
|
+
return hours.toString().padStart(2, '0') + ":" + minutes
|
|
3016
|
+
.toString()
|
|
3017
|
+
.padStart(2, '0') + ":" + seconds.toString().padStart(2, '0') + " " + ampm;
|
|
3018
|
+
};
|
|
3019
|
+
FullTableViewComponent.prototype.formatTime = function (seconds) {
|
|
3020
|
+
var days = Math.floor(seconds / 86400);
|
|
3021
|
+
var hours = Math.floor((seconds % 86400) / 3600);
|
|
3022
|
+
var minutes = Math.floor((seconds % 3600) / 60);
|
|
3023
|
+
var secs = seconds % 60;
|
|
3024
|
+
if (seconds < 60)
|
|
3025
|
+
return secs + "s";
|
|
3026
|
+
if (seconds < 3600)
|
|
3027
|
+
return minutes + "m " + secs + "s";
|
|
3028
|
+
if (seconds < 86400)
|
|
3029
|
+
return hours + "h " + minutes + "m " + secs + "s";
|
|
3030
|
+
return days + "d " + hours + "h " + minutes + "m " + secs + "s";
|
|
3031
|
+
};
|
|
3032
|
+
FullTableViewComponent.prototype.loadTable = function (data) {
|
|
3033
|
+
/*
|
|
3034
|
+
const tableBody = document.querySelector("#teacherTable tbody");
|
|
3035
|
+
|
|
3036
|
+
data.forEach((item) => {
|
|
3037
|
+
const row = document.createElement("tr");
|
|
3038
|
+
for (const key in item) {
|
|
3039
|
+
const cell = document.createElement("td");
|
|
3040
|
+
cell.textContent = item[key];
|
|
3041
|
+
if (key !== "userId") {
|
|
3042
|
+
row.appendChild(cell);
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
tableBody.appendChild(row);
|
|
3046
|
+
});*/
|
|
3047
|
+
};
|
|
3048
|
+
FullTableViewComponent.prototype.toggleUsers = function () {
|
|
3049
|
+
this.usersCheckboxChecked = !this.usersCheckboxChecked;
|
|
3050
|
+
this.loadTable(this.usersCheckboxChecked
|
|
3051
|
+
? this.allUsers
|
|
3052
|
+
: this.currentUserArray);
|
|
3053
|
+
};
|
|
3054
|
+
FullTableViewComponent.prototype.getMockJson = function () {
|
|
3055
|
+
// Replace with actual data fetching logic
|
|
3056
|
+
return {};
|
|
3057
|
+
};
|
|
3058
|
+
return FullTableViewComponent;
|
|
3059
|
+
}());
|
|
3060
|
+
FullTableViewComponent.decorators = [
|
|
3061
|
+
{ type: i0.Component, args: [{
|
|
3062
|
+
selector: 'lib-full-table-view',
|
|
3063
|
+
template: "\n<div class=\"tableViewList\" *ngIf=\"isDisplay\">\n <!-- <label for=\"usersCheckbox\">All</label>\n <input\n type=\"checkbox\"\n id=\"usersCheckbox\"\n [checked]=\"usersCheckboxChecked\"\n (change)=\"toggleUsers()\"\n /> -->\n <div class=\"tableArea\">\n \n <table id=\"teacherTable\">\n <thead class=\"tablehead\">\n <tr>\n <th>Teacher Name</th>\n <th>Subjects</th>\n <th>Date</th>\n <th>Start Time</th>\n <th>End Time</th>\n <th>Total Duration</th>\n <th>Room</th>\n <th>TP</th>\n <th>Subject</th>\n <th>Chapter</th>\n <th>Grade</th>\n <th>Details</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let user of currentUserArray\">\n <td>{{ user.teacherName }}</td>\n <td>{{ user.subjects }}</td>\n <td>{{ user.date }}</td>\n <td>{{ user.startTime }}</td>\n <td>{{ user.endtime }}</td>\n <td>{{ user.totalDuration }}</td>\n <td>{{ user.room }}</td>\n <td>{{ user.tp }}</td>\n <td>{{ user.subject }}</td>\n <td>{{ user.chapter }}</td>\n <td>{{ user.grade }}</td>\n <td [innerHTML]=\"user.details\"></td>\n </tr>\n </tbody>\n </table>\n </div>\n \n</div>\n ",
|
|
3064
|
+
styles: ["body{font-family:Arial,sans-serif;margin:20px}.tablehead{position:sticky;top:0;background:#fff}table{width:100%;border-collapse:collapse}td,th{border:1px solid #ddd;padding:8px;text-align:left}th{background-color:#f4f4f4;font-weight:700}tr:nth-child(2n){background-color:#f9f9f9}tr:hover{background-color:#f1f1f1}.tableViewList{position:absolute;margin-top:20px}.tableArea{height:700px;overflow:scroll;font-size:12px;margin:20px 5px 5px}.tagseen{color:#00f}"]
|
|
3065
|
+
},] }
|
|
3066
|
+
];
|
|
3067
|
+
FullTableViewComponent.ctorParameters = function () { return [
|
|
3068
|
+
{ type: PrincipalDashboardLibV2Service }
|
|
3069
|
+
]; };
|
|
3070
|
+
FullTableViewComponent.propDecorators = {
|
|
3071
|
+
data: [{ type: i0.Input }]
|
|
3072
|
+
};
|
|
3073
|
+
|
|
2911
3074
|
var PrincipalDashboardLibV2Module = /** @class */ (function () {
|
|
2912
3075
|
function PrincipalDashboardLibV2Module() {
|
|
2913
3076
|
}
|
|
@@ -2921,7 +3084,8 @@
|
|
|
2921
3084
|
DetailedviewComponent,
|
|
2922
3085
|
HeaderComponent,
|
|
2923
3086
|
TableviewComponent,
|
|
2924
|
-
PrincipalDashboardLibV2Component
|
|
3087
|
+
PrincipalDashboardLibV2Component,
|
|
3088
|
+
FullTableViewComponent
|
|
2925
3089
|
],
|
|
2926
3090
|
imports: [
|
|
2927
3091
|
common.CommonModule,
|
|
@@ -2951,6 +3115,7 @@
|
|
|
2951
3115
|
exports.ɵd = HeaderComponent;
|
|
2952
3116
|
exports.ɵe = ExceldataService;
|
|
2953
3117
|
exports.ɵf = TableviewComponent;
|
|
3118
|
+
exports.ɵg = FullTableViewComponent;
|
|
2954
3119
|
|
|
2955
3120
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2956
3121
|
|