Giter Site home page Giter Site logo

gsa / gear3 Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 13.75 MB

Next Iteration of the GSA Enterprise Architecture Reporting (GEAR) Portal

JavaScript 24.03% TypeScript 20.50% CSS 7.91% HTML 11.59% Python 1.21% Less 11.90% SCSS 13.17% PowerShell 0.03% Jupyter Notebook 6.08% Go 3.57%

gear3's Introduction

Gear3

This project was generated with Angular CLI version 9.1.5.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Website Screenshots

Website screenshots are not managed in version control. Instead, copy images into working directory. Copy files into assets/website-screenshots directory. Script creates destination directory, searches the root websites-screenshots folder for all .webp images, and sends them to src/assets/website-screenshots

mkdir src/assets/website-screenshots && find website-screenshots -type f -name "*.webp" -exec cp {} src/assets/website-screenshots \;

Converting Images

In order to keep the image filesize small, all PNGs get converted to WEBP. The following converts a given folder and all .png to .webp. Outputs will land in the folder from which it was run. sharp-cli

npx sharp-cli -f webp --input "*.png" -o .

Creating New Views and Detail Modals

This assumes APIs have been created in express already

Scaffold Components

Create View Component

Navigate to parent folder for the view (in this case, enterperise)

cd src/app/views/enterprise
ng generate component myComponent

Create Modal Component

Navigate to modals folder

cd src/app/components/modals
ng generate component myComponent-modal

Add component reference to Modal Service (modals.service.ts)

private myComponentSource = new Subject();
currentMyComponent = this.myComponentSource.asObservable();

Add component to updateDetails method

 else if (component == 'myComponent') {
   this.myComponentSource.next(row);
 }

Additional Updates

Application Plumbing

  • Update App Routing (app-routing.module.ts)
    • Add the View component as an import in app-routing.module.ts
      • import {myComponent} from './views/enterprise/myComponentName.myComponent.component';
    • Create objects in the routes array to serve the View at URL paths
      • { path: 'myComponentPath', component: myComponent},
      • { path: 'myComponentPath/:myComponentId', component: myComponent},
  • Update App Module (app.module.ts)
    • Import View and Modal components
      • import { myComponent} from './views/enterprise/serviceCategory/serviceCategory.component';
      • import { myComponent-modal } from './components/modals/myComponent-modal/service-category-modal.component';
    • Add imported modules to @NgModule({declarations:[]}

Table Service

  • Add public method to handle row click
public myComponentTableClick(data: any, addRoute: boolean=true) {
  var options: ClickOptions = {
    data: data,
    dataID: 'id', // data attribute to use in URL 
    update: 'myComponent', // corresponds to value in modals service component
    detailModalID: '#myComponentDetail', // corresponds to the div id in the modal component
    sysTableID: '',
    exportName: data.Name + '',
    systemApiStr: '/api/myComponent/get/',  // corresponding api path
    addRoute: addRoute
  };
  this.clickMethod(options);    
}

Navigation

  • Open sidenav.component.html and add link pointing at the route established earlier
    • <a routerLink="/myComponentPath" >My Component List</a>

API Connection

  • Update API Service (api.service.ts)
    • import { myComponent } from '@api/models/myComponent.model';
    • add new API path to ApiService class as an attribute
      • myComponentUrl: string = this.sharedService.internalURLFmt('api/myComponent');
    • Add new publicly available methods for each API operation
    public getMyComponent(): Observable<MyComponent[]> {
      return this.http.get<MyComponent[]>(this.myComponentUrl).pipe(
        catchError(this.handleError<MyComponent[]>('GET MyComponent', []))
      );
    };
    public getOneMyComponent(id: number): Observable<MyComponent[]> {
      return this.http.get<MyComponent[]>(this.myComponentUrl + '/get/' + String(id)).pipe(
        catchError(this.handleError<MyComponent[]>('GET One MyComponent ', []))
      );
    };

gear3's People

Contributors

dependabot[bot] avatar hatfieldjm4 avatar isaiahsayalee avatar joshsjurik avatar khgsa avatar kinggsagov avatar mvogelgesang avatar phil-trinh avatar ramelhenderson avatar tylerrossc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gear3's Issues

Update NPM version in VDI environment to match GEAR2 dev app server

Currently VDI is running NPM v6 but GEAR2 dev app server is running v8.

When pulling the GitHub repo into GEAR2 (dev app server), I noticed that the package-lock.json file was about double the size that it was in my VDI environment where I had been testing locally. Upon investigating, I found that GEAR2 was running npm version 8 and VDI was running version 6. The package-lock.json file is using “lockfileVersion: 2” in GEAR2 due to being updated from an older npm version (this change occurred from npm v6 to v7). The new file is flattened to increase performance when reading and writing. This inadvertently makes the file much longer. I updated to npm v8 to match GEAR2 by executing the following in my VDI command line: “npm install -g npm@latest”.

Address npm dependency warnings

[1] Warning: Z:\JonahHatfield\Documents\GEAR3.1.4\node_modules\ng2-pdf-viewer\fesm2020\ng2-pdf-viewer.mjs depends on 'pdfjs-dist/build/pdf'. CommonJS or AMD dependencies can cause optimization bailouts.
[1] For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
[1]
[1] Warning: Z:\JonahHatfield\Documents\GEAR3.1.4\node_modules\ng2-pdf-viewer\fesm2020\ng2-pdf-viewer.mjs depends on 'pdfjs-dist/web/pdf_viewer'. CommonJS or AMD dependencies can cause optimization bailouts.
[1] For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Address IT standards report filters

  • Currently there are 2 filters that may not be needed: "Expired" and "Retired". Currently, zero IT standards have a status of either expired or retired, so it is an unused status. I need to determine whether Cindy and team needs these.
  • Cindy requested that we add an "Active" filter to the top

Update websites modal to include additional statuscard components

For each of the items below, a focus on implementing the data structure should take precedence over automating the sync of data between systems. If we have to run regular SQL updates for a period, that is fine.

  • #54
  • #63
  • #67
  • #69
  • #70
  • #79
  • #82
  • #83
  • Website sequence (top site they visit before, top site they visit after)
  • top search terms to get to site
  • top search terms within site
  • top referrers
  • top referred to
  • FEAF categorization

Change database passwords Sept 2022

Change all Dev and Prod database passwords. This occurs every 90 days.

Each one will have a different password for both dev and prod databases. An example MySQL script that will be executed is:
alter user 'account_name'@'%' identified by 'NEW_PASSWORD';

Summary Scan Data and Screenshots

Task aims to produce updates to the websites/{id} modals so as to display most recent homepage screenshots (desktop and mobile) along with scan data (start with FY22 IT performance metric data).

Major components:

  • User Interface, layout images in such a way that they scale on different devices and do not consume all of the above-the-fold real-estate in desktop view.
  • [-] User Interface, display IT performance metric data so as to provide clarity to status and guidance about how it is measured
  • User Interface, website screenshots vary in size from ~100Kb to >1.5Mb, investigate tools to reduce size of images so as not to take up space on the server. Thinking WebP
  • Database, create new website_scans table to hold scans and screenshot file names. Create fk relationship to websites table.
  • EDX CLI, create data condenser command to pull data from json files into relevant structure for DB https://github.com/GSA/edx/issues/616
  • API, add websites/{id}/scans which returns a list of scans associated to a given site in descending order
  • API, add websites/{id}/scans/{id} which returns a specific scan for a given site

User requested improvements - Records Management team

The following are improvements requested by the Records Management team based on their use of Dev1. I've already communicated to them that some of these may not be actionable at this time but will be put into the backlog.

  1. Search Description field as well as title? [default view to show description field with 30 char. wrap in table]

  2. Button order at top right (from left to right)
    a. Search (magnifying glass)
    b. Advanced Search fields - different icon - perhaps a magnifying glass and a "+" character?
    c. Hide/Show Pagination
    d. Column Select
    e. Card View
    f. Download button

If order changing is possible. You mentioned that this button order may be a universal setting for all of GEAR, but were going to look into it.

  1. On description field display, possible to wrap on 30 characters?

  2. Hide the following fields:
    a. Record group
    b. Status
    c. Disposition type
    d. FP Category
    e. Retention Years

  3. Show the following fields:
    a. Retention Instructions (wrapped)
    b. GSA Number (this field should appear first in the table and sorted on it)

Update FISMA POC report to include only active systems at the "system" level (i.e. no subsystems).

Under "Security" --> "FISMA System POCs"
You'll see that the report currently lists about 683 rows. This row count should equal the row count of the "FISMA Systems Inventory" report (about 117 rows).

To do this, the report will need to filter only systems that have a Status = Active and a System Level = System.

src --> app --> views --> security --> fisma-pocs
This is related to the fisma-pocs.component.ts file. There should be a filter to display only active systems. Currently it is displaying all active and inactive systems and subsystems.
Look at the fisma.component.ts file under src --> app --> views --> security --> fisma as a template (i.e. "//Filter out "Pending" Status)

Address npm start warnings

The following warnings are received when trying to run the local web server (i.e. npm start):

[0] npm WARN config cache-max This option has been deprecated in favor of --prefer-online
[0] npm WARN config cache-min This option has been deprecated in favor of --prefer-offline.
[0] npm WARN config optional Use --omit=optional to exclude optional dependencies, or
[0] npm WARN config --include=optional to include them.
[0] npm WARN config
[0] npm WARN config Default value does install optional deps unless otherwise omitted.
[0] npm WARN config shrinkwrap Use the --package-lock setting instead.
[0] npm WARN config sso-poll-frequency The --auth-type method of SSO/SAML/OAuth will be removed in a future
[0] npm WARN config version of npm in favor of web-based login.
[0] npm WARN config sso-type The --auth-type method of SSO/SAML/OAuth will be removed in a future
[0] npm WARN config version of npm in favor of web-based login.
[0] npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
[0] npm WARN config location in the cache, and they are managed by
[0] npm WARN config cacache.
[1] npm WARN config cache-max This option has been deprecated in favor of --prefer-online
[1] npm WARN config cache-min This option has been deprecated in favor of --prefer-offline.
[1] npm WARN config optional Use --omit=optional to exclude optional dependencies, or
[1] npm WARN config --include=optional to include them.
[1] npm WARN config
[1] npm WARN config Default value does install optional deps unless otherwise omitted.
[1] npm WARN config shrinkwrap Use the --package-lock setting instead.
[1] npm WARN config sso-poll-frequency The --auth-type method of SSO/SAML/OAuth will be removed in a future
[1] npm WARN config version of npm in favor of web-based login.
[1] npm WARN config sso-type The --auth-type method of SSO/SAML/OAuth will be removed in a future
[1] npm WARN config version of npm in favor of web-based login.
[1] npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
[1] npm WARN config location in the cache, and they are managed by
[1] npm WARN config cacache.

Install npm package jasmine-core v3.8

When deploying on the dev server, the app returned an error when attempting "npm install" due to a dependency with the jasmine-core npm package. I believe it was running version 3.6. This upgrade will be for v3.8 which will resolve the error when deploying to dev. This will have to be updated in my local environment as well then pushed to GitHub.

Transfer all bus application relationships to the new Business System inventory

After the final Archer/GEAR business systems inventory has been agreed upon, transfer all the relationships that exist on business application in GEAR to the new business system inventory for the 1:1 matches. Examples of these relationships include business capabilities, investment, technologies, interfaces, TIME, and any other data that is not maintained in Archer

Add Inactive FISMA System report to dev GEAR

This is a FISMA reporting requirement. Similar to how it is presented in prod GEAR today, add a report option on the left side, under Security, for the list of inactive FISMA systems (that have FISMA reportable listed as "yes")

Add RISSO report to dev GEAR (based on Jay's comms with other IS POCs)

Similar to how the RISSO report is in the prod GEAR today, add a report on the left side under "Security" for the RISSO report. Jay Normand said that he will reach out to his counterparts to confirm that they still want this report. First follow up with Jay to confirm that they require this report.

Change database passwords April 2022

Change all Dev and Prod database passwords. This occurs every 90 days.

Each one will have a different password for both dev and prod databases. An example MySQL script that will be executed is:
alter user 'account_name'@'%' identified by 'NEW_PASSWORD';

Convert GEAR_ID to utilize Archer's "Tracking ID" and change all relationships

Tracking ID is Archer's UID field for FISMA sub/systems. Previously, the Archer team had a GEAR_ID field which, in cases where there were existing GEAR FISMA systems, was used as the unique ID (UID). To reduce complexity going forward, we want to align GEAR with Archer's "Tracking ID" field so that Archer isn't keeping track of legacy GEAR UIDs and both systems are using the same ID.

Use David Ellis's list of GEAR IDs that he's changed due to a FISMA system having a legacy GEAR UID. (Filter on GEAR ID column not being equal to "" and use the "Tracking ID" field for all FISMA systems).
In GEAR's database, change the FISMA system lookup tables for:

  • technology mapping (using the business application to technology mapping)
  • capabilities mapping (again, using bus app mapping)
  • TIME mapping
  • Interfaces
  • Others as identified (possibly POC?)

Request updated XML file from Archer with new data fields to be sent daily

Separate from the XML file that is already sent to the ServiceNow team, Mark, and me, daily at 2pm, this request is to set up a workflow for the Archer team to send an email only to me with the updated XML file with the additional Archer data fields that I requested (e.g. TPOC, BPOC, Business_Application, CUI).

Edit FISMA system report to read new database structure

Currently, the FISMA system report is not displaying Alias/Acronym and System Name fields. The application code needs to be changed in the following ways:

  • Fix the Alias/Acronym and System Name fields to be viewable
  • Add the additional fields (BusinessApplication yes/no, TPOC, BPOC) to the FISMA system table data

Determine way to update GSA organization data in a repeatable way

Update the GSA org data in the database in order to display up-to-date data in the org chart graphic. Use the most recent D2D org data spreadsheet. This will be done on a monthly cadence. There should be a repeatable way of using this data, transforming it, and making it importable into GEAR's database.

Change GEAR business systems report filter buttons to correctly display data

(Under "Systems" --> "Systems & Subsystems" report)
For the following buttons, make the following changes:

  • Cloud enabled: display only business systems that are cloud enabled (currently it's all cloud enabled, active systems) - busapp = "Yes"
  • Inactive: display only business systems that are inactive - busapp = "Yes"
  • Pending: display only business systems that are pending - busapp = "Yes"
  • Back to all active systems: display only active business systems (i.e. "Yes" for the ex:BusinessApplication field in Archer report) - busapp = "Yes"

src --> app --> views --> systems --> systems (and the two file that will deal with this are systems.component.html and systems.component.ts)

The html file calls the "changeFilter" function from the .ts file but it only allows for one argument (field, term). For this case, you would need two arguments-- something like (field, term, field, term). There may be a more eloquent way of doing this, though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.