added backend integrations module

zohaib-huawei-q2
enadhilal 5 years ago
parent 671bd53ca1
commit 5e7f7a6c9c

@ -1,38 +1,39 @@
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
{
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'
},
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' },
{ path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' },
{ path: 'itemforsale', loadChildren: './itemforsale/itemforsale.module#ItemforsalePageModule' },
{ path: 'offersdiscount', loadChildren: './offersdiscount/offersdiscount.module#OffersdiscountPageModule' }, { path: 'backend-integrations', loadChildren: './backend-integrations/backend-integrations.module#BackendIntegrationsPageModule' }
const routes: Routes = [
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
{
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'
},
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' },
{ path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' },
{ path: 'itemforsale', loadChildren: './itemforsale/itemforsale.module#ItemforsalePageModule' },
{ path: 'offersdiscount', loadChildren: './offersdiscount/offersdiscount.module#OffersdiscountPageModule' }
];
@NgModule({
imports: [
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
RouterModule.forRoot(routes),
],
exports: [RouterModule]
})
export class AppRoutingModule { }
];
@NgModule({
imports: [
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
RouterModule.forRoot(routes),
],
exports: [RouterModule]
})
export class AppRoutingModule { }

@ -66,6 +66,17 @@
<ion-badge class="start-badge main-badge" slot="end" color="danger">{{notBadge}}</ion-badge>
</ion-label>
</ion-item>
<ion-item (click)="openAnnouncement()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 25px !important;" src="../assets/imgs/bell.png" item-left>
</ion-thumbnail>
<ion-label class="changepassword" >
{{ts.trPK('login','announcement')}}
<ion-badge class="start-badge main-badge" slot="end" color="danger">{{notBadge}}</ion-badge>
</ion-label>
</ion-item>
</ion-list>
@ -148,6 +159,16 @@
</ion-label>
</ion-item>
<ion-item (click)="openAnnouncement()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 25px !important;" src="../assets/imgs/ID_ico_menu.png" item-left>
</ion-thumbnail>
<ion-label class="changepassword" >
{{ts.trPK('login','announcement')}}
<ion-badge class="start-badge main-badge" slot="end" color="danger">{{notBadge}}</ion-badge>
</ion-label>
</ion-item>
<!-- <ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb">

@ -250,4 +250,9 @@ export class AppComponent implements OnInit {
} else {}
});
}
public openAnnouncement(){
this.cs.openAnnouncement();
this.menu.toggle();
}
}

@ -0,0 +1,52 @@
<app-generic-header
showBack="true"
[headerText]="'login,announcement' | translate">
</app-generic-header>
<ion-content>
<ion-searchbar (ionInput)="filterList($event)"></ion-searchbar>
<ion-list>
<div *ngFor="let item of arrList; let i = index">
<ion-card *ngIf="i === 0 && !item.isOpen" (click)="toggleAnnouncement(item)">
<img [src]="item.img" class="image-center">
<ion-item>
<ion-label>
<h2 class="text-style">{{item.title}}</h2>
<p class="text-style">{{item.body}}</p>
<p class="text-style">{{item.date}}</p>
</ion-label>
</ion-item>
</ion-card>
<ion-card *ngIf="i === 0 && item.isOpen" (click)="toggleAnnouncement(item)">
<ion-card-header style="background: transparent;">
<img [src]="item.img" class="image-center">
<ion-card-title>{{item.title}}</ion-card-title>
</ion-card-header>
<ion-card-content>
{{item.body}}<br>
{{item.date}}
</ion-card-content>
</ion-card>
<ion-item *ngIf="i > 0 && !item.isOpen" (click)="toggleAnnouncement(item)">
<img [src]="item.img" style="width: 30%;">
<ion-label style="margin: 5px;">
<h2>{{item.title}}</h2>
<p>{{item.body}}</p>
<p>{{item.date}}</p>
</ion-label>
</ion-item>
<ion-card *ngIf="i > 0 && item.isOpen" (click)="toggleAnnouncement(item)">
<img [src]="item.img" class="image-center">
<ion-label>
<h2 class="text-style">{{item.title}}</h2>
<p class="text-style">{{item.body}}</p>
<p class="text-style">{{item.date}}</p>
</ion-label>
</ion-card>
</div>
</ion-list>
</ion-content>

@ -0,0 +1,9 @@
.image-center{
width: 50%;
display: block;
margin-left: auto;
margin-right: auto;
}
.text-style{
margin: 5px;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AnnouncementComponent } from './announcement.component';
describe('AnnouncementComponent', () => {
let component: AnnouncementComponent;
let fixture: ComponentFixture<AnnouncementComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AnnouncementComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AnnouncementComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,60 @@
import { Component, OnInit } from '@angular/core';
import { detachEmbeddedView } from '@angular/core/src/view';
@Component({
selector: 'app-announcement',
templateUrl: './announcement.component.html',
styleUrls: ['./announcement.component.scss'],
})
export class AnnouncementComponent implements OnInit {
dt = new Date().toJSON().slice(0,10).replace(/-/g,'/');
public arr =[
{
title:"Basic Microsoft Excel Cource",
body:" is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
img:"../assets/imgs/HMG.png",
date: this.dt,
isopen: true
},
{
title:"External Visit",
body:"It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).",
img:"../assets/imgs/IDTOP.png",
date: this.dt,
isopen: false
},
{
title:"Maintenance Activity",
body:"The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from 'de Finibus Bonorum et Malorum' by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.",
img:"../assets/imgs/M.png",
date: this.dt,
isopen: false
},
];
public arrList = [];
constructor() { }
ngOnInit() {
this.arrList = this.arr;
}
filterList(event) {
const val = event.target.value;
if (val === '') {
this.arrList = this.arr;
}
this.arrList = this.arr.filter((item) => {
return (item.title.toLowerCase().indexOf(val.toLowerCase()) > -1);
});
}
toggleAnnouncement(item){
this.arrList.forEach(element => {
if(element.title === item.title){
element.isOpen = !element.isOpen;
}
});
}
}

@ -0,0 +1,36 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { BackendIntegrationsPage } from './backend-integrations.page';
import { AnnouncementComponent } from './announcement/announcement.component';
const routes: Routes = [
{
path: '',
component: BackendIntegrationsPage,
children: [
{
path: 'announcement',
component: AnnouncementComponent
}
]
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HmgCommonModule,
RouterModule.forChild(routes)
],
declarations: [BackendIntegrationsPage, AnnouncementComponent]
})
export class BackendIntegrationsPageModule {}

@ -0,0 +1,3 @@
<ion-content>
<ion-router-outlet></ion-router-outlet>
</ion-content>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BackendIntegrationsPage } from './backend-integrations.page';
describe('BackendIntegrationsPage', () => {
let component: BackendIntegrationsPage;
let fixture: ComponentFixture<BackendIntegrationsPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BackendIntegrationsPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BackendIntegrationsPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-backend-integrations',
templateUrl: './backend-integrations.page.html',
styleUrls: ['./backend-integrations.page.scss'],
})
export class BackendIntegrationsPage implements OnInit {
constructor() { }
ngOnInit() {
}
}

@ -1225,6 +1225,9 @@ public getMonthNameAr(value: number): string {
public eitUpdate() {
this.nav.navigateForward(['/eit/eit-update-list']);
}
public openAnnouncement() {
this.nav.navigateForward(['/backend-integrations/announcement']);
}

Loading…
Cancel
Save