principal-dashboard-lib-v2 0.0.29 → 0.0.31
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 +449 -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 +4 -8
- package/esm2015/lib/detailedview/detailedview.component.js +2 -2
- package/esm2015/lib/full-table-view/full-table-view.component.js +193 -0
- package/esm2015/lib/principal-dashboard-lib-v2.component.js +2 -2
- package/esm2015/lib/principal-dashboard-lib-v2.module.js +6 -2
- package/esm2015/lib/principal-dashboard-lib-v2.service.js +6 -18
- package/esm2015/lib/small-table-view/small-table-view.component.js +229 -0
- package/esm2015/lib/tableview/tableview.component.js +2 -7
- package/esm2015/principal-dashboard-lib-v2.js +3 -1
- package/fesm2015/principal-dashboard-lib-v2.js +434 -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/lib/principal-dashboard-lib-v2.service.d.ts +2 -0
- package/lib/small-table-view/small-table-view.component.d.ts +24 -0
- package/package.json +1 -1
- package/principal-dashboard-lib-v2.d.ts +2 -0
- package/principal-dashboard-lib-v2.metadata.json +1 -1
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
//for get details of selected user
|
|
30
30
|
this.detailedviewData = new rxjs.BehaviorSubject(this.userMetadata);
|
|
31
31
|
this.detailedviewData$ = this.detailedviewData.asObservable();
|
|
32
|
+
this.openSmallTable = new rxjs.BehaviorSubject(false);
|
|
33
|
+
this.openSmallTable$ = this.openSmallTable.asObservable();
|
|
32
34
|
}
|
|
33
35
|
PrincipalDashboardLibV2Service.prototype.genarateResourseReqiuredData = function (data) {
|
|
34
36
|
this.isResoureMetaDataReady.next(false);
|
|
@@ -190,7 +192,6 @@
|
|
|
190
192
|
// const randomNumber = document.createElement('span');
|
|
191
193
|
// randomNumber.innerHTML = i.toString();
|
|
192
194
|
//usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName + " --- " + i;
|
|
193
|
-
//satyajit 28 aug 2024 removed count from userName
|
|
194
195
|
usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName;
|
|
195
196
|
usersMetadataMatrix.push(usermetadataMatrixUpdated[i]); //adding same name users in usermetadataMatrix with some random charators
|
|
196
197
|
this.usersMetaData = usersMetadataMatrix;
|
|
@@ -312,7 +313,6 @@
|
|
|
312
313
|
}
|
|
313
314
|
if (userConsoleResources != null) {
|
|
314
315
|
if (userConsoleResources.userConsoleResource !== undefined) {
|
|
315
|
-
// satyajit resource wise duration added
|
|
316
316
|
userConsoleResources.userConsoleResource.forEach(function (item) {
|
|
317
317
|
//console.log("lookingFor: ",item)
|
|
318
318
|
resourceMetauserConsoleData.push(item.resourceId); // get name of user w.r.t. ID
|
|
@@ -395,7 +395,6 @@
|
|
|
395
395
|
if (typeof this.userConsoleData[i].userName === undefined) {
|
|
396
396
|
this.userConsoleData[i].userName = (Math.floor(Math.random() * 100)).toString();
|
|
397
397
|
}
|
|
398
|
-
/// SATYAJIT TO CHECK 19 SEPT.
|
|
399
398
|
if (this.userConsoleData[i].userName === undefined) {
|
|
400
399
|
this.userConsoleData[i].userName = "-";
|
|
401
400
|
//console.log('pakad',this.userConsoleData[i].userName = "-", this.userConsoleData[i].userId)
|
|
@@ -585,7 +584,6 @@
|
|
|
585
584
|
return { forChartData: dataTableforChart, fordurationTable: allRoomsDetails };
|
|
586
585
|
};
|
|
587
586
|
PrincipalDashboardLibV2Service.prototype.dataForTableView = function (userConsoleMatrix, resourceMetadataMatrix) {
|
|
588
|
-
console.log("AAA userConsoleMatrix", userConsoleMatrix, "-resourceMetadataMatrix->", resourceMetadataMatrix);
|
|
589
587
|
var currentDate;
|
|
590
588
|
var resourceMatrixForTableChart = new Array();
|
|
591
589
|
var resourceMatrixForExcel = new Array();
|
|
@@ -654,24 +652,18 @@
|
|
|
654
652
|
for (var k = 0; k < resourceMetadataIDs.length; k++) {
|
|
655
653
|
for (var i_4 = 0; i_4 < resourceMetadataMatrix.length; i_4++) {
|
|
656
654
|
if (resourceMetadataIDs[k] === resourceMetadataMatrix[i_4].resouseID) {
|
|
657
|
-
// satyajit
|
|
658
655
|
subject = resourceMetadataMatrix[i_4].subject;
|
|
659
656
|
grade = resourceMetadataMatrix[i_4].grade;
|
|
660
657
|
chapter = resourceMetadataMatrix[i_4].chapter;
|
|
661
658
|
topicName = resourceMetadataMatrix[i_4].topicName;
|
|
662
659
|
teachingPoint = resourceMetadataMatrix[i_4].teachingPoint;
|
|
663
660
|
if (resourceMetadataMatrix[i_4].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i_4].title.toLowerCase() === 'question') {
|
|
664
|
-
//AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
|
|
665
661
|
AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
|
|
666
|
-
//convertSeconds
|
|
667
662
|
}
|
|
668
663
|
else {
|
|
669
|
-
//AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k] + ' sec';
|
|
670
664
|
AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + " : " + resourceMetadataMatrix[i_4].title + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
|
|
671
665
|
}
|
|
672
666
|
//AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k];
|
|
673
|
-
//console.log('roomDetail',roomDetail)
|
|
674
|
-
console.log('teachingPoint', teachingPoint);
|
|
675
667
|
resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingPoint, AssestDetail, launchedFrom];
|
|
676
668
|
resourceMatrixForTableChart.push(resourceArrayForTableChart);
|
|
677
669
|
teacherName = undefined;
|
|
@@ -734,12 +726,8 @@
|
|
|
734
726
|
chapter = undefined;
|
|
735
727
|
teachingPoint = undefined;
|
|
736
728
|
AssestDetail = undefined;
|
|
737
|
-
// resourceArrayForTableChart = [subject,grade,chapter,teachingPoint,AssestDetail];
|
|
738
|
-
// detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
|
|
739
729
|
}
|
|
740
730
|
else {
|
|
741
|
-
//satyajit
|
|
742
|
-
//resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingPoint,type,title]
|
|
743
731
|
for (var k = 0; k < resourceMetadataIDs.length; k++) {
|
|
744
732
|
for (var i = 0; i < resourceMetadataMatrix.length; i++) {
|
|
745
733
|
if (resourceMetadataIDs[k] === resourceMetadataMatrix[i].resouseID) {
|
|
@@ -748,12 +736,12 @@
|
|
|
748
736
|
chapter = resourceMetadataMatrix[i].chapter;
|
|
749
737
|
teachingPoint = resourceMetadataMatrix[i].teachingPoint;
|
|
750
738
|
if (resourceMetadataMatrix[i].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i].title.toLowerCase() === 'question') {
|
|
751
|
-
|
|
739
|
+
AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
|
|
752
740
|
}
|
|
753
741
|
else {
|
|
754
|
-
|
|
742
|
+
AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
|
|
755
743
|
}
|
|
756
|
-
AssestDetail = resourceMetadataMatrix[i].type + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
|
|
744
|
+
//AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
|
|
757
745
|
resourceArrayForTableChart = [subject, grade, chapter, teachingPoint, AssestDetail];
|
|
758
746
|
detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
|
|
759
747
|
}
|
|
@@ -882,7 +870,7 @@
|
|
|
882
870
|
PrincipalDashboardLibV2Component.decorators = [
|
|
883
871
|
{ type: i0.Component, args: [{
|
|
884
872
|
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 ",
|
|
873
|
+
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 <lib-small-table-view *ngIf=\"data\" [data]=\"data\"></lib-small-table-view>\n \n </div>\n</div>\n ",
|
|
886
874
|
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
875
|
},] }
|
|
888
876
|
];
|
|
@@ -903,7 +891,7 @@
|
|
|
903
891
|
this.isChartView = true;
|
|
904
892
|
}
|
|
905
893
|
ChartheaderComponent.prototype.ngOnInit = function () {
|
|
906
|
-
this.libVersion = "0.0.
|
|
894
|
+
this.libVersion = "0.0.31";
|
|
907
895
|
// this.myIcon = document.getElementById('myIconImg');
|
|
908
896
|
// this.changeChatType()
|
|
909
897
|
};
|
|
@@ -1382,7 +1370,7 @@
|
|
|
1382
1370
|
}else{
|
|
1383
1371
|
this.chartDataTable = this.myChartDataMatrix;
|
|
1384
1372
|
}*/
|
|
1385
|
-
console.log("this.myChartDataMatrix",
|
|
1373
|
+
//console.log("this.myChartDataMatrix",this.myChartDataMatrix);
|
|
1386
1374
|
(this.myChartOptions = {
|
|
1387
1375
|
tooltip: {
|
|
1388
1376
|
trigger: 'none',
|
|
@@ -1403,16 +1391,11 @@
|
|
|
1403
1391
|
}, 1000);
|
|
1404
1392
|
};
|
|
1405
1393
|
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
1394
|
var leftData = this.myChartDataMatrix;
|
|
1410
1395
|
var rightData = this.currentdataList.userConsoleData;
|
|
1411
1396
|
var updatedChartData = leftData.filter(function (row) { return row[0] !== "-"; });
|
|
1412
1397
|
// Filter out objects in rightData where the userName is "-"
|
|
1413
1398
|
var updatedRightData = rightData.filter(function (item) { return item.userName !== "-"; });
|
|
1414
|
-
console.log('6dec updatedChartData left', updatedChartData);
|
|
1415
|
-
console.log('6dec updatedRightData right', updatedRightData);
|
|
1416
1399
|
return {
|
|
1417
1400
|
updatedChartData: updatedChartData,
|
|
1418
1401
|
updatedRightData: updatedRightData
|
|
@@ -1420,7 +1403,6 @@
|
|
|
1420
1403
|
};
|
|
1421
1404
|
ChartviewComponent.prototype.calulateTotalDuration = function (detailViewMatrix) {
|
|
1422
1405
|
//
|
|
1423
|
-
console.log('detailViewMatrix-->', detailViewMatrix);
|
|
1424
1406
|
//const filteredData = detailViewMatrix.filter(item => item.userName !== "-" && item.userName !== "--");
|
|
1425
1407
|
//detailViewMatrix = filteredData;
|
|
1426
1408
|
var id_durationArray;
|
|
@@ -1550,7 +1532,9 @@
|
|
|
1550
1532
|
else {
|
|
1551
1533
|
this.selectedUserData = this.pdService.dataForDetailedView(this.currentdataList.userConsoleData, this.resourceDataList, row);
|
|
1552
1534
|
}
|
|
1535
|
+
var smallData = [{ 'a': this.currentdataList, 'b': row }];
|
|
1553
1536
|
// console.log("this.selectedUserData",this.selectedUserData);
|
|
1537
|
+
this.pdService.openSmallTable.next(this.selectedUserData);
|
|
1554
1538
|
this.pdService.detailedviewData.next(this.selectedUserData);
|
|
1555
1539
|
this.updateChart();
|
|
1556
1540
|
// alluserList
|
|
@@ -1700,7 +1684,7 @@
|
|
|
1700
1684
|
if (data.resourceDetails.length > 0) {
|
|
1701
1685
|
data.resourceDetails = _this.replaceLabelChapterAndTopic(data.resourceDetails);
|
|
1702
1686
|
_this.createResourcesTable(data.resourceDetails);
|
|
1703
|
-
console.log("11dec resourceDetails",
|
|
1687
|
+
//console.log("11dec resourceDetails",data.resourceDetails);
|
|
1704
1688
|
}
|
|
1705
1689
|
}
|
|
1706
1690
|
});
|
|
@@ -2699,6 +2683,7 @@
|
|
|
2699
2683
|
};
|
|
2700
2684
|
TableviewComponent.prototype.loadTable = function (response) {
|
|
2701
2685
|
var _this = this;
|
|
2686
|
+
console.log('mresponse: ', response);
|
|
2702
2687
|
// let parse = new DOMParser();
|
|
2703
2688
|
// this.myXmlData = parse.parseFromString(response, 'application/xml');
|
|
2704
2689
|
if (response) {
|
|
@@ -2713,7 +2698,6 @@
|
|
|
2713
2698
|
this.alluserList = fetchAlluserList.fordurationTable;
|
|
2714
2699
|
// resoureMetadata list
|
|
2715
2700
|
this.currentResoursedataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
|
|
2716
|
-
console.log('11decc data', this.currentResoursedataList);
|
|
2717
2701
|
//console.log("AAA genarateUserReqiuredData-->>",genarateUserReqiuredData)
|
|
2718
2702
|
//console.log("AAA this.currentResoursedataList-->>",this.currentResoursedataList)
|
|
2719
2703
|
}
|
|
@@ -2725,12 +2709,10 @@
|
|
|
2725
2709
|
this.pdService.chartType.subscribe(function (data) {
|
|
2726
2710
|
if (data) {
|
|
2727
2711
|
_this.updateChartType(data);
|
|
2728
|
-
console.log('11decc data', data);
|
|
2729
2712
|
}
|
|
2730
2713
|
});
|
|
2731
2714
|
this.pdService.isUserWise_data.subscribe(function (data) {
|
|
2732
2715
|
_this.updateDataType(data);
|
|
2733
|
-
console.log('11decc data', data);
|
|
2734
2716
|
});
|
|
2735
2717
|
this.pdService.isAllUsers.subscribe(function (data) {
|
|
2736
2718
|
if (data) {
|
|
@@ -2756,7 +2738,6 @@
|
|
|
2756
2738
|
};
|
|
2757
2739
|
TableviewComponent.prototype.showCurrentDataUser = function () {
|
|
2758
2740
|
this.tableViewData = this.pdService.dataForTableView(this.currentdataList, this.currentResoursedataList);
|
|
2759
|
-
console.log('11decc tableViewDataBBB', this.replaceTopicAndChapter(this.tableViewData));
|
|
2760
2741
|
this.tableViewData = this.replaceTopicAndChapter(this.tableViewData);
|
|
2761
2742
|
//this.tableViewData = this.findAndSimplifyNestedArray(this.tableViewData);
|
|
2762
2743
|
var newTableViewData;
|
|
@@ -2771,8 +2752,6 @@
|
|
|
2771
2752
|
if (this.tableViewData) {
|
|
2772
2753
|
//this.ueserWiseTableView(this.tableViewData);
|
|
2773
2754
|
this.ueserWiseTableView(this.tableViewData);
|
|
2774
|
-
console.log('11decc tableViewData', this.tableViewData);
|
|
2775
|
-
console.log('11decc tableViewDataAAA', this.replaceTopicAndChapter(this.tableViewData));
|
|
2776
2755
|
}
|
|
2777
2756
|
//console.log('AAA mlaunchedFromm tableViewData', this.tableViewData)
|
|
2778
2757
|
};
|
|
@@ -2908,6 +2887,438 @@
|
|
|
2908
2887
|
data: [{ type: i0.Input }]
|
|
2909
2888
|
};
|
|
2910
2889
|
|
|
2890
|
+
var FullTableViewComponent = /** @class */ (function () {
|
|
2891
|
+
function FullTableViewComponent(pdService) {
|
|
2892
|
+
this.pdService = pdService;
|
|
2893
|
+
this.currentUserArray = [];
|
|
2894
|
+
this.remaningUsers = [];
|
|
2895
|
+
this.allUsers = [];
|
|
2896
|
+
this.usersCheckboxChecked = false;
|
|
2897
|
+
this.isDisplay = false;
|
|
2898
|
+
}
|
|
2899
|
+
Object.defineProperty(FullTableViewComponent.prototype, "data", {
|
|
2900
|
+
set: function (res) {
|
|
2901
|
+
if (res !== null) {
|
|
2902
|
+
console.log('newtable', JSON.parse(res));
|
|
2903
|
+
this.jsonResponse = JSON.parse(res);
|
|
2904
|
+
}
|
|
2905
|
+
},
|
|
2906
|
+
enumerable: false,
|
|
2907
|
+
configurable: true
|
|
2908
|
+
});
|
|
2909
|
+
FullTableViewComponent.prototype.ngOnInit = function () {
|
|
2910
|
+
var _this = this;
|
|
2911
|
+
this.loadUserData();
|
|
2912
|
+
this.pdService.chartType.subscribe(function (data) {
|
|
2913
|
+
if (data) {
|
|
2914
|
+
console.log('newTable', data);
|
|
2915
|
+
_this.isDisplay = data === "Table";
|
|
2916
|
+
}
|
|
2917
|
+
});
|
|
2918
|
+
};
|
|
2919
|
+
FullTableViewComponent.prototype.loadUserData = function () {
|
|
2920
|
+
var _this = this;
|
|
2921
|
+
var json = this.jsonResponse;
|
|
2922
|
+
var usersConsole = json.usersConsole.userConsole;
|
|
2923
|
+
var usersMetadata = json.usersMetadata.userMetadata;
|
|
2924
|
+
var resourcesMetadata = json.resourcesMetadata.resourceMetadata;
|
|
2925
|
+
usersConsole.forEach(function (user) {
|
|
2926
|
+
var _a;
|
|
2927
|
+
var userDetails = usersMetadata.find(function (userMeta) { return userMeta.userId === user.userId; });
|
|
2928
|
+
if (user === null || user === void 0 ? void 0 : user.userConsoleResources) {
|
|
2929
|
+
var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
|
|
2930
|
+
if (userConsoleResource && userConsoleResource.length > 0) {
|
|
2931
|
+
userConsoleResource.forEach(function (userResource, userIndex) {
|
|
2932
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2933
|
+
var resourceId = userResource.resourceId;
|
|
2934
|
+
var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
|
|
2935
|
+
userResource.type === resource.type; });
|
|
2936
|
+
var prefix = _this.getDisplayTypeValue(userResource.type);
|
|
2937
|
+
var title = (resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title) || '';
|
|
2938
|
+
var tp = (_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title;
|
|
2939
|
+
var subject = (_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title;
|
|
2940
|
+
var chapter = (_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title;
|
|
2941
|
+
var grade = (_d = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.grade) === null || _d === void 0 ? void 0 : _d.title;
|
|
2942
|
+
var startTime = new Date(user === null || user === void 0 ? void 0 : user.startTime);
|
|
2943
|
+
var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
|
|
2944
|
+
var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
|
|
2945
|
+
var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
|
|
2946
|
+
//duration = duration === 0 ? "<span style='colore:red;'>(Seen)</span>" : this.formatTime(duration);
|
|
2947
|
+
if (((_e = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _e === void 0 ? void 0 : _e.includes('question')) || ((_f = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _f === void 0 ? void 0 : _f.includes('cquestion'))) {
|
|
2948
|
+
duration = 0;
|
|
2949
|
+
}
|
|
2950
|
+
else {
|
|
2951
|
+
duration = duration === 0 ? "<span class='seenTag' style='color:blue;'>(Seen)</span>" : _this.formatTime(duration);
|
|
2952
|
+
}
|
|
2953
|
+
var finalAssetTitle = prefix + " : " + title + " : " + duration;
|
|
2954
|
+
if (title === '') {
|
|
2955
|
+
finalAssetTitle = prefix + " : " + duration;
|
|
2956
|
+
}
|
|
2957
|
+
_this.currentUserArray.push({
|
|
2958
|
+
userId: user.userId,
|
|
2959
|
+
teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
|
|
2960
|
+
subjects: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.userSubjects : '',
|
|
2961
|
+
date: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.selectedDate : '',
|
|
2962
|
+
startTime: userIndex === 0 ? _this.formatDate(startTime) : '',
|
|
2963
|
+
endtime: userIndex === 0 ? _this.formatDate(endTime) : '',
|
|
2964
|
+
totalDuration: userIndex === 0 ? totalDuration : '',
|
|
2965
|
+
room: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.terminalIP : '',
|
|
2966
|
+
tp: tp,
|
|
2967
|
+
subject: subject,
|
|
2968
|
+
chapter: chapter,
|
|
2969
|
+
grade: grade,
|
|
2970
|
+
details: finalAssetTitle,
|
|
2971
|
+
});
|
|
2972
|
+
});
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
});
|
|
2976
|
+
var currentUserIds = this.currentUserArray
|
|
2977
|
+
.map(function (x) { return x.userId; })
|
|
2978
|
+
.filter(function (x, i, a) { return a.indexOf(x) === i; });
|
|
2979
|
+
this.remaningUsers = usersMetadata
|
|
2980
|
+
.filter(function (user) { return !currentUserIds.includes(user.userId); })
|
|
2981
|
+
.map(function (user) {
|
|
2982
|
+
return {
|
|
2983
|
+
userId: user.userId,
|
|
2984
|
+
teacherName: user === null || user === void 0 ? void 0 : user.fullName,
|
|
2985
|
+
subjects: user === null || user === void 0 ? void 0 : user.userSubjects,
|
|
2986
|
+
date: '',
|
|
2987
|
+
startTime: '',
|
|
2988
|
+
endtime: '',
|
|
2989
|
+
totalDuration: '0s',
|
|
2990
|
+
room: '',
|
|
2991
|
+
tp: '',
|
|
2992
|
+
subject: '',
|
|
2993
|
+
chapter: '',
|
|
2994
|
+
grade: '',
|
|
2995
|
+
details: '',
|
|
2996
|
+
};
|
|
2997
|
+
});
|
|
2998
|
+
this.allUsers = __spread(this.currentUserArray, this.remaningUsers);
|
|
2999
|
+
this.loadTable(this.currentUserArray);
|
|
3000
|
+
};
|
|
3001
|
+
FullTableViewComponent.prototype.getDisplayTypeValue = function (key) {
|
|
3002
|
+
var assetTypeConfig = [
|
|
3003
|
+
{ type: 'asset_media', display: 'Media' },
|
|
3004
|
+
{ type: 'asset_print', display: 'Print' },
|
|
3005
|
+
{ type: 'quiz', display: 'Quiz' },
|
|
3006
|
+
{ type: 'question', display: 'Question' },
|
|
3007
|
+
{ type: 'chapter', display: 'Chapter' },
|
|
3008
|
+
{ type: 'tp', display: 'Topic' },
|
|
3009
|
+
{ type: 'whiteboard', display: 'Whiteboard' },
|
|
3010
|
+
{ type: 'widget', display: 'Widget' },
|
|
3011
|
+
{ type: 'casset_media', display: 'cMedia' },
|
|
3012
|
+
{ type: 'casset_print', display: 'cPrint' },
|
|
3013
|
+
{ type: 'cquiz', display: 'cQuiz' },
|
|
3014
|
+
{ type: 'cquestion', display: 'cQuestion' },
|
|
3015
|
+
{ type: 'image', display: 'Image' },
|
|
3016
|
+
{ type: 'video', display: 'Video' },
|
|
3017
|
+
{ type: 'tools', display: 'Tools' },
|
|
3018
|
+
{ type: 'feature', display: 'Feature' },
|
|
3019
|
+
];
|
|
3020
|
+
var asset = assetTypeConfig.find(function (value) { return value.type === key; });
|
|
3021
|
+
return asset ? asset.display : key;
|
|
3022
|
+
};
|
|
3023
|
+
FullTableViewComponent.prototype.formatDate = function (now) {
|
|
3024
|
+
var hours = now.getHours();
|
|
3025
|
+
var minutes = now.getMinutes();
|
|
3026
|
+
var seconds = now.getSeconds();
|
|
3027
|
+
var ampm = hours >= 12 ? 'PM' : 'AM';
|
|
3028
|
+
hours = hours % 12 || 12;
|
|
3029
|
+
return hours.toString().padStart(2, '0') + ":" + minutes
|
|
3030
|
+
.toString()
|
|
3031
|
+
.padStart(2, '0') + ":" + seconds.toString().padStart(2, '0') + " " + ampm;
|
|
3032
|
+
};
|
|
3033
|
+
FullTableViewComponent.prototype.formatTime = function (seconds) {
|
|
3034
|
+
var days = Math.floor(seconds / 86400);
|
|
3035
|
+
var hours = Math.floor((seconds % 86400) / 3600);
|
|
3036
|
+
var minutes = Math.floor((seconds % 3600) / 60);
|
|
3037
|
+
var secs = seconds % 60;
|
|
3038
|
+
if (seconds < 60)
|
|
3039
|
+
return secs + "s";
|
|
3040
|
+
if (seconds < 3600)
|
|
3041
|
+
return minutes + "m " + secs + "s";
|
|
3042
|
+
if (seconds < 86400)
|
|
3043
|
+
return hours + "h " + minutes + "m " + secs + "s";
|
|
3044
|
+
return days + "d " + hours + "h " + minutes + "m " + secs + "s";
|
|
3045
|
+
};
|
|
3046
|
+
FullTableViewComponent.prototype.loadTable = function (data) {
|
|
3047
|
+
/*
|
|
3048
|
+
const tableBody = document.querySelector("#teacherTable tbody");
|
|
3049
|
+
|
|
3050
|
+
data.forEach((item) => {
|
|
3051
|
+
const row = document.createElement("tr");
|
|
3052
|
+
for (const key in item) {
|
|
3053
|
+
const cell = document.createElement("td");
|
|
3054
|
+
cell.textContent = item[key];
|
|
3055
|
+
if (key !== "userId") {
|
|
3056
|
+
row.appendChild(cell);
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
tableBody.appendChild(row);
|
|
3060
|
+
});*/
|
|
3061
|
+
};
|
|
3062
|
+
FullTableViewComponent.prototype.toggleUsers = function () {
|
|
3063
|
+
this.usersCheckboxChecked = !this.usersCheckboxChecked;
|
|
3064
|
+
this.loadTable(this.usersCheckboxChecked
|
|
3065
|
+
? this.allUsers
|
|
3066
|
+
: this.currentUserArray);
|
|
3067
|
+
};
|
|
3068
|
+
FullTableViewComponent.prototype.getMockJson = function () {
|
|
3069
|
+
// Replace with actual data fetching logic
|
|
3070
|
+
return {};
|
|
3071
|
+
};
|
|
3072
|
+
return FullTableViewComponent;
|
|
3073
|
+
}());
|
|
3074
|
+
FullTableViewComponent.decorators = [
|
|
3075
|
+
{ type: i0.Component, args: [{
|
|
3076
|
+
selector: 'lib-full-table-view',
|
|
3077
|
+
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>Topic</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><div [innerHTML]=\"user.details\"></div></td>\n </tr>\n </tbody>\n </table>\n </div>\n \n</div>\n ",
|
|
3078
|
+
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}.seenTag{color:#00f}"]
|
|
3079
|
+
},] }
|
|
3080
|
+
];
|
|
3081
|
+
FullTableViewComponent.ctorParameters = function () { return [
|
|
3082
|
+
{ type: PrincipalDashboardLibV2Service }
|
|
3083
|
+
]; };
|
|
3084
|
+
FullTableViewComponent.propDecorators = {
|
|
3085
|
+
data: [{ type: i0.Input }]
|
|
3086
|
+
};
|
|
3087
|
+
|
|
3088
|
+
var SmallTableViewComponent = /** @class */ (function () {
|
|
3089
|
+
function SmallTableViewComponent(pdService) {
|
|
3090
|
+
this.pdService = pdService;
|
|
3091
|
+
this.currentTimeFrameUserArray = [];
|
|
3092
|
+
this.currentUserArray = [];
|
|
3093
|
+
this.remaningUsers = [];
|
|
3094
|
+
this.allUsers = [];
|
|
3095
|
+
this.usersCheckboxChecked = false;
|
|
3096
|
+
this.isDisplay = false;
|
|
3097
|
+
}
|
|
3098
|
+
Object.defineProperty(SmallTableViewComponent.prototype, "data", {
|
|
3099
|
+
set: function (res) {
|
|
3100
|
+
if (res !== null) {
|
|
3101
|
+
//console.log('smallTable',JSON.parse(res));
|
|
3102
|
+
this.jsonResponse = JSON.parse(res);
|
|
3103
|
+
}
|
|
3104
|
+
},
|
|
3105
|
+
enumerable: false,
|
|
3106
|
+
configurable: true
|
|
3107
|
+
});
|
|
3108
|
+
SmallTableViewComponent.prototype.ngOnInit = function () {
|
|
3109
|
+
var _this = this;
|
|
3110
|
+
this.pdService.openSmallTable$.subscribe(function (data) {
|
|
3111
|
+
if (data) {
|
|
3112
|
+
_this.isDisplay = true;
|
|
3113
|
+
var userid = _this.findUserIdByName(data['userDetails'][0]);
|
|
3114
|
+
var startTime = data['userDetails'][1];
|
|
3115
|
+
var endTime = data['userDetails'][3];
|
|
3116
|
+
_this.loadUserData(userid, startTime, endTime);
|
|
3117
|
+
}
|
|
3118
|
+
else {
|
|
3119
|
+
_this.isDisplay = false;
|
|
3120
|
+
}
|
|
3121
|
+
});
|
|
3122
|
+
};
|
|
3123
|
+
SmallTableViewComponent.prototype.findUserIdByName = function (name) {
|
|
3124
|
+
var json = this.jsonResponse;
|
|
3125
|
+
var user = json.usersMetadata.userMetadata.find(function (user) { return user.fullName === name; });
|
|
3126
|
+
return user ? user.userId : null;
|
|
3127
|
+
};
|
|
3128
|
+
SmallTableViewComponent.prototype.loadUserData = function (userId, inputStartTime, inputEndTime) {
|
|
3129
|
+
var _this = this;
|
|
3130
|
+
var json = this.jsonResponse;
|
|
3131
|
+
var usersConsole = json.usersConsole.userConsole;
|
|
3132
|
+
var usersMetadata = json.usersMetadata.userMetadata;
|
|
3133
|
+
var resourcesMetadata = json.resourcesMetadata.resourceMetadata;
|
|
3134
|
+
var filteredUsersConsole = userId
|
|
3135
|
+
? usersConsole.filter(function (user) { return user.userId === userId; })
|
|
3136
|
+
: usersConsole;
|
|
3137
|
+
filteredUsersConsole.forEach(function (user) {
|
|
3138
|
+
var _a;
|
|
3139
|
+
var userDetails = usersMetadata.find(function (userMeta) { return userMeta.userId === user.userId; });
|
|
3140
|
+
if (user === null || user === void 0 ? void 0 : user.userConsoleResources) {
|
|
3141
|
+
var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
|
|
3142
|
+
if (userConsoleResource && userConsoleResource.length > 0) {
|
|
3143
|
+
userConsoleResource.forEach(function (userResource, userIndex) {
|
|
3144
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3145
|
+
var resourceId = userResource.resourceId;
|
|
3146
|
+
var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
|
|
3147
|
+
userResource.type === resource.type; });
|
|
3148
|
+
var prefix = _this.getDisplayTypeValue(userResource.type);
|
|
3149
|
+
var title = (resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title) || '';
|
|
3150
|
+
var tp = (_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title;
|
|
3151
|
+
var subject = (_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title;
|
|
3152
|
+
var chapter = (_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title;
|
|
3153
|
+
var grade = (_d = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.grade) === null || _d === void 0 ? void 0 : _d.title;
|
|
3154
|
+
var startTime = new Date(user === null || user === void 0 ? void 0 : user.startTime);
|
|
3155
|
+
var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
|
|
3156
|
+
var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
|
|
3157
|
+
var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
|
|
3158
|
+
//duration = duration === 0 ? "<span class='dddd'>(Seen)</span>" : this.formatTime(duration);
|
|
3159
|
+
if (((_e = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _e === void 0 ? void 0 : _e.includes('question')) || ((_f = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _f === void 0 ? void 0 : _f.includes('cquestion'))) {
|
|
3160
|
+
duration = 0;
|
|
3161
|
+
}
|
|
3162
|
+
else {
|
|
3163
|
+
duration = duration === 0 ? "<span class='dddd'>(Seen)</span>" : _this.formatTime(duration);
|
|
3164
|
+
}
|
|
3165
|
+
var finalAssetTitle = prefix + " : " + title + " : " + duration;
|
|
3166
|
+
if (title === '') {
|
|
3167
|
+
finalAssetTitle = prefix + " : " + duration;
|
|
3168
|
+
}
|
|
3169
|
+
_this.currentUserArray.push({
|
|
3170
|
+
userId: user.userId,
|
|
3171
|
+
teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
|
|
3172
|
+
subjects: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.userSubjects : '',
|
|
3173
|
+
date: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.selectedDate : '',
|
|
3174
|
+
startTime: userIndex === 0 ? _this.formatDate(startTime) : _this.formatDate(startTime),
|
|
3175
|
+
endtime: userIndex === 0 ? _this.formatDate(endTime) : _this.formatDate(endTime),
|
|
3176
|
+
totalDuration: userIndex === 0 ? totalDuration : '',
|
|
3177
|
+
room: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.terminalIP : '',
|
|
3178
|
+
tp: tp,
|
|
3179
|
+
subject: subject,
|
|
3180
|
+
chapter: chapter,
|
|
3181
|
+
grade: grade,
|
|
3182
|
+
details: finalAssetTitle,
|
|
3183
|
+
});
|
|
3184
|
+
});
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
});
|
|
3188
|
+
var currentUserIds = this.currentUserArray
|
|
3189
|
+
.map(function (x) { return x.userId; })
|
|
3190
|
+
.filter(function (x, i, a) { return a.indexOf(x) === i; });
|
|
3191
|
+
this.remaningUsers = usersMetadata
|
|
3192
|
+
.filter(function (user) { return !currentUserIds.includes(user.userId); })
|
|
3193
|
+
.map(function (user) {
|
|
3194
|
+
return {
|
|
3195
|
+
userId: user.userId,
|
|
3196
|
+
teacherName: user === null || user === void 0 ? void 0 : user.fullName,
|
|
3197
|
+
subjects: user === null || user === void 0 ? void 0 : user.userSubjects,
|
|
3198
|
+
date: '',
|
|
3199
|
+
startTime: '',
|
|
3200
|
+
endtime: '',
|
|
3201
|
+
totalDuration: '0s',
|
|
3202
|
+
room: '',
|
|
3203
|
+
tp: '',
|
|
3204
|
+
subject: '',
|
|
3205
|
+
chapter: '',
|
|
3206
|
+
grade: '',
|
|
3207
|
+
details: '',
|
|
3208
|
+
};
|
|
3209
|
+
});
|
|
3210
|
+
this.allUsers = __spread(this.currentUserArray, this.remaningUsers);
|
|
3211
|
+
this.currentTimeFrameUserArray = this.filterDataByCriteria(this.currentUserArray, userId, inputStartTime, inputEndTime);
|
|
3212
|
+
//console.log('smallData', this.currentTimeFrameUserArray)
|
|
3213
|
+
};
|
|
3214
|
+
SmallTableViewComponent.prototype.filterDataByCriteria = function (userData, inputUserId, inputStartTime, inputEndTime) {
|
|
3215
|
+
var parseTime = function (timeString) {
|
|
3216
|
+
if (!timeString)
|
|
3217
|
+
return null;
|
|
3218
|
+
var _g = __read(timeString.split(' '), 2), time = _g[0], meridian = _g[1];
|
|
3219
|
+
var _h = __read(time.split(':').map(Number), 3), hours = _h[0], minutes = _h[1], seconds = _h[2];
|
|
3220
|
+
var isPM = meridian === 'PM';
|
|
3221
|
+
return new Date(0, 0, 0, isPM && hours < 12 ? hours + 12 : hours, minutes, seconds);
|
|
3222
|
+
};
|
|
3223
|
+
var startTime = parseTime(inputStartTime);
|
|
3224
|
+
var endTime = parseTime(inputEndTime);
|
|
3225
|
+
var filteredData = userData.filter(function (entry) {
|
|
3226
|
+
if (entry.userId !== inputUserId)
|
|
3227
|
+
return false;
|
|
3228
|
+
if (!entry.startTime || !entry.endtime)
|
|
3229
|
+
return false;
|
|
3230
|
+
var entryStart = parseTime(entry.startTime);
|
|
3231
|
+
var entryEnd = parseTime(entry.endtime);
|
|
3232
|
+
return entryStart && entryEnd && entryStart >= startTime && entryEnd <= endTime;
|
|
3233
|
+
});
|
|
3234
|
+
return filteredData.map(function (entry, index) { return (Object.assign(Object.assign({}, entry), { subsequentCount: index })); });
|
|
3235
|
+
};
|
|
3236
|
+
SmallTableViewComponent.prototype.getDisplayTypeValue = function (key) {
|
|
3237
|
+
var assetTypeConfig = [
|
|
3238
|
+
{ type: 'asset_media', display: 'Media' },
|
|
3239
|
+
{ type: 'asset_print', display: 'Print' },
|
|
3240
|
+
{ type: 'quiz', display: 'Quiz' },
|
|
3241
|
+
{ type: 'question', display: 'Question' },
|
|
3242
|
+
{ type: 'chapter', display: 'Chapter' },
|
|
3243
|
+
{ type: 'tp', display: 'Topic' },
|
|
3244
|
+
{ type: 'whiteboard', display: 'Whiteboard' },
|
|
3245
|
+
{ type: 'widget', display: 'Widget' },
|
|
3246
|
+
{ type: 'casset_media', display: 'cMedia' },
|
|
3247
|
+
{ type: 'casset_print', display: 'cPrint' },
|
|
3248
|
+
{ type: 'cquiz', display: 'cQuiz' },
|
|
3249
|
+
{ type: 'cquestion', display: 'cQuestion' },
|
|
3250
|
+
{ type: 'image', display: 'Image' },
|
|
3251
|
+
{ type: 'video', display: 'Video' },
|
|
3252
|
+
{ type: 'tools', display: 'Tools' },
|
|
3253
|
+
{ type: 'feature', display: 'Feature' },
|
|
3254
|
+
];
|
|
3255
|
+
var asset = assetTypeConfig.find(function (value) { return value.type === key; });
|
|
3256
|
+
return asset ? asset.display : key;
|
|
3257
|
+
};
|
|
3258
|
+
SmallTableViewComponent.prototype.formatDate = function (now) {
|
|
3259
|
+
var hours = now.getHours();
|
|
3260
|
+
var minutes = now.getMinutes();
|
|
3261
|
+
var seconds = now.getSeconds();
|
|
3262
|
+
var ampm = hours >= 12 ? 'PM' : 'AM';
|
|
3263
|
+
hours = hours % 12 || 12;
|
|
3264
|
+
return hours.toString().padStart(2, '0') + ":" + minutes
|
|
3265
|
+
.toString()
|
|
3266
|
+
.padStart(2, '0') + ":" + seconds.toString().padStart(2, '0') + " " + ampm;
|
|
3267
|
+
};
|
|
3268
|
+
SmallTableViewComponent.prototype.formatTime = function (seconds) {
|
|
3269
|
+
var days = Math.floor(seconds / 86400);
|
|
3270
|
+
var hours = Math.floor((seconds % 86400) / 3600);
|
|
3271
|
+
var minutes = Math.floor((seconds % 3600) / 60);
|
|
3272
|
+
var secs = seconds % 60;
|
|
3273
|
+
if (seconds < 60)
|
|
3274
|
+
return secs + "s";
|
|
3275
|
+
if (seconds < 3600)
|
|
3276
|
+
return minutes + "m " + secs + "s";
|
|
3277
|
+
if (seconds < 86400)
|
|
3278
|
+
return hours + "h " + minutes + "m " + secs + "s";
|
|
3279
|
+
return days + "d " + hours + "h " + minutes + "m " + secs + "s";
|
|
3280
|
+
};
|
|
3281
|
+
SmallTableViewComponent.prototype.loadTable = function (data) {
|
|
3282
|
+
/*
|
|
3283
|
+
const tableBody = document.querySelector("#teacherTable tbody");
|
|
3284
|
+
|
|
3285
|
+
data.forEach((item) => {
|
|
3286
|
+
const row = document.createElement("tr");
|
|
3287
|
+
for (const key in item) {
|
|
3288
|
+
const cell = document.createElement("td");
|
|
3289
|
+
cell.textContent = item[key];
|
|
3290
|
+
if (key !== "userId") {
|
|
3291
|
+
row.appendChild(cell);
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
tableBody.appendChild(row);
|
|
3295
|
+
});*/
|
|
3296
|
+
};
|
|
3297
|
+
SmallTableViewComponent.prototype.toggleUsers = function () {
|
|
3298
|
+
this.usersCheckboxChecked = !this.usersCheckboxChecked;
|
|
3299
|
+
this.loadTable(this.usersCheckboxChecked
|
|
3300
|
+
? this.allUsers
|
|
3301
|
+
: this.currentUserArray);
|
|
3302
|
+
};
|
|
3303
|
+
SmallTableViewComponent.prototype.onCloseBtnClick = function () {
|
|
3304
|
+
this.isDisplay = false;
|
|
3305
|
+
};
|
|
3306
|
+
return SmallTableViewComponent;
|
|
3307
|
+
}());
|
|
3308
|
+
SmallTableViewComponent.decorators = [
|
|
3309
|
+
{ type: i0.Component, args: [{
|
|
3310
|
+
selector: 'lib-small-table-view',
|
|
3311
|
+
template: "<div id=\"pd-deatilViewContainer\" *ngIf=\"isDisplay\">\n <div class=\"pd-detailview-header\">\n <div class=\"pd-detailview-title\">Details</div>\n <div id=\"pd-closeButton\" (click)=\"onCloseBtnClick()\">+</div>\n </div>\n\n <div class=\"newTablesContainer\">\n\n <table id=\"userDataTable\" class=\"table table-bordered\">\n <tbody>\n <tr>\n <th style=\"font-weight: bold;\"><label>Name:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.teacherName || '' }}</label></td>\n <th style=\"font-weight: bold;\"><label>Start Time:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.startTime || '' }}</label></td>\n </tr>\n <tr>\n <th style=\"font-weight: bold;\"><label>Subject:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.subject || '' }}</label></td>\n <th style=\"font-weight: bold;\"><label>End Time:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.endtime || '' }}M</label></td>\n </tr>\n <tr>\n <th style=\"font-weight: bold;\"><label>Room Details:</label></th>\n <td><label> {{ currentTimeFrameUserArray[0]?.room || '' }}</label></td>\n </tr>\n </tbody>\n </table>\n \n \n\n <table class=\"table table-bordered\" id=\"resoureMetadataTable\">\n <tbody>\n <tr>\n <th style=\"font-weight: bold;\"><label>Subject</label></th>\n <th style=\"font-weight: bold;\"><label>Class</label></th>\n <th style=\"font-weight: bold;\"><label>Chapter Name</label></th>\n <th style=\"font-weight: bold;\"><label>Topic Name</label></th>\n <th style=\"font-weight: bold;\"><label>Assets Details</label></th>\n </tr>\n <tr *ngFor=\"let item of currentTimeFrameUserArray\">\n <td><label>{{ item.subject || '' }}</label></td>\n <td><label>{{ item.grade || '' }}</label></td>\n <td><label>{{ item.chapter || '' }}</label></td>\n <td [innerHTML]=\"item.tp || ''\"></td> <!-- Use innerHTML to handle HTML content -->\n <td [innerHTML]=\"item.details || ''\"></td> <!-- Assets Details column -->\n </tr>\n </tbody>\n </table>\n\n \n </div> \n </div>",
|
|
3312
|
+
styles: ["#pd-deatilViewContainer{position:absolute;background:#fff;box-shadow:0 0 17px #818181;font-size:12px;width:50%;max-height:350px;top:140px;left:230px}#pd-deatilViewContainer .pd-detailview-header{position:relative;width:100%;height:35px;background-color:#e6e6e6}#pd-deatilViewContainer .pd-detailview-title{position:absolute;margin-left:5px;font-size:20px;line-height:35px}#pd-deatilViewContainer #pd-closeButton{width:24px;position:absolute;float:right;right:0;cursor:pointer;height:24px;background:#000;border-radius:12px;color:#fff;line-height:22px;text-align:center;font-size:26px;transform:rotate(45deg);margin:5px}#pd-deatilViewContainer #pd-deatilViewTable{overflow:scroll;scroll-behavior:smooth;height:auto;margin:5px;max-height:300px}.newTablesContainer{overflow:scroll;height:310px;padding:3px;background:#fff;margin-bottom:2px}.dddd{color:#00f!important}"]
|
|
3313
|
+
},] }
|
|
3314
|
+
];
|
|
3315
|
+
SmallTableViewComponent.ctorParameters = function () { return [
|
|
3316
|
+
{ type: PrincipalDashboardLibV2Service }
|
|
3317
|
+
]; };
|
|
3318
|
+
SmallTableViewComponent.propDecorators = {
|
|
3319
|
+
data: [{ type: i0.Input }]
|
|
3320
|
+
};
|
|
3321
|
+
|
|
2911
3322
|
var PrincipalDashboardLibV2Module = /** @class */ (function () {
|
|
2912
3323
|
function PrincipalDashboardLibV2Module() {
|
|
2913
3324
|
}
|
|
@@ -2921,7 +3332,9 @@
|
|
|
2921
3332
|
DetailedviewComponent,
|
|
2922
3333
|
HeaderComponent,
|
|
2923
3334
|
TableviewComponent,
|
|
2924
|
-
PrincipalDashboardLibV2Component
|
|
3335
|
+
PrincipalDashboardLibV2Component,
|
|
3336
|
+
FullTableViewComponent,
|
|
3337
|
+
SmallTableViewComponent
|
|
2925
3338
|
],
|
|
2926
3339
|
imports: [
|
|
2927
3340
|
common.CommonModule,
|
|
@@ -2951,6 +3364,8 @@
|
|
|
2951
3364
|
exports.ɵd = HeaderComponent;
|
|
2952
3365
|
exports.ɵe = ExceldataService;
|
|
2953
3366
|
exports.ɵf = TableviewComponent;
|
|
3367
|
+
exports.ɵg = FullTableViewComponent;
|
|
3368
|
+
exports.ɵh = SmallTableViewComponent;
|
|
2954
3369
|
|
|
2955
3370
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2956
3371
|
|