Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not merge - Nulp prod branch #240

Open
wants to merge 1 commit into
base: release-4.4.1-learnathon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
{{ getTitle(contentType) }}
</a>
</ng-container>
<!-- <div>
<div>
<a
class="item item--event"
*ngIf="!isDesktopApp"
Expand All @@ -141,6 +141,6 @@
</span>
{{ resourceService.frmelmnts?.lbl?.LearnathonMenu }}
</a>
</div> -->
</div>
</div>
</ng-container>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- <div class="ui container px-60"> -->
<div class="sbt-page-content-area px-60">
<!-- <div [ngClass]="layoutConfiguration ? 'sbt-page-content-area' : 'ui container'"> -->
<div class="ui grid" *ngIf="noResult && tableData.length > 0">
<div class="ui grid" *ngIf="!noResult && tableData.length > 0">
<!-- <div class="twelve wide column">
<span
>Number of contents created:&nbsp;<b>{{ tableData.length }}</b></span
Expand Down Expand Up @@ -39,7 +39,7 @@
[resizableColumns]="true"
>
<ng-template pTemplate="caption">
<tr class="d-flex d-jc-space-between min-160">
<tr class="d-flex d-jc-space-between">
<td>
<div class="ui small left icon input align-left">
<i class="search icon"></i>
Expand All @@ -50,7 +50,6 @@
placeholder="Search"
(input)="dtOrg.filterGlobal($event.target.value, 'contains')"
style="width: auto"
class="inp-50"
/>
</div>
</td>
Expand Down Expand Up @@ -84,7 +83,7 @@
</ng-template>
<ng-template pTemplate="header" let-columns>
<tr>
<th *ngIf="this.pageName == 'upForVote'">Action</th>
<!-- <th *ngIf="this.pageName == 'upForVote'">Action</th> -->
<th
*ngFor="let col of columns"
pResizableColumn
Expand All @@ -100,25 +99,17 @@
ariaLabelAsc="Activate to sort in ascending order"
></p-sortIcon>
</th>
<!-- <th *ngIf="this.pageName == 'upForVote'">Action</th> -->
<th *ngIf="this.pageName == 'upForVote'">Action</th>
</tr>
<tr>
<th *ngIf="this.pageName == 'upForVote'">&nbsp;</th>
<th
*ngFor="let col of columns"
[ngSwitch]="col.field"
>

<!-- <p *ngIf="this.pageName == 'upForVote'">&nbsp;</p> -->
<!-- <p-multiSelect *ngSwitchCase="'UserName'" (onChange)="dtOrg.filter($event.value, col.field, 'in')" [options]="UserNameValues" defaultLabel="All"
appendTo="body"></p-multiSelect> -->
<!-- <p-multiSelect
*ngSwitchCase="'votes'"
(onChange)="dtOrg.filter($event.value, col.field, 'in')"
[options]=""
defaultLabel="All"
appendTo="body"
></p-multiSelect> -->
<p-multiSelect
<p-multiSelect
*ngSwitchCase="'category'"
(onChange)="dtOrg.filter($event.value, col.field, 'in')"
[options]="CategoryValues"
Expand All @@ -133,20 +124,11 @@
appendTo="body"
></p-multiSelect>
</th>
<!-- <th *ngIf="this.pageName == 'upForVote'"></th> -->
<th *ngIf="this.pageName == 'upForVote'"></th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-columns="columns">
<tr>
<td *ngIf="this.pageName == 'upForVote'">
<button
class="sb-btn sb-btn-normal sb-btn-primary"
(click)="giveVote(rowData)"
>
Check Content
</button>
<!-- &nbsp; -->
</td>
<td *ngFor="let col of columns" class="ui-resizable-column">
<!-- <button *ngIf="this.pageName == 'upForVote'"
class="sb-btn sb-btn-normal sb-btn-primary"
Expand All @@ -157,7 +139,15 @@
{{ rowData[col.field] }}
</td>


<td *ngIf="this.pageName == 'upForVote'">
<button
class="sb-btn sb-btn-normal sb-btn-primary"
(click)="giveVote(rowData)"
>
Vote Here
</button>
<!-- &nbsp; -->
</td>
</tr>
</ng-template>
</p-table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,4 @@

.v-align-bottom{
vertical-align: bottom;
}

@media screen and (max-width: 500px) {
.ui-table .ui-table-thead > tr > th {
padding: 0.571em 0.857em;
border: 1px solid #c8c8c8;
font-weight: 700;
color: #333333;
background-color: #f4f4f4;
width: 180px !important;
}
.px-60 {
padding-left: 1.75rem !important;
padding-right: 1.75rem !important;
}
.inp-50{
width: 120px !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
INoResultMessage,
ConfigService,
} from "@sunbird/shared";
import { HttpClient, HttpResponse,HttpParams } from "@angular/common/http";
import { HttpClient, HttpResponse } from "@angular/common/http";

// import { UUID } from 'angular2-uuid';
import { ActivatedRoute, Router } from "@angular/router";
Expand Down Expand Up @@ -94,7 +94,17 @@ export class learnathonDashboardComponent extends WorkSpace implements OnInit {
// this.layoutConfiguration = this.configService.appConfig.layoutConfiguration;
}
ngOnInit() {

this.https
.get(this.configService.urlConFig.URLS.FILE_READ)
.subscribe((data) => {
this.getAllContent();
this.votelist = data["result"].data;
},(err) => {
console.log(err);
this.getAllContent();
// this.toasterService.error(this.resourceService.messages.emsg.m0007);
});

this.activatedRoute.queryParams.subscribe((params) => {
this.queryParams = params;
if (this.pageName != undefined && this.pageName != this.queryParams) {
Expand All @@ -109,7 +119,7 @@ export class learnathonDashboardComponent extends WorkSpace implements OnInit {
}
this.cols = [];
this.initializeDateFields();
this.getAllContent();

// this.getOrgList();
this.getOrgDetails();
}
Expand Down Expand Up @@ -155,7 +165,7 @@ export class learnathonDashboardComponent extends WorkSpace implements OnInit {

contentType: ["Course", "Resource", "Collection"],
},
limit: 100,
limit: 50,
offset: (1 - 1) * 10,
};

Expand Down Expand Up @@ -207,20 +217,6 @@ export class learnathonDashboardComponent extends WorkSpace implements OnInit {
this.tableData = [];
let finalObj = [];
tempObj.forEach((element) => {
let queryParams = new HttpParams();
queryParams = queryParams.append("contentId",element.identifier);
this.https
.get(this.configService.urlConFig.URLS.FILE_READ,{params:queryParams} )
.subscribe((data) => {
element["votes"] = data["result"].count? data["result"].count:0;

this.votelist = data["result"].data;
},(err) => {
console.log(err);

// this.toasterService.error(this.resourceService.messages.emsg.m0007);
});

const options = {
url: this.configService.urlConFig.URLS.ADMIN.USER_SEARCH,
data: {
Expand Down Expand Up @@ -255,17 +251,17 @@ export class learnathonDashboardComponent extends WorkSpace implements OnInit {
label: element.UserName,
value: element.UserName,
});
// var count = 0;
// let tempData = JSON.stringify(this.votelist);
// if (tempData) {
// count = tempData.split(element.identifier).length - 1;
// element["votes"] = count;
var count = 0;
let tempData = JSON.stringify(this.votelist);
if (tempData) {
count = tempData.split(element.identifier).length - 1;
element["votes"] = count;

// } else {
// count = 0;
// }
} else {
count = 0;
}

// element["votes"] = count;
element["votes"] = count;
finalObj.push(element);
});
this.tableData = finalObj;
Expand Down Expand Up @@ -385,6 +381,14 @@ export class learnathonDashboardComponent extends WorkSpace implements OnInit {
{ field: "board", header: "Theme" },
{ field: "medium", header: "Sub-Theme" },

// { field: "name", header: "Name", width: "170px" },
// { field: "category", header: "Category", width: "170px" },
// { field: "subcategory", header: "Sub-Category", width: "170px" },
// { field: "city", header: "City", width: "170px" },
// { field: "institute", header: "Institute", width: "170px" },
// { field: "board", header: "Theme", width: "170px" },
// { field: "medium", header: "Sub-Theme", width: "170px" },
// { field: "votes", header: "Votes", width: "170px" },
];
}
}
Expand All @@ -397,6 +401,7 @@ export class learnathonDashboardComponent extends WorkSpace implements OnInit {
this.unsubscribe.complete();
}
giveVote(content) {
console.log("upForReview - ", content);
this.workSpaceService.navigateToContent(content, "upForReview");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[appTelemetryImpression]="telemetryImpression">
<!-- Filter for web version -->
<!-- `isFilterEnabled` reference from current page data -->
<div *ngIf="!isDesktopApp && isFilterEnabled" [ngClass]="FIRST_PANEL_LAYOUT" [hidden]="isSbmcourse">
<div *ngIf="!isDesktopApp && isFilterEnabled" [ngClass]="FIRST_PANEL_LAYOUT">
<app-search-filter [facets$]="facets$" [layoutConfiguration]="layoutConfiguration" [isOpen]='true' *ngIf="initFilter"
(filterChange)="getFilters($event)" [defaultTab]="defaultTab" [pageData]="getCurrentPageData()" [pageId]="isUserLoggedIn() ? 'resource-page' : 'explore-page'" [defaultFilters]="defaultFilters">
</app-search-filter>
Expand Down Expand Up @@ -137,9 +137,10 @@ <h4 class="sb-categories-title text-left mt-16" *ngIf="apiContentList.length">
<div class="sb-toaster sb-toast-warning sb-toast-normal">
<div class="sb-toast-body">
<div class="sb-toast-texts">
<div class="sb-toast-title">Learnathon Voting is live!</div>
<div class="sb-toast-title">Learnathon Participation</div>
<div class="sb-toast-message">
Voting is closed</div>
For Learnathon participation please register with new user account through <a class="text-white fs-15" target="_blank" href="learnathon.html">Learnathon</a> registration. <b>You should be logged out from this account before proceeding with new registration.</b>
For any further queries please reach out to us via <a class="text-white fs-15" href="https://helpdesknulp.niua.org" target="_blank">help desk</a>.</div>
</div>
<!-- <span class="sb-toast-close-icon"></span> -->
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ export class ExplorePageComponent implements OnInit, OnDestroy, AfterViewInit {
targetedCategorytheme:any;
showTargetedCategory:boolean=false;
selectedTab:any;
isSbmcourse = false;

get slideConfig() {
return cloneDeep(this.configService.appConfig.LibraryCourses.slideConfig);
}
Expand Down Expand Up @@ -219,7 +217,6 @@ export class ExplorePageComponent implements OnInit, OnDestroy, AfterViewInit {
this.selectedTab=queryParams.selectedTab;
this.showTargetedCategory=false;
this.getFormConfigs();
this.isSbmcourse = this.selectedTab === 'sbmcourse';
});
this.initConfiguration();

Expand Down Expand Up @@ -451,6 +448,7 @@ export class ExplorePageComponent implements OnInit, OnDestroy, AfterViewInit {
this.pageSections = [];
this.svgToDisplay = get(currentPageData, 'theme.imageName');
this.displayBanner = (_.get(currentPageData, 'contentType') === 'home') ? true : false;

this.redoLayout();
this.facetSections = [];
if (_.get(currentPageData, 'filter')) {
Expand All @@ -469,9 +467,6 @@ export class ExplorePageComponent implements OnInit, OnDestroy, AfterViewInit {
this.segmentationTagService.getUpdatedCommands().then(() => {
this.showorHideBanners();
});
} else if (_.get(currentPageData, 'contentType') === 'sbmcourse'){
// @Hack for SBM Courses Menu
_reqFilters = this.contentSearchService.mapCategories({ filters });
} else {
_reqFilters = this.contentSearchService.mapCategories({ filters: { ...this.selectedFilters, ...filters } });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,14 @@ export class OtpComponent implements OnInit {
googleCaptchaSiteKey: string;
isP2CaptchaEnabled: any;
redirecterrorMessage=false;
isSBM : boolean =false;

constructor(public resourceService: ResourceService, public signupService: SignupService,
public activatedRoute: ActivatedRoute, public telemetryService: TelemetryService,
public deviceDetectorService: DeviceDetectorService, public router: Router,
public utilService: UtilService, public configService: ConfigService, public addUserService: AddusserService) {
}

ngOnInit() {
if(window.location.href.includes("SBMRegistration")){
this.isSBM = true;
}
this.emailAddress = this.signUpdata.value.email;
this.phoneNumber = this.signUpdata.value.phone;
this.mode = this.signUpdata.controls.contactType.value;
Expand Down Expand Up @@ -111,7 +108,6 @@ resendOtpEnablePostTimer() {
(data: ServerResponse) => {
this.infoMessage = '';
this.errorMessage = '';
// console.log("data-----", _.get(data, 'reqData'))
this.createUser(data);
},
(err) => {
Expand Down Expand Up @@ -174,23 +170,12 @@ resendOtpEnablePostTimer() {
} else {
createRequest.request['email'] = this.signUpdata.controls.email.value;
createRequest.request['emailVerified'] = true;
if(this.isSBM == true){
createRequest.request['channel'] ='nulp-sbm',
createRequest.request['framework'] = {
"state":[this.signUpdata.controls.state.value],
"urbanLocalBody":[this.signUpdata.controls.urbanLocalBody.value],
"designation":[this.signUpdata.controls.designation.value],
"id": ['nulp-learn']
};
}

identifier = this.signUpdata.controls.email.value;
}
createRequest.request['reqData'] = _.get(data, 'reqData');


if (this.signUpdata.controls.tncAccepted.value && this.signUpdata.controls.tncAccepted.status === 'VALID') {
this.signupService.createUserV3(createRequest,this.isSBM).subscribe((resp: ServerResponse) => {

this.signupService.createUserV3(createRequest).subscribe((resp: ServerResponse) => {
this.telemetryLogEvents('sign-up', true);
const tncAcceptRequestBody = {
request: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,6 @@
</div>

<!-- =========learnathon ends================ -->

<!-- ========= sbm start================ -->
<div *ngIf="isSBM" class="sb-field required">
<label>{{resourceService.frmelmnts?.lbl?.sbmsatate}}<span class="sb-color-red">*</span></label>
<input placeholder="{{resourceService.frmelmnts?.lbl?.sbmsatate}}" formControlName="state" id="state" class="form-control, sb-search-input">
</div>
<div *ngIf="isSBM" class="sb-field required">
<label>{{resourceService.frmelmnts?.lbl?.sbmurbanLocalBody}}<span class="sb-color-red">*</span></label>
<input placeholder="{{resourceService.frmelmnts?.lbl?.sbmurbanLocalBody}}" formControlName="urbanLocalBody" id="urbanLocalBody" class="form-control, sb-search-input">
</div>
<div *ngIf="isSBM" class="sb-field required">
<label>{{resourceService.frmelmnts?.lbl?.sbmdesignation}}<span class="sb-color-red">*</span></label>
<input placeholder="{{resourceService.frmelmnts?.lbl?.sbmdesignation}}" formControlName="designation" id="designation" class="form-control, sb-search-input">
</div>
<!-- ========= sbm ends================ -->
<div class="sb-requirement-field mb-8 font-weight-bold">
{{resourceService.frmelmnts.lbl.fieldsmarked}}<span class="sb-error">*</span>{{resourceService.frmelmnts.lbl.mandatory }}
</div>
Expand Down
Loading