Skip to content

Commit

Permalink
Merge pull request #15 from ssysm/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
ssysm authored Feb 10, 2018
2 parents 6d66c52 + c7cf8e9 commit 2ceea20
Show file tree
Hide file tree
Showing 71 changed files with 306 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ typings/
/server/public/work/*.jpg
/server/public/work/*.pdf

/server/etc/cucuImg/*.jpg

*.key
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starrysea-client",
"version": "1.0.6",
"version": "1.0.7",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {UserManagementComponent} from "./view/admin/user-management/user-managem
import {ActivityManagementComponent} from "./view/admin/activity-management/activity-management.component";
import {WorkManagementComponent} from "./view/admin/work-management/work-management.component";
import {AuthComponent} from "./view/admin/auth/auth.component";
import {AdminGuardService} from "./common/admin-guard.service";
import {AdminGuardService} from "./common/guard/admin-guard.service";
import {QaComponent} from "./view/qa/qa.component";

const routes: Routes = [
Expand Down
7 changes: 6 additions & 1 deletion client/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--Application Navbar-->
<app-navbar></app-navbar>
<router-outlet></router-outlet>
<!--Routing Entry-->
<main [@routeAnimation]="getRouteAnimation(o)">
<router-outlet #o="outlet"></router-outlet>
</main>
<!--Application Footer-->
<app-footer></app-footer>
11 changes: 9 additions & 2 deletions client/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {Component, OnInit} from '@angular/core';
import {Component, OnInit,HostBinding, ViewChild} from '@angular/core';
import {routeAnimation} from "./common/animation";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.css'],
animations:[routeAnimation]
})
export class AppComponent implements OnInit{

Expand All @@ -15,4 +17,9 @@ export class AppComponent implements OnInit{
ngOnInit(){
this.loaded = true;
}

public getRouteAnimation(outlet) {
return outlet.isActivated ? outlet.activatedRoute : '';
}

}
6 changes: 5 additions & 1 deletion client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {HttpModule, BrowserXhr} from "@angular/http";
import {cros} from "./common/cros";
import { FooterComponent } from './view/partical/footer/footer.component';
import {AdminGuardService} from "./common/admin-guard.service";
import {AdminGuardService} from "./common/guard/admin-guard.service";
import { AuthComponent } from './view/admin/auth/auth.component';
import {AuthService} from "./service/auth.service";
import {FileInputAccessorModule} from "file-input-accessor";
Expand All @@ -36,6 +36,8 @@ import { QaComponent } from './view/qa/qa.component';
import { QaService } from './service/qa.service';
import { QaManagementComponent } from './view/admin/qa-management/qa-management.component';
import { TextSlicePipe } from './common/pipe/text-slice.pipe';
import { SpinnerComponent } from './view/partical/spinner/spinner.component';
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";


@NgModule({
Expand All @@ -59,13 +61,15 @@ import { TextSlicePipe } from './common/pipe/text-slice.pipe';
QaComponent,
QaManagementComponent,
TextSlicePipe,
SpinnerComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
ReactiveFormsModule,
FormsModule,
HttpModule,
BrowserAnimationsModule,
ServiceWorkerModule.register('/ngsw-worker.js', {enabled: environment.production})
],
providers: [
Expand Down
1 change: 1 addition & 0 deletions client/src/app/common/animation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './route.animation';
51 changes: 51 additions & 0 deletions client/src/app/common/animation/route.animation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {trigger, animate, transition, style, query, group, keyframes} from '@angular/animations';

export const routeAnimation = trigger('routeAnimation', [
transition('* <=> *', [
query(':enter, :leave', style({
position: 'fixed',
width: '100%'
})
, {
optional: true
}),
group([ // block executes in parallel
query(':enter', [
animate(300, keyframes([
style({
opacity: 0,
display:'none'
}),
style({
opacity: 0.5,
display:'none'
}),
style({
opacity: 1,
display:'block'
})
])),
], {
optional: true
}),
query(':leave', [
animate(300, keyframes([
style({
opacity: 1,
display:'none'
}),
style({
opacity: 0.5,
display:'none'
}),
style({
opacity: 0,
display:'none'
})
]))
], {
optional: true
}),
])
])
]);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import {AuthService} from "../service/auth.service";
import {AuthService} from "../../service/auth.service";
import {ActivatedRouteSnapshot, Router, RouterStateSnapshot} from "@angular/router";
import {Observable} from "rxjs/Observable";

Expand Down
4 changes: 2 additions & 2 deletions client/src/app/view/about/about.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ <h1 class="text-center introh1 h1">About Us</h1>
<div class="col-md-6 col-sm-12">
<p class="h5">Latest System Releases: <span class="badge badge-success">{{Version}}</span></p>
<div style="display: inline">
<p style="display: inline">Front-End: <span class="badge badge-success">v1.0.6</span></p>
<p style="display: inline">Back-End: <span class="badge badge-success">v1.0.6</span></p>
<p style="display: inline">Front-End: <span class="badge badge-success">v1.0.7</span></p>
<p style="display: inline">Back-End: <span class="badge badge-success">v1.0.7</span></p>
<p>Latest Commit: <span class="badge badge-info">{{commit}}</span></p>
</div>
</div>
Expand Down
19 changes: 16 additions & 3 deletions client/src/app/view/about/about.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AboutComponent } from './about.component';
import {VersionService} from "../../service/version.service";
import {HttpModule} from "@angular/http";
import {By} from "@angular/platform-browser";

describe('AboutComponent', () => {
let component: AboutComponent;
let fixture: ComponentFixture<AboutComponent>;

let compiled:any;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AboutComponent ],
Expand All @@ -21,9 +22,21 @@ describe('AboutComponent', () => {
fixture = TestBed.createComponent(AboutComponent);
component = fixture.componentInstance;
fixture.detectChanges();
compiled = fixture.debugElement.nativeElement;
});

it('should create', () => {
it('should create', async() => {
expect(component).toBeTruthy();
});
it('should have a About Us Title',()=>{
expect(compiled.querySelector('.introh1').textContent).toContain('About Us');
});
it('should have a blockquote',()=>{
expect(compiled.querySelector('.blockquote')).toBeTruthy();
});
it('should have system info',()=>{
expect(compiled.querySelector('#sysInfo')).toBeTruthy();
});
it('should have a qa entry',()=>{
expect(compiled.querySelector('.qBox')).toBeTruthy();
})
});
4 changes: 3 additions & 1 deletion client/src/app/view/about/about.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Component, OnInit } from '@angular/core';
import {VersionService} from "../../service/version.service";
import {Meta,Title} from "@angular/platform-browser";
import {routeAnimation} from "../../common/animation";

@Component({
selector: 'app-about',
templateUrl: './about.component.html',
styleUrls: ['./about.component.css']
styleUrls: ['./about.component.css'],
animations: [routeAnimation],
})
export class AboutComponent implements OnInit {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
</div>
</div>
</div>
<app-spinner *ngIf="!fundArr&&!activityData"></app-spinner>
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import {ActivityService} from "../../service/activity.service";
import {HttpModule} from "@angular/http";
import {FundingService} from "../../service/funding.service";
import {RouterTestingModule} from "@angular/router/testing";
import {SpinnerComponent} from "../partical/spinner/spinner.component";

describe('ActivityDetailComponent', () => {
let component: ActivityDetailComponent;
let fixture: ComponentFixture<ActivityDetailComponent>;

let compiled: any;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ActivityDetailComponent ],
declarations: [ ActivityDetailComponent,SpinnerComponent ],
providers:[ActivityService,FundingService],
imports:[HttpModule,RouterTestingModule]
})
Expand All @@ -22,6 +23,7 @@ describe('ActivityDetailComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(ActivityDetailComponent);
component = fixture.componentInstance;
compiled = fixture.debugElement.nativeElement;
fixture.detectChanges();
});

Expand Down
3 changes: 2 additions & 1 deletion client/src/app/view/activity/activity.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container">
<div class="title">
<h2 class="h1">Activities</h2>
<h2 class="h2">Activities</h2>
</div>
<div class="activity" *ngIf="activityArr">
<div class="col-sm-12" *ngFor="let activity of activityArr">
Expand All @@ -17,4 +17,5 @@ <h2 class="h1">Activities</h2>
<hr>
</div>
</div>
<app-spinner *ngIf="!activityArr"></app-spinner>
</div>
8 changes: 7 additions & 1 deletion client/src/app/view/activity/activity.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { ActivityComponent } from './activity.component';
import {ActivityService} from "../../service/activity.service";
import {HttpModule} from "@angular/http";
import {RouterTestingModule} from "@angular/router/testing";
import {SpinnerComponent} from "../partical/spinner/spinner.component";

describe('ActivityComponent', () => {
let component: ActivityComponent;
let fixture: ComponentFixture<ActivityComponent>;
let compiled:any;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ActivityComponent ],
declarations: [ ActivityComponent,SpinnerComponent ],
imports:[HttpModule,RouterTestingModule],
providers:[ActivityService]
})
Expand All @@ -22,9 +24,13 @@ describe('ActivityComponent', () => {
fixture = TestBed.createComponent(ActivityComponent);
component = fixture.componentInstance;
fixture.detectChanges();
compiled = fixture.debugElement.nativeElement;
});

it('should create', () => {
expect(component).toBeTruthy();
});
it('should have Activities Title',()=>{
expect(compiled.querySelector('.h2').textContent).toContain('Activities')
});
});
3 changes: 1 addition & 2 deletions client/src/app/view/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
</div>
<div class="intro">
<h1 class="lead text-center title">
<small style="color:#fff">We Are</small>
Starry Sea Volunteers Association
<small style="color:#fff">We Are</small> Starry Sea Volunteers Association
</h1>
<div style="width: 100%;height: 20vh;"></div>
<h2 class="lead text-center title2">Dedicated to delivering the best of LoveLive Sunshine<br>Aqours events related support</h2>
Expand Down
19 changes: 18 additions & 1 deletion client/src/app/view/home/home.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {RouterTestingModule} from "@angular/router/testing";
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;

let compiled : any;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HomeComponent ],
Expand All @@ -18,10 +18,27 @@ describe('HomeComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
compiled = fixture.debugElement.nativeElement;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
it('should have a bg image',()=>{
expect(compiled.querySelector('.aq-bg')).toBeTruthy();
});
it('should have an intro title',()=>{
expect(compiled.querySelector('.title').textContent).toContain('We Are Starry Sea Volunteers Association')
});
it('should have a intro image',()=>{
expect(compiled.querySelector('.img-center').src).toContain('/assets/img/TOW.png')
});
it('should have a about text',()=>{
expect(compiled.querySelector('.about')).toBeTruthy();
});
it('should have a button that go to about page',()=>{
expect(compiled.querySelector('.btn').href).toContain('/about');
})

});
3 changes: 1 addition & 2 deletions client/src/app/view/partical/footer/footer.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px;
/* Vertically center the text there */
background-color: #f5f5f5;
background: #f0f0f0;
}
2 changes: 1 addition & 1 deletion client/src/app/view/partical/footer/footer.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<footer class="footer">
<div class="container">
<span class="text-center text-muted">&copy;2018-2019 StarrySea</span>
<span class="text-center text-dark">&copy;2018-2019 StarrySea</span>
</div>
</footer>
6 changes: 5 additions & 1 deletion client/src/app/view/partical/footer/footer.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FooterComponent } from './footer.component';
describe('FooterComponent', () => {
let component: FooterComponent;
let fixture: ComponentFixture<FooterComponent>;

let compiled: any;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FooterComponent ]
Expand All @@ -16,10 +16,14 @@ describe('FooterComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(FooterComponent);
component = fixture.componentInstance;
compiled = fixture.debugElement.nativeElement;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
it('should create copyright text',()=>{
expect(compiled.querySelector('.text-center').textContent).toBe('©2018-2019 StarrySea');
});
});
Loading

0 comments on commit 2ceea20

Please sign in to comment.