forked from sunbird-cb/sunbird-cb-orgportal
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from sujithsojan/release-4.8.17
Survey popup changes
- Loading branch information
Showing
6 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...t/ws/app/src/lib/routes/home/components/app-survey/survey-form/survey-form.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
88 changes: 88 additions & 0 deletions
88
...t/ws/app/src/lib/routes/home/components/app-survey/survey-form/survey-form.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
|
||
|
53 changes: 53 additions & 0 deletions
53
...ect/ws/app/src/lib/routes/home/components/app-survey/survey-form/survey-form.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters