Skip to content

Commit

Permalink
Merge pull request #43 from sujithsojan/release-4.8.17
Browse files Browse the repository at this point in the history
Survey popup changes
  • Loading branch information
vishnubansaltarento authored Sep 27, 2024
2 parents 3ec8270 + e3094b8 commit 80b5af3
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="main-survey flex items-center justify-center" *ngIf="isSurveyPopup">
<div class="surver-inner">
<a mat-icon-button class="close-button flex" (click)="closeCard()">
<mat-icon>close</mat-icon>
</a>
<a class="survey-img-link desktop-img" href={{surveyPopup?.surveyUrl}}>
<!-- <img class="survey-img" src={{surveyPopup?.banners[0]}} /> -->
<img i18n-alt alt="Page Banner" [src]="surveyPopup?.banners" wsUtilsImageResponsive class="banner-image-solo" />
</a>



</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
.main-survey {
background-color: rgba(0, 0, 0, 0.4);
height: 100vh;
width: 100%;
z-index: 9999;
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
margin: 0px;
padding: 0;
overflow: hidden;
}

.survey-img-link {
cursor: pointer;
width: 80%;
margin: auto;
background-color: transparent !important;
}
.close-button {
cursor: pointer;
vertical-align: top;
color: #000000;
font-size: 20px;
position: absolute;
top: 0px;
right: 0px;
margin-top: 40px;
margin-right: 40px;
background-color: #FFFFFF;
border-radius: 50%;
padding: 4px 4px;
}

.desktop-img {
display: flex !important;
@media screen and (max-width:768px) {
display: none !important;
}
}
.mobile-img-box {
display: none !important;
margin:auto;
@media (min-width: 476px) and (max-width: 768px) {
display: flex !important;
width: 45%;
}
@media screen and (max-width:475px) {
display: flex !important;
width: 85%;
}
}
.mobile-survey-link {
background-color: #F3962F;
text-align: center;
color: #fff !important;
width: 360px;
height: 32px;
border-radius: 16px;
margin-bottom: 16px;
line-height: 30px;

@media screen and (max-width:768px) {
width: 94%;
margin: auto;
}

}
.surver-inner {
padding:0;
width: 100%;
overflow: hidden;
}

.banner-image-solo {
width: 100%;
height: auto;
}

.mobile-banner-image-solo {
width: 100%;
height: auto;
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute } from '@angular/router'
import { ConfigurationsService } from '@sunbird-cb/utils'

@Component({
selector: 'ws-survey-form',
templateUrl: './survey-form.component.html',
styleUrls: ['./survey-form.component.scss'],
})
export class SurveyFormComponent implements OnInit {
surveyPopupData: any
surveyPopup: any
isSurveyPopup = true
widgetData: any
userRead: any
isTourDone: any
localStorageFlag: any
constructor(
private activatedRoute: ActivatedRoute,
private configSvc: ConfigurationsService,
) { }

ngOnInit() {
if (this.activatedRoute.snapshot.data.pageData && this.activatedRoute.snapshot.data.pageData.data) {
this.surveyPopupData = this.activatedRoute.snapshot.data.pageData.data.menus.surveyPopup.banners
this.surveyPopup = this.activatedRoute.snapshot.data.pageData.data.menus.surveyPopup
this.widgetData = this.activatedRoute.snapshot.data.pageData.data.menus.surveyPopup
}

this.userRead = this.configSvc.unMappedUser
if (this.userRead && this.userRead.profileDetails && this.userRead.profileDetails.get_started_tour) {
if (this.userRead.profileDetails.get_started_tour.skipped || this.userRead.profileDetails.get_started_tour.visited) {
this.isTourDone = true
} else {
this.isTourDone = false
}
}
const localFlag = localStorage.getItem('surveyPopup')
if (localFlag === 'true') {
this.localStorageFlag = true
} else if (localFlag === 'false') {
this.localStorageFlag = false
}
}

closeCard() {
this.isSurveyPopup = false
if (this.localStorageFlag) {
localStorage.setItem('surveyPopup', 'false')
this.localStorageFlag = false
}
}
}
5 changes: 4 additions & 1 deletion project/ws/app/src/lib/routes/home/home.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { PipeDurationTransformModule, PipeFilterModule, PipeHtmlTagRemovalModule, PipeOrderByModule, PipeRelativeTimeModule } from '@sunbird-cb/utils'
import { PipeDurationTransformModule, PipeFilterModule, PipeHtmlTagRemovalModule, PipeOrderByModule, PipeRelativeTimeModule, ImageResponsiveModule } from '@sunbird-cb/utils'
import { MatGridListModule } from '@angular/material/grid-list'
import { MatExpansionModule } from '@angular/material/expansion'
import { MatDividerModule } from '@angular/material/divider'
Expand Down Expand Up @@ -87,6 +87,7 @@ import { OdcsMappingComponent } from './routes/odcs-mapping/odcs-mapping.compone
import { environment } from '../../../../../../../src/environments/environment'
import { TaxonomyEditorModule } from '@sunbird-cb/taxonomy-editor'
import { MentorManageComponent } from './routes/mentor-manage/mentor-manage.component'
import { SurveyFormComponent } from './components/app-survey/survey-form/survey-form.component'

@NgModule({
declarations: [
Expand Down Expand Up @@ -134,6 +135,7 @@ import { MentorManageComponent } from './routes/mentor-manage/mentor-manage.comp
SingleAssignPopupComponent,
OdcsMappingComponent,
MentorManageComponent,
SurveyFormComponent,
],
imports: [
CommonModule,
Expand Down Expand Up @@ -192,6 +194,7 @@ import { MentorManageComponent } from './routes/mentor-manage/mentor-manage.comp
HttpClientModule,
DesignationModule,
TaxonomyEditorModule,
ImageResponsiveModule,
],
entryComponents: [
AdduserpopupComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<!-- <div *ngIf="currentRoute === 'home'" class="container-balanced-banner margin-top-s">
<ng-container [wsResolverWidget]="banner"></ng-container>
</div> -->
<ws-survey-form></ws-survey-form>

<mat-sidenav-container autosize name="discuss-menu" class="nav-container" name="exp">
<mat-sidenav [mode]="mode$ | async" [(opened)]="sideNavBarOpened" class="left-nav border-0">
Expand Down
6 changes: 6 additions & 0 deletions src/app/services/init.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ export class InitService {

private async fetchStartUpDetails(): Promise<any> {
// let userRoles: string[] = []
const checkSurvey = localStorage.getItem('surveyPopup')
if (checkSurvey && checkSurvey === 'false') {
localStorage.setItem('surveyPopup', 'false')
} else {
localStorage.setItem('surveyPopup', 'true')
}

if (this.configSvc.instanceConfig && !Boolean(this.configSvc.instanceConfig.disablePidCheck)) {
let completeProdata: any | null = null
Expand Down

0 comments on commit 80b5af3

Please sign in to comment.