principal-dashboard-lib-v2 0.0.30 → 0.0.32
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 +261 -9
- 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 +3 -1
- package/esm2015/lib/full-table-view/full-table-view.component.js +17 -7
- package/esm2015/lib/header/header.component.js +2 -1
- 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 +3 -1
- package/esm2015/lib/small-table-view/small-table-view.component.js +230 -0
- package/esm2015/principal-dashboard-lib-v2.js +2 -1
- package/fesm2015/principal-dashboard-lib-v2.js +254 -10
- package/fesm2015/principal-dashboard-lib-v2.js.map +1 -1
- 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 +1 -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);
|
|
@@ -868,7 +870,7 @@
|
|
|
868
870
|
PrincipalDashboardLibV2Component.decorators = [
|
|
869
871
|
{ type: i0.Component, args: [{
|
|
870
872
|
selector: 'lib-principal-dashboard-lib-v2',
|
|
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 ",
|
|
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 ",
|
|
872
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}"]
|
|
873
875
|
},] }
|
|
874
876
|
];
|
|
@@ -889,7 +891,7 @@
|
|
|
889
891
|
this.isChartView = true;
|
|
890
892
|
}
|
|
891
893
|
ChartheaderComponent.prototype.ngOnInit = function () {
|
|
892
|
-
this.libVersion = "0.0.
|
|
894
|
+
this.libVersion = "0.0.32";
|
|
893
895
|
// this.myIcon = document.getElementById('myIconImg');
|
|
894
896
|
// this.changeChatType()
|
|
895
897
|
};
|
|
@@ -1530,7 +1532,9 @@
|
|
|
1530
1532
|
else {
|
|
1531
1533
|
this.selectedUserData = this.pdService.dataForDetailedView(this.currentdataList.userConsoleData, this.resourceDataList, row);
|
|
1532
1534
|
}
|
|
1535
|
+
var smallData = [{ 'a': this.currentdataList, 'b': row }];
|
|
1533
1536
|
// console.log("this.selectedUserData",this.selectedUserData);
|
|
1537
|
+
this.pdService.openSmallTable.next(this.selectedUserData);
|
|
1534
1538
|
this.pdService.detailedviewData.next(this.selectedUserData);
|
|
1535
1539
|
this.updateChart();
|
|
1536
1540
|
// alluserList
|
|
@@ -2524,6 +2528,7 @@
|
|
|
2524
2528
|
this.getDateFormat(e);
|
|
2525
2529
|
this.mydata = null;
|
|
2526
2530
|
this.refreshChart();
|
|
2531
|
+
this.pdService.openSmallTable.next(false);
|
|
2527
2532
|
};
|
|
2528
2533
|
HeaderComponent.prototype.getDateFormat = function (date) {
|
|
2529
2534
|
var day = date.getDate();
|
|
@@ -2925,12 +2930,12 @@
|
|
|
2925
2930
|
var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
|
|
2926
2931
|
if (userConsoleResource && userConsoleResource.length > 0) {
|
|
2927
2932
|
userConsoleResource.forEach(function (userResource, userIndex) {
|
|
2928
|
-
var _a, _b, _c, _d;
|
|
2933
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2929
2934
|
var resourceId = userResource.resourceId;
|
|
2930
2935
|
var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
|
|
2931
2936
|
userResource.type === resource.type; });
|
|
2932
2937
|
var prefix = _this.getDisplayTypeValue(userResource.type);
|
|
2933
|
-
var title = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title;
|
|
2938
|
+
var title = (resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title) || '';
|
|
2934
2939
|
var tp = (_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title;
|
|
2935
2940
|
var subject = (_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title;
|
|
2936
2941
|
var chapter = (_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title;
|
|
@@ -2939,7 +2944,17 @@
|
|
|
2939
2944
|
var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
|
|
2940
2945
|
var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
|
|
2941
2946
|
var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
|
|
2942
|
-
duration = duration === 0 ? "<span style='colore:red;'>(Seen)</span>" :
|
|
2947
|
+
//duration = duration === 0 ? "<span style='colore:red;'>(Seen)</span>" : this.formatTime(duration);
|
|
2948
|
+
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'))) {
|
|
2949
|
+
duration = 0;
|
|
2950
|
+
}
|
|
2951
|
+
else {
|
|
2952
|
+
duration = duration === 0 ? "<span class='seenTag' style='color:blue;'>(Seen)</span>" : _this.formatTime(duration);
|
|
2953
|
+
}
|
|
2954
|
+
var finalAssetTitle = prefix + " : " + title + " : " + duration;
|
|
2955
|
+
if (title === '') {
|
|
2956
|
+
finalAssetTitle = prefix + " : " + duration;
|
|
2957
|
+
}
|
|
2943
2958
|
_this.currentUserArray.push({
|
|
2944
2959
|
userId: user.userId,
|
|
2945
2960
|
teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
|
|
@@ -2953,7 +2968,7 @@
|
|
|
2953
2968
|
subject: subject,
|
|
2954
2969
|
chapter: chapter,
|
|
2955
2970
|
grade: grade,
|
|
2956
|
-
details:
|
|
2971
|
+
details: finalAssetTitle,
|
|
2957
2972
|
});
|
|
2958
2973
|
});
|
|
2959
2974
|
}
|
|
@@ -3060,8 +3075,8 @@
|
|
|
3060
3075
|
FullTableViewComponent.decorators = [
|
|
3061
3076
|
{ type: i0.Component, args: [{
|
|
3062
3077
|
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>
|
|
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}.
|
|
3078
|
+
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 ",
|
|
3079
|
+
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}"]
|
|
3065
3080
|
},] }
|
|
3066
3081
|
];
|
|
3067
3082
|
FullTableViewComponent.ctorParameters = function () { return [
|
|
@@ -3071,6 +3086,241 @@
|
|
|
3071
3086
|
data: [{ type: i0.Input }]
|
|
3072
3087
|
};
|
|
3073
3088
|
|
|
3089
|
+
var SmallTableViewComponent = /** @class */ (function () {
|
|
3090
|
+
function SmallTableViewComponent(pdService) {
|
|
3091
|
+
this.pdService = pdService;
|
|
3092
|
+
this.currentTimeFrameUserArray = [];
|
|
3093
|
+
this.currentUserArray = [];
|
|
3094
|
+
this.remaningUsers = [];
|
|
3095
|
+
this.allUsers = [];
|
|
3096
|
+
this.usersCheckboxChecked = false;
|
|
3097
|
+
this.isDisplay = false;
|
|
3098
|
+
}
|
|
3099
|
+
Object.defineProperty(SmallTableViewComponent.prototype, "data", {
|
|
3100
|
+
set: function (res) {
|
|
3101
|
+
if (res !== null) {
|
|
3102
|
+
//console.log('smallTable',JSON.parse(res));
|
|
3103
|
+
this.jsonResponse = JSON.parse(res);
|
|
3104
|
+
}
|
|
3105
|
+
},
|
|
3106
|
+
enumerable: false,
|
|
3107
|
+
configurable: true
|
|
3108
|
+
});
|
|
3109
|
+
SmallTableViewComponent.prototype.ngOnInit = function () {
|
|
3110
|
+
var _this = this;
|
|
3111
|
+
this.pdService.openSmallTable$.subscribe(function (data) {
|
|
3112
|
+
if (data) {
|
|
3113
|
+
_this.isDisplay = true;
|
|
3114
|
+
var userid = _this.findUserIdByName(data['userDetails'][0]);
|
|
3115
|
+
var startTime = data['userDetails'][1];
|
|
3116
|
+
var endTime = data['userDetails'][3];
|
|
3117
|
+
_this.loadUserData(userid, startTime, endTime);
|
|
3118
|
+
}
|
|
3119
|
+
else {
|
|
3120
|
+
_this.isDisplay = false;
|
|
3121
|
+
}
|
|
3122
|
+
});
|
|
3123
|
+
};
|
|
3124
|
+
SmallTableViewComponent.prototype.findUserIdByName = function (name) {
|
|
3125
|
+
var json = this.jsonResponse;
|
|
3126
|
+
var user = json.usersMetadata.userMetadata.find(function (user) { return user.fullName === name; });
|
|
3127
|
+
return user ? user.userId : null;
|
|
3128
|
+
};
|
|
3129
|
+
SmallTableViewComponent.prototype.loadUserData = function (userId, inputStartTime, inputEndTime) {
|
|
3130
|
+
var _this = this;
|
|
3131
|
+
var json = this.jsonResponse;
|
|
3132
|
+
var usersConsole = json.usersConsole.userConsole;
|
|
3133
|
+
var usersMetadata = json.usersMetadata.userMetadata;
|
|
3134
|
+
var resourcesMetadata = json.resourcesMetadata.resourceMetadata;
|
|
3135
|
+
var filteredUsersConsole = userId
|
|
3136
|
+
? usersConsole.filter(function (user) { return user.userId === userId; })
|
|
3137
|
+
: usersConsole;
|
|
3138
|
+
filteredUsersConsole.forEach(function (user) {
|
|
3139
|
+
var _a;
|
|
3140
|
+
var userDetails = usersMetadata.find(function (userMeta) { return userMeta.userId === user.userId; });
|
|
3141
|
+
if (user === null || user === void 0 ? void 0 : user.userConsoleResources) {
|
|
3142
|
+
var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
|
|
3143
|
+
if (userConsoleResource && userConsoleResource.length > 0) {
|
|
3144
|
+
userConsoleResource.forEach(function (userResource, userIndex) {
|
|
3145
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3146
|
+
var resourceId = userResource.resourceId;
|
|
3147
|
+
var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
|
|
3148
|
+
userResource.type === resource.type; });
|
|
3149
|
+
var prefix = _this.getDisplayTypeValue(userResource.type);
|
|
3150
|
+
var title = (resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title) || '';
|
|
3151
|
+
var tp = (_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title;
|
|
3152
|
+
var subject = (_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title;
|
|
3153
|
+
var chapter = (_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title;
|
|
3154
|
+
var grade = (_d = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.grade) === null || _d === void 0 ? void 0 : _d.title;
|
|
3155
|
+
var startTime = new Date(user === null || user === void 0 ? void 0 : user.startTime);
|
|
3156
|
+
var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
|
|
3157
|
+
var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
|
|
3158
|
+
var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
|
|
3159
|
+
//duration = duration === 0 ? "<span class='dddd'>(Seen)</span>" : this.formatTime(duration);
|
|
3160
|
+
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'))) {
|
|
3161
|
+
duration = 0;
|
|
3162
|
+
}
|
|
3163
|
+
else {
|
|
3164
|
+
duration = duration === 0 ? "<span class='dddd'>(Seen)</span>" : _this.formatTime(duration);
|
|
3165
|
+
}
|
|
3166
|
+
var finalAssetTitle = prefix + " : " + title + " : " + duration;
|
|
3167
|
+
if (title === '') {
|
|
3168
|
+
finalAssetTitle = prefix + " : " + duration;
|
|
3169
|
+
}
|
|
3170
|
+
_this.currentUserArray.push({
|
|
3171
|
+
userId: user.userId,
|
|
3172
|
+
teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
|
|
3173
|
+
subjects: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.userSubjects : '',
|
|
3174
|
+
date: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.selectedDate : '',
|
|
3175
|
+
startTime: userIndex === 0 ? _this.formatDate(startTime) : _this.formatDate(startTime),
|
|
3176
|
+
endtime: userIndex === 0 ? _this.formatDate(endTime) : _this.formatDate(endTime),
|
|
3177
|
+
totalDuration: userIndex === 0 ? totalDuration : '',
|
|
3178
|
+
room: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.terminalIP : '',
|
|
3179
|
+
tp: tp,
|
|
3180
|
+
subject: subject,
|
|
3181
|
+
chapter: chapter,
|
|
3182
|
+
grade: grade,
|
|
3183
|
+
details: finalAssetTitle,
|
|
3184
|
+
});
|
|
3185
|
+
});
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
3189
|
+
var currentUserIds = this.currentUserArray
|
|
3190
|
+
.map(function (x) { return x.userId; })
|
|
3191
|
+
.filter(function (x, i, a) { return a.indexOf(x) === i; });
|
|
3192
|
+
this.remaningUsers = usersMetadata
|
|
3193
|
+
.filter(function (user) { return !currentUserIds.includes(user.userId); })
|
|
3194
|
+
.map(function (user) {
|
|
3195
|
+
return {
|
|
3196
|
+
userId: user.userId,
|
|
3197
|
+
teacherName: user === null || user === void 0 ? void 0 : user.fullName,
|
|
3198
|
+
subjects: user === null || user === void 0 ? void 0 : user.userSubjects,
|
|
3199
|
+
date: '',
|
|
3200
|
+
startTime: '',
|
|
3201
|
+
endtime: '',
|
|
3202
|
+
totalDuration: '0s',
|
|
3203
|
+
room: '',
|
|
3204
|
+
tp: '',
|
|
3205
|
+
subject: '',
|
|
3206
|
+
chapter: '',
|
|
3207
|
+
grade: '',
|
|
3208
|
+
details: '',
|
|
3209
|
+
};
|
|
3210
|
+
});
|
|
3211
|
+
this.allUsers = __spread(this.currentUserArray, this.remaningUsers);
|
|
3212
|
+
this.currentTimeFrameUserArray = this.filterDataByCriteria(this.currentUserArray, userId, inputStartTime, inputEndTime);
|
|
3213
|
+
//console.log('smallData', this.currentTimeFrameUserArray)
|
|
3214
|
+
};
|
|
3215
|
+
SmallTableViewComponent.prototype.filterDataByCriteria = function (userData, inputUserId, inputStartTime, inputEndTime) {
|
|
3216
|
+
var parseTime = function (timeString) {
|
|
3217
|
+
if (!timeString)
|
|
3218
|
+
return null;
|
|
3219
|
+
var _g = __read(timeString.split(' '), 2), time = _g[0], meridian = _g[1];
|
|
3220
|
+
var _h = __read(time.split(':').map(Number), 3), hours = _h[0], minutes = _h[1], seconds = _h[2];
|
|
3221
|
+
var isPM = meridian === 'PM';
|
|
3222
|
+
return new Date(0, 0, 0, isPM && hours < 12 ? hours + 12 : hours, minutes, seconds);
|
|
3223
|
+
};
|
|
3224
|
+
var startTime = parseTime(inputStartTime);
|
|
3225
|
+
var endTime = parseTime(inputEndTime);
|
|
3226
|
+
var filteredData = userData.filter(function (entry) {
|
|
3227
|
+
if (entry.userId !== inputUserId)
|
|
3228
|
+
return false;
|
|
3229
|
+
if (!entry.startTime || !entry.endtime)
|
|
3230
|
+
return false;
|
|
3231
|
+
var entryStart = parseTime(entry.startTime);
|
|
3232
|
+
var entryEnd = parseTime(entry.endtime);
|
|
3233
|
+
return entryStart && entryEnd && entryStart >= startTime && entryEnd <= endTime;
|
|
3234
|
+
});
|
|
3235
|
+
return filteredData.map(function (entry, index) { return (Object.assign(Object.assign({}, entry), { subsequentCount: index })); });
|
|
3236
|
+
};
|
|
3237
|
+
SmallTableViewComponent.prototype.getDisplayTypeValue = function (key) {
|
|
3238
|
+
var assetTypeConfig = [
|
|
3239
|
+
{ type: 'asset_media', display: 'Media' },
|
|
3240
|
+
{ type: 'asset_print', display: 'Print' },
|
|
3241
|
+
{ type: 'quiz', display: 'Quiz' },
|
|
3242
|
+
{ type: 'question', display: 'Question' },
|
|
3243
|
+
{ type: 'chapter', display: 'Chapter' },
|
|
3244
|
+
{ type: 'tp', display: 'Topic' },
|
|
3245
|
+
{ type: 'whiteboard', display: 'Whiteboard' },
|
|
3246
|
+
{ type: 'widget', display: 'Widget' },
|
|
3247
|
+
{ type: 'casset_media', display: 'cMedia' },
|
|
3248
|
+
{ type: 'casset_print', display: 'cPrint' },
|
|
3249
|
+
{ type: 'cquiz', display: 'cQuiz' },
|
|
3250
|
+
{ type: 'cquestion', display: 'cQuestion' },
|
|
3251
|
+
{ type: 'image', display: 'Image' },
|
|
3252
|
+
{ type: 'video', display: 'Video' },
|
|
3253
|
+
{ type: 'tools', display: 'Tools' },
|
|
3254
|
+
{ type: 'feature', display: 'Feature' },
|
|
3255
|
+
];
|
|
3256
|
+
var asset = assetTypeConfig.find(function (value) { return value.type === key; });
|
|
3257
|
+
return asset ? asset.display : key;
|
|
3258
|
+
};
|
|
3259
|
+
SmallTableViewComponent.prototype.formatDate = function (now) {
|
|
3260
|
+
var hours = now.getHours();
|
|
3261
|
+
var minutes = now.getMinutes();
|
|
3262
|
+
var seconds = now.getSeconds();
|
|
3263
|
+
var ampm = hours >= 12 ? 'PM' : 'AM';
|
|
3264
|
+
hours = hours % 12 || 12;
|
|
3265
|
+
return hours.toString().padStart(2, '0') + ":" + minutes
|
|
3266
|
+
.toString()
|
|
3267
|
+
.padStart(2, '0') + ":" + seconds.toString().padStart(2, '0') + " " + ampm;
|
|
3268
|
+
};
|
|
3269
|
+
SmallTableViewComponent.prototype.formatTime = function (seconds) {
|
|
3270
|
+
var days = Math.floor(seconds / 86400);
|
|
3271
|
+
var hours = Math.floor((seconds % 86400) / 3600);
|
|
3272
|
+
var minutes = Math.floor((seconds % 3600) / 60);
|
|
3273
|
+
var secs = seconds % 60;
|
|
3274
|
+
if (seconds < 60)
|
|
3275
|
+
return secs + "s";
|
|
3276
|
+
if (seconds < 3600)
|
|
3277
|
+
return minutes + "m " + secs + "s";
|
|
3278
|
+
if (seconds < 86400)
|
|
3279
|
+
return hours + "h " + minutes + "m " + secs + "s";
|
|
3280
|
+
return days + "d " + hours + "h " + minutes + "m " + secs + "s";
|
|
3281
|
+
};
|
|
3282
|
+
SmallTableViewComponent.prototype.loadTable = function (data) {
|
|
3283
|
+
/*
|
|
3284
|
+
const tableBody = document.querySelector("#teacherTable tbody");
|
|
3285
|
+
|
|
3286
|
+
data.forEach((item) => {
|
|
3287
|
+
const row = document.createElement("tr");
|
|
3288
|
+
for (const key in item) {
|
|
3289
|
+
const cell = document.createElement("td");
|
|
3290
|
+
cell.textContent = item[key];
|
|
3291
|
+
if (key !== "userId") {
|
|
3292
|
+
row.appendChild(cell);
|
|
3293
|
+
}
|
|
3294
|
+
}
|
|
3295
|
+
tableBody.appendChild(row);
|
|
3296
|
+
});*/
|
|
3297
|
+
};
|
|
3298
|
+
SmallTableViewComponent.prototype.toggleUsers = function () {
|
|
3299
|
+
this.usersCheckboxChecked = !this.usersCheckboxChecked;
|
|
3300
|
+
this.loadTable(this.usersCheckboxChecked
|
|
3301
|
+
? this.allUsers
|
|
3302
|
+
: this.currentUserArray);
|
|
3303
|
+
};
|
|
3304
|
+
SmallTableViewComponent.prototype.onCloseBtnClick = function () {
|
|
3305
|
+
this.isDisplay = false;
|
|
3306
|
+
//this.pdService.openSmallTable.next(false);
|
|
3307
|
+
};
|
|
3308
|
+
return SmallTableViewComponent;
|
|
3309
|
+
}());
|
|
3310
|
+
SmallTableViewComponent.decorators = [
|
|
3311
|
+
{ type: i0.Component, args: [{
|
|
3312
|
+
selector: 'lib-small-table-view',
|
|
3313
|
+
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>",
|
|
3314
|
+
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}"]
|
|
3315
|
+
},] }
|
|
3316
|
+
];
|
|
3317
|
+
SmallTableViewComponent.ctorParameters = function () { return [
|
|
3318
|
+
{ type: PrincipalDashboardLibV2Service }
|
|
3319
|
+
]; };
|
|
3320
|
+
SmallTableViewComponent.propDecorators = {
|
|
3321
|
+
data: [{ type: i0.Input }]
|
|
3322
|
+
};
|
|
3323
|
+
|
|
3074
3324
|
var PrincipalDashboardLibV2Module = /** @class */ (function () {
|
|
3075
3325
|
function PrincipalDashboardLibV2Module() {
|
|
3076
3326
|
}
|
|
@@ -3085,7 +3335,8 @@
|
|
|
3085
3335
|
HeaderComponent,
|
|
3086
3336
|
TableviewComponent,
|
|
3087
3337
|
PrincipalDashboardLibV2Component,
|
|
3088
|
-
FullTableViewComponent
|
|
3338
|
+
FullTableViewComponent,
|
|
3339
|
+
SmallTableViewComponent
|
|
3089
3340
|
],
|
|
3090
3341
|
imports: [
|
|
3091
3342
|
common.CommonModule,
|
|
@@ -3116,6 +3367,7 @@
|
|
|
3116
3367
|
exports.ɵe = ExceldataService;
|
|
3117
3368
|
exports.ɵf = TableviewComponent;
|
|
3118
3369
|
exports.ɵg = FullTableViewComponent;
|
|
3370
|
+
exports.ɵh = SmallTableViewComponent;
|
|
3119
3371
|
|
|
3120
3372
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3121
3373
|
|