Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralized AWWA URL into a service #4047

Merged
merged 1 commit into from
Sep 11, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h5>{{ assessment.typeTitle || 'Blank Analysis' }}</h5>

<div *ngIf="isAwwa">
<p>
Results from the <a href="https://awwa.org/cyber" target="_blank">AWWA Cybersecurity Assessment Tool</a>
Results from the <a href="{{awwaSvc.url}}" target="_blank">AWWA Cybersecurity Assessment Tool</a>
can be imported into this assessment.
</p>
<button class="btn btn-primary" (click)="showAwwaDialog()">Import AWWA Tool Results</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h5>{{ assessment.typeTitle || 'Blank Assessment' }}</h5>

<div *ngIf="isAwwa">
<p>
Results from the <a href="https://awwa.org/cyber" target="_blank">AWWA Cybersecurity Assessment Tool</a>
Results from the <a href="{{awwaSvc.url}}" target="_blank">AWWA Cybersecurity Assessment Tool</a>
can be imported into this assessment.
</p>
<button class="btn btn-primary" (click)="showAwwaDialog()">Import AWWA Tool Results</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h5>{{ assessment.typeTitle || 'Blank Assessment' }}</h5>

<div *ngIf="isAwwa">
<p>
Results from the <a href="https://awwa.org/cyber" target="_blank">AWWA Cybersecurity Assessment Tool</a>
Results from the <a href="{{awwaSvc.url}}" target="_blank">AWWA Cybersecurity Assessment Tool</a>
can be imported into this assessment.
</p>
<button class="btn btn-primary" (click)="showAwwaDialog()">Import AWWA Tool Results</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { AssessmentService } from '../../../../services/assessment.service';
import { ConfigService } from '../../../../services/config.service';
import { NavigationService } from '../../../../services/navigation/navigation.service';
import { AwwaStandardComponent } from '../../standards/awwa-standard/awwa-standard.component';
import { AwwaService } from '../../../../services/awwa.service';


@Component({
Expand All @@ -52,6 +53,7 @@ export class AssessmentDetailComponent implements OnInit {
constructor(
private assessSvc: AssessmentService,
public navSvc: NavigationService,
public awwaSvc: AwwaService,
public configSvc: ConfigService,
public datePipe: DatePipe,
public dialog: MatDialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</td>
<td class="pl-3 py-2">
Clicking 'No' will take you to the AWWA site to complete the AWWA Cyber Tool sheet.
<a href='http://www.awwa.org/cyber' tabindex="0" target='_bank'>http://www.awwa.org/cyber</a>
<a href='{{awwaSvc.url}}' tabindex="0" target='_bank'>{{awwaSvc.url}}</a>
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import { Component, OnInit } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { FileUploadClientService } from '../../../../services/file-client.service';
import { AwwaService } from '../../../../services/awwa.service';

@Component({
selector: 'app-awwa-standard',
Expand All @@ -39,7 +40,8 @@ export class AwwaStandardComponent implements OnInit {

constructor(
public dialogRef: MatDialogRef<AwwaStandardComponent>,
public fileSvc: FileUploadClientService
public fileSvc: FileUploadClientService,
public awwaSvc: AwwaService
) { }

ngOnInit() {
Expand All @@ -50,7 +52,7 @@ export class AwwaStandardComponent implements OnInit {
*/
openAwwaSite() {
this.dialogRef.close();
window.open('http://www.awwa.org/cyber');
window.open(this.awwaSvc.url);
}

/**
Expand Down
22 changes: 22 additions & 0 deletions CSETWebNg/src/app/services/awwa.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Injectable } from '@angular/core';

/**
* A service to encapsulate anything specific to the American Water Works Association (AWWA)
*/
@Injectable({
providedIn: 'root'
})
export class AwwaService {


/**
* The callback URL to AWWA's webpage
*/
url = 'https://awwa.org/cybersecurity';


/**
*
*/
constructor() { }
}
Loading