Skip to content

Commit

Permalink
Added sidebar for Privacy page and tests to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyanshdwivedi authored and praveenojha33 committed Jan 14, 2019
1 parent 005e042 commit c2586a5
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 66 deletions.
71 changes: 60 additions & 11 deletions src/app/privacy/privacy.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
}
}

nav.navbar {
position: fixed;
width: 100%;
z-index: 10;
}

.bold {
font-weight: 700;
}
Expand Down Expand Up @@ -44,15 +50,13 @@
}

.link {
margin-top:2px;
margin-top:10px;
font-weight: 700;
line-height: 1.1;
color:#1565C0;
text-decoration: none;
}

.link:hover {
text-decoration: underline;
font-size: 20px;
padding-bottom: 20px;
padding-left: 40px;
}

#left {
Expand All @@ -61,8 +65,39 @@

#right {
width:67.7%;
padding: 20px;
margin-bottom: 60px;
margin-left: 50px;
}

.wrapper{
position: fixed;
overflow-y: scroll;
bottom: 0;
top: 75px;
bottom:40px;
width: inherit;
}

.sidebar-list{
display: block;
list-style: none;
}

.sidebar-list>li{
font-size: 18px;
height: 100%;
padding-bottom: 20px;
cursor: pointer;
max-width: 100%;
overflow-x: hidden;
}

.sidebar-list>li.active{
color: #609;
}

.sidebar-list>li>a{
color: inherit;
text-decoration: none;
}

p {
Expand All @@ -81,11 +116,25 @@ h2 {

#right {
width: 100%;
margin-left: 0px;
margin-top: 50px;
}

.sidebar-list{
display: none;
}

.wrapper{
position: relative;
}

.navbar-brand {
margin-left: -77px;
margin-top: -9px;
}

.navbar-brand {
margin-left: -77px;
margin-top: -9px;
.link {
padding-left: 0px;
}
}

Expand Down
164 changes: 112 additions & 52 deletions src/app/privacy/privacy.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,83 +25,143 @@
</div>
</nav>

<div class="container">
<div class="row">

<div id="left" class="col-lg-4 col-md-3 col-sm-12">
<br><br><br>
<h2>Privacy Policy</h2>
<div class="wrapper">
<h3 class="link">Privacy Policy</h3>
<ul class="sidebar-list">
<li class="element1 active">
<a (click)="scrollTo('element1')">
Welcome to susper!
</a>
</li><br>
<li class="element2">
<a (click)="scrollTo('element2')">
Information Collection and Use
</a>
</li><br>
<li class="element3">
<a (click)="scrollTo('element3')">
Log Data
</a>
</li><br>
<li class="element4">
<a (click)="scrollTo('element4')">
Cookies
</a>
</li><br>
<li class="element5">
<a (click)="scrollTo('element5')">
Service Providers
</a>
</li><br>
<li class="element6">
<a (click)="scrollTo('element6')">
Security
</a>
</li><br>
<li class="element7">
<a (click)="scrollTo('element7')">
Links to Other Sites
</a>
</li><br>
<li class="element8">
<a (click)="scrollTo('element8')">
Children’s Privacy
</a>
</li><br>
<li class="element9">
<a (click)="scrollTo('element9')">
Changes to this Privacy Policy
</a>
</li>
</ul>
</div>
</div>

<div id = "right" class ="col-lg-8 col-md-9 col-sm-12">
<br><br>
<h2>Welcome to susper!</h2>
<div id="element1">
<h2>Welcome to susper!</h2>

<p>Thanks for using our products and services (“Services”). The Services are provided by FOSSASIA community, located at 93 Mau Than, Can Tho City, Viet Nam.
<p>Thanks for using our products and services (“Services”). The Services are provided by FOSSASIA community, located at 93 Mau Than, Can Tho City, Viet Nam.
<br><br>
By using our Services, you are agreeing to the Privacy Policy. Please read them carefully.
</p>
<p> FOSSASIA built the susper.com app as an Open Source app. This SERVICE is provided by FOSSASIA at no cost and is intended for use as is.
</p>
<p>This page is used to inform website visitors regarding our policies with the collection, use, and
</p>
<p> FOSSASIA built the susper.com app as an Open Source app. This SERVICE is provided by FOSSASIA at no cost and is intended for use as is.
</p>
<p>This page is used to inform website visitors regarding our policies with the collection, use, and
disclosure of Personal Information if anyone decided to use our Service.
</p>
<p>If you choose to use our Service, then you agree to the collection and use of information in relation
</p>
<p>If you choose to use our Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that we collect is used for providing and improving the
Service. We will not use or share your information with anyone except as described
in this Privacy Policy.
</p>
<p>The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at susper unless otherwise defined in this Privacy Policy.
</p>
</p>
<p>The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at susper unless otherwise defined in this Privacy Policy.
</p>
</div>

<h2>Information Collection and Use</h2>
<div id="element2">
<h2>Information Collection and Use</h2>

<p>For a better experience, while using our Service, we may require you to provide us with certain personally identifiable information. The information that we request is will be retained by us and used as described in this privacy policy.
</p>

<h2>Log Data</h2>
<p>For a better experience, while using our Service, we may require you to provide us with certain personally identifiable information. The information that we request is will be retained by us and used as described in this privacy policy.
</p>
</div>

<p> We want to inform you that whenever you use our Service, in a case of an error in the app we collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address,device name, operating system version, the configuration of the app when utilizing our Service,the time and date of your use of the Service and other statistics.
</p>
<div id="element3">
<h2>Log Data</h2>

<h2>Cookies</h2>
<p> We want to inform you that whenever you use our Service, in a case of an error in the app we collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address,device name, operating system version, the configuration of the app when utilizing our Service,the time and date of your use of the Service and other statistics.
</p>
</div>

<p>Cookies are files with small amount of data that is commonly used an anonymous unique identifier. These
<div id="element4">
<h2>Cookies</h2>
<p>Cookies are files with small amount of data that is commonly used an anonymous unique identifier. These
are sent to your browser from the website that you visit and are stored on your device internal memory.
</p>
<p>This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collection information and to improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
</p>

<h2>Service Providers</h2>

<p> We may employ third-party companies and individuals due to the following reasons:</p>
<ul><li>To facilitate our Service;</li>
<li>To provide the Service on our behalf;</li>
<li>To perform Service-related services; or</li>
<li>To assist us in analyzing how our Service is used.</li>
</ul>
<p> We want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
</p>

<h2>Security</h2>

<p> We value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and we cannot guarantee its absolute security.
</p>

<h2>Links to Other Sites</h2>
</p>
<p>This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collection information and to improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
</p>
</div>

<p>This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by us. Therefore, we strongly advise you to review the Privacy Policy of these websites. We have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
</p>
<div id="element5">
<h2>Service Providers</h2>
<p> We may employ third-party companies and individuals due to the following reasons:</p>
<ul><li>To facilitate our Service;</li>
<li>To provide the Service on our behalf;</li>
<li>To perform Service-related services; or</li>
<li>To assist us in analyzing how our Service is used.</li>
</ul>
<p> We want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
</p>
</div>

<h2>Children’s Privacy</h2>
<div id="element6">
<h2>Security</h2>
<p> We value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and we cannot guarantee its absolute security.
</p>
</div>

<p>These Services do not address anyone under the age of 13. We do not knowingly collect personally identifiable information from children under 13. In the case we discover that a child under 13 has provided us with personal information, we immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact us so that we will be able to do necessary actions.
</p>
<div id="element7">
<h2>Links to Other Sites</h2>
<p>This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by us. Therefore, we strongly advise you to review the Privacy Policy of these websites. We have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
</p>
</div>

<h2>Changes to this Privacy Policy</h2>
<div id="element8">
<h2>Children’s Privacy</h2>

<p> We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page.
<p>These Services do not address anyone under the age of 13. We do not knowingly collect personally identifiable information from children under 13. In the case we discover that a child under 13 has provided us with personal information, we immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact us so that we will be able to do necessary actions.
</p>
</div>

</p>
<div id="element9">
<h2>Changes to this Privacy Policy</h2>
<p> We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page.
</p>
</div>

<h2>Contact Us</h2>

Expand Down
54 changes: 51 additions & 3 deletions src/app/privacy/privacy.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { async, ComponentFixture, TestBed, tick } from '@angular/core/testing';
import { Component, Input, Output } from '@angular/core';
import { RouterTestingModule } from '@angular/router/testing';
import { By } from '@angular/platform-browser';

/**
* import 'FormsModule' to avoid
Expand Down Expand Up @@ -40,9 +41,56 @@ describe('Component: Privacy', () => {
expect(privacy).toBeTruthy();
});

it('should have an app-footer-navbar element', () => {
const compiled = fixture.debugElement.nativeElement;
it('should have alt text property as brand', () => {
let compiled = fixture.debugElement.nativeElement;

let image: HTMLImageElement = compiled.querySelector('div.navbar-header img');
expect(image).toBeTruthy();
expect(image.alt).toBe('brand');
});

it('should have a div with id left', () => {
let compiled = fixture.debugElement.nativeElement;

expect(compiled.querySelector('div#left'));
});

it('should have a div with id right', () => {
let compiled = fixture.debugElement.nativeElement;

expect(compiled.querySelector('div#right'));
});

it('should have a sidebar menu', () => {
let compiled = fixture.debugElement.nativeElement;

expect(compiled.querySelector('ul.sidebar-list'));
});

it('should have an active list on sidebar menu', () => {
let compiled = fixture.debugElement.nativeElement;

expect(compiled.querySelector('ul.sidebar-list li.active'));
});

it('should create a FooterNavbar Component', () => {
const footerNavbar = new FooterNavbarComponent();
expect(footerNavbar).toBeTruthy();
});

it('should have an app-footer-navbar element', () => {
let compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('app-footer-navbar')).toBeTruthy();
});

it('should scroll', async(() => {
let compiled = fixture.debugElement.nativeElement;
const element = compiled.querySelector('li.element4 a');

element.click();
fixture.whenStable().then(() => {
expect(compiled.querySelector('li.element4.active')).toBeTruthy();
});
}));

});
14 changes: 14 additions & 0 deletions src/app/privacy/privacy.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,18 @@ export class PrivacyComponent implements OnInit {

ngOnInit() {
}

scrollTo(el) {
let element = document.getElementById(el);
document.getElementsByClassName('active')[0].classList.remove('active');
document.getElementsByClassName(el)[0].classList.add('active');
const headerOffset = 25;
const elementPosition = element.offsetTop;
const offsetPosition = elementPosition - headerOffset;

window.scrollTo({
top: offsetPosition,
behavior: 'smooth'
});
}
}

0 comments on commit c2586a5

Please sign in to comment.