Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ const routes: Routes = [
id: "help"
}
},
{
path: 'cms/alerts',
loadChildren: './cms/alerts/alerts.module#AlertsModule',
data: {
id: "alerts"
}
},
{
path: '*',
redirectTo: '/',
Expand Down
2 changes: 2 additions & 0 deletions src/app/cms/alerts/alert-filters/alert-filters.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<sds-filters [form]="form" [fields]="config" [model]="model" (filterChange)="filterChange$.next($event)"></sds-filters>

Empty file.
25 changes: 25 additions & 0 deletions src/app/cms/alerts/alert-filters/alert-filters.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AlertFiltersComponent } from './alert-filters.component';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AlertFiltersComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AlertFiltersComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
52 changes: 52 additions & 0 deletions src/app/cms/alerts/alert-filters/alert-filters.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { FormGroup } from '@angular/forms';
import { FormlyFieldConfig } from '@ngx-formly/core';


@Component({
selector: 'alert-filters',
templateUrl: './alert-filters.component.html',
styleUrls: ['./alert-filters.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AlertFiltersComponent implements OnInit {

constructor() { }
public model = {};

config: FormlyFieldConfig[] = [
{
key: 'keyword',
type: 'input',
templateOptions: {
label: 'Keyword',
}
},
{
key: 'status',
type: 'multicheckbox',
templateOptions: {
label: 'Status',
group: 'panel',
options: [
{
key: 'active',
value: 'Active'
},
{
key: 'inactive',
value: 'Inactive'
}
]
}
}
];

form = new FormGroup({});
public filterChange$ = new BehaviorSubject<object>(null);

ngOnInit() {
}

}
15 changes: 15 additions & 0 deletions src/app/cms/alerts/alert-filters/alert-filters.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AlertFiltersComponent } from './alert-filters.component';
import { SdsFiltersModule } from '@gsa-sam/sam-formly';


@NgModule({
declarations: [AlertFiltersComponent],
imports: [
CommonModule,
SdsFiltersModule
],
exports: [AlertFiltersComponent]
})
export class AlertFiltersModule { }
44 changes: 44 additions & 0 deletions src/app/cms/alerts/alert-item/alert-item.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<div class="grid-row grid-gap">
<div class="grid-col-fill">
<h3 class="font-sans-xs margin-y-0">
<a class="usa-link" [routerLink]="['/']">
{{model.type}} for {{model.requestedBy}}
</a>
</h3>
<p class="sds-static--label">
{{model.description}}
</p>
</div>
<div class="tablet:grid-col-4 grid-col-12">

<!-- Horizontal Config -->
<div class="grid-row grid-gap-05">

<!-- Key/Value Wrapper -->
<div class="tablet:grid-col-6 grid-col-4">
<div class="grid-row">
<div class="grid-col-12">
<div class="sds-static--label font-sans-3xs text-light text-italic">Status</div>
</div>
<div class="grid-col-12">
<span class="sds-tag sds-tag--outline">
<i class="sds-status sds-status--sm sds-status--green"></i>{{getLabel(model.status)}}</span>
</div>
</div>
</div>

<!-- Key/Value Wrapper -->
<div class="tablet:grid-col-6 grid-col-4">
<div class="grid-row">
<div class="grid-col-12">
<div class="sds-static--label font-sans-3xs text-light text-italic">Received Date</div>
</div>
<div class="grid-col-12">
<span class="sds-tag sds-tag--outline">{{ model.date | date }}</span>
</div>
</div>
</div>
</div>
</div>
</div>

Empty file.
25 changes: 25 additions & 0 deletions src/app/cms/alerts/alert-item/alert-item.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AlertItemComponent } from './alert-item.component';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AlertItemComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AlertItemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
31 changes: 31 additions & 0 deletions src/app/cms/alerts/alert-item/alert-item.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core';
import { AlertData, AlertStatus } from '../alert-service/alert.model';

@Component({
selector: 'alert-item',
templateUrl: './alert-item.component.html',
styleUrls: ['./alert-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AlertItemComponent implements OnInit {

@Input() model: AlertData

constructor() { }

ngOnInit() {
}

getLabel(type: AlertStatus): string {
switch(type) {
case AlertStatus.Active: {
return "Active";
}
case AlertStatus.Inactive: {
return "Inactive";
}
return "None";
}
}

}
14 changes: 14 additions & 0 deletions src/app/cms/alerts/alert-item/alert-item.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { AlertItemComponent } from './alert-item.component';

@NgModule({
declarations: [AlertItemComponent],
imports: [
CommonModule,
RouterModule
],
exports: [AlertItemComponent]
})
export class AlertItemModule { }
11 changes: 11 additions & 0 deletions src/app/cms/alerts/alert-service/alert-service.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

@NgModule({
declarations: [],
imports: [
CommonModule
],
exports: []
})
export class AlertServiceModule { }
37 changes: 37 additions & 0 deletions src/app/cms/alerts/alert-service/alert.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { AlertData, AlertStatus } from './alert.model';

export let Alerts: AlertData[] = [
{
"id" : "0000001",
"type" : "Assign Role",
"description" : "Entity Registration, Compliance Reporting Viewer for Tardegrade, LLC",
"date" : "Jun 12, 2019",
"requestedBy": "Amy Martinez",
"status" : AlertStatus.Active
},
{
"id" : "0000002",
"type" : "Assign Role",
"description" : "Entity Registration Data Entry for Tardegrade, LLC",
"date" : "Jun 12, 2019",
"requestedBy": "Amy Martinez",
"status" : AlertStatus.Inactive
},
{
"id" : "0000003",
"type" : "Assign Role",
"description" : "Viewer for Tardegrade, LLC",
"date" : "Jun 12, 2019",
"requestedBy" : "Amy Martinez",
"status" : AlertStatus.Active
},
{
"id" : "0000004",
"type" : "Assign Role",
"description" : "Viewer for Tardegrade, LLC",
"date" : "Jun 12, 2019",
"requestedBy" : "Amy Martinez",
"status" : AlertStatus.Inactive
}

];
14 changes: 14 additions & 0 deletions src/app/cms/alerts/alert-service/alert.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

export enum AlertStatus {
Active,
Inactive
}

export interface AlertData {
id: string;
type: string;
description: string;
date: string;
requestedBy: string;
status: AlertStatus;
}
12 changes: 12 additions & 0 deletions src/app/cms/alerts/alert-service/alert.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';

import { AlertService } from './alert.service';

describe('AlertService', () => {
beforeEach(() => TestBed.configureTestingModule({}));

it('should be created', () => {
const service: AlertService = TestBed.get(AlertService);
expect(service).toBeTruthy();
});
});
Loading