From 844a0ab9001b0bc94495c22afadf4e2480449366 Mon Sep 17 00:00:00 2001 From: chuanlin2018 Date: Fri, 9 Jun 2023 15:17:25 -0400 Subject: [PATCH 1/4] Changed the display for the status column in data file list for restrict public data --- .../data-files/data-files.component.html | 34 +++++++++----- .../data-files/data-files.component.ts | 46 +++++++++++++++++-- .../sections/resourcedata.component.html | 13 ++++-- 3 files changed, 72 insertions(+), 21 deletions(-) diff --git a/angular/src/app/landing/data-files/data-files.component.html b/angular/src/app/landing/data-files/data-files.component.html index 5e39160ce..b2ed6ce47 100644 --- a/angular/src/app/landing/data-files/data-files.component.html +++ b/angular/src/app/landing/data-files/data-files.component.html @@ -110,8 +110,9 @@
-
+
@@ -126,18 +127,29 @@
  
-
+
+
- -
-
Added -
- -
- +
+
+ Added +
+ +
+ +
+
+
+ +
+ +
diff --git a/angular/src/app/landing/data-files/data-files.component.ts b/angular/src/app/landing/data-files/data-files.component.ts index 03cf42edf..13883f947 100644 --- a/angular/src/app/landing/data-files/data-files.component.ts +++ b/angular/src/app/landing/data-files/data-files.component.ts @@ -151,6 +151,8 @@ export class DataFilesComponent implements OnInit, OnChanges { prevMouseY: number = 0; prevTreeTableHeight: number = 0; searchText: string = ""; + rapWithAccessUrl: boolean = false; // Indicate if there is a restricted access page with access url + accessURL: string = ""; // The key of treenode whose details is currently displayed currentKey: string = ''; @@ -168,7 +170,7 @@ export class DataFilesComponent implements OnInit, OnChanges { { field: 'name', header: 'Name', width: '60%' }, { field: 'mediaType', header: 'File Type', width: 'auto' }, { field: 'size', header: 'Size', width: 'auto' }, - { field: 'download', header: 'Status', width: 'auto' }]; + { field: 'download', header: "Status", width: 'auto' }]; if (typeof (window) !== 'undefined') { window.onresize = (e) => { @@ -219,8 +221,9 @@ export class DataFilesComponent implements OnInit, OnChanges { * Restrict and preview mode: hide the whole block -- restrict_preview */ get displayMode() { - if(!this.editEnabled || this.record['accessLevel'] === 'public') { - return "normal"; + // if(!this.editEnabled || this.record['accessLevel'] === 'public') { + if(this.record['accessLevel'] === 'public') { + return "normal"; }else if(this.record['accessLevel'] === 'restricted public' && this.editMode != this.EDIT_MODES.PREVIEW_MODE) { return "restrict"; }else { @@ -262,9 +265,15 @@ export class DataFilesComponent implements OnInit, OnChanges { // --- end of mouse drag functions useMetadata() { - this.ediid = this.record['ediid'] - this.buildTree(); + this.ediid = this.record['ediid']; + + if(this.record['accessLevel'] === 'restricted public') { + this.checkAccessPageType(); + this.cols[3]['header'] = "Access"; + } + this.buildTree(); + console.log("files", this.files); // If total file count > virtual scrolling threshold, set virtual scrolling to true. this.virtualScroll = this.fileCount > FileCountForVirtualScroll? true : false; @@ -272,6 +281,23 @@ export class DataFilesComponent implements OnInit, OnChanges { this.treeTableHeight = this.files.length > 5 ? MaxTreeTableHeight : this.files.length * 25; } + isRestrictedData(node: any) { + return node['comp']['@type'].includes('nrdp:RestrictedAccessPage'); + } + + checkAccessPageType() { + let comps = this.record["components"]; + if(comps && comps.length > 0) { + for (let comp of comps) { + if(comp['@type'].includes('nrdp:RestrictedAccessPage') && comp["accessURL"] && comp["accessURL"].trim() != "") { + this.rapWithAccessUrl = true; + this.accessURL = comp["accessURL"]; + break; + } + } + } + } + /** * Handle datacart change event */ @@ -907,4 +933,14 @@ export class DataFilesComponent implements OnInit, OnChanges { let mType: string = MediaTypeMapping[ext]; return mType == undefined ? "" : mType; } + + /** + * Google Analytics track event + * @param url - URL that user visit + * @param event - action event + * @param title - action title + */ + googleAnalytics(url: string, event, title) { + this.gaService.gaTrackEvent('homepage', event, title, url); + } } diff --git a/angular/src/app/landing/sections/resourcedata.component.html b/angular/src/app/landing/sections/resourcedata.component.html index 7a4606ce5..ca1136cfb 100644 --- a/angular/src/app/landing/sections/resourcedata.component.html +++ b/angular/src/app/landing/sections/resourcedata.component.html @@ -69,16 +69,19 @@

Data Access

+ class="faa faa-external-link button_icon">Request Data Access
-
About downloading restricted +
About downloading restricted public data
-
{{apage['description']}} + +
+
{{apage['description']}} +
From ff216833b1b703f90ce26e94c5a9951e77812e6e Mon Sep 17 00:00:00 2001 From: chuanlin2018 Date: Fri, 9 Jun 2023 15:40:12 -0400 Subject: [PATCH 2/4] Checked in test record test3 for testing purpose --- angular/src/environments/environment.ts | 71 +++++++++++++++++++++---- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/angular/src/environments/environment.ts b/angular/src/environments/environment.ts index 4713ef6f8..7477252cd 100644 --- a/angular/src/environments/environment.ts +++ b/angular/src/environments/environment.ts @@ -14,7 +14,7 @@ import { LPSConfig } from '../app/config/config'; export const context = { production: false, useMetadataService: false, - useCustomizationService: true + useCustomizationService: false }; export const config: LPSConfig = { @@ -28,9 +28,9 @@ export const config: LPSConfig = { }, APIs: { customization: "https://data.nist.gov/customization", - // customization: "https://testdata.nist.gov/customization", + // customization: "https://data.nist.gov/customization", // distService: "https://data.nist.gov/od/ds/", - distService: "https://testdata.nist.gov/od/ds/", + distService: "https://data.nist.gov/od/ds/", mdService: "https://data.nist.gov/od/id/", mdSearch: "https://data.nist.gov/rmm/", metrics: "https://data.nist.gov/rmm/usagemetrics", @@ -40,7 +40,7 @@ export const config: LPSConfig = { status: "Dev Version", appVersion: "v1.3.X", production: context.production, - editEnabled: true, + editEnabled: false, gacode: "not-set", screenSizeBreakPoint: 1060, bundleSizeAlert: 500000000, @@ -386,9 +386,8 @@ export const testdata: {} = { "license": "https://www.nist.gov/open/license", "components": [ { - "accessURL": "https://www.nist.gov/itl/iad/image-group/special-database-32-multiple-encounter-dataset-meds", - "description": "This page presents a registration form that must be completed to download the restricted data. Multiple Encounter Dataset (MEDS-I) is a test corpus organized from an extract of submissions of deceased persons with prior multiple encounters. MEDS is provided to assist the FBI and partner organizations refine tools, techniques, and procedures for face recognition as it supports Next Generation Identification (NGI), forensic comparison, training, and analysis, and face image conformance and inter-agency exchange standards. The MITRE Corporation (MITRE) prepared MEDS in the FBI Data Analysis Support Laboratory (DASL) with support from the FBI Biometric Center of Excellence.", - "title": "Gateway for Registered Data Access", + "description": "Zip file with JPEG formatted face image files.", + "title": "Multiple Encounter Dataset (MEDS)", "format": { "description": "JPEG formatted images" }, @@ -396,14 +395,42 @@ export const testdata: {} = { "downloadURL": "http://nigos.nist.gov:8080/nist/sd/32/NIST_SD32_MEDS-I_face.zip", "filepath": "NIST_SD32_MEDS-I_face.zip", "@type": [ - "nrdp:RestrictedAccessPage", - "nrdp:AccessPage" + "nrdp:Hidden", + "nrdp:AccessPage", + "dcat:Distribution" ], "@id": "cmps/NIST_SD32_MEDS-I_face.zip", "_extensionSchemas": [ "https://www.nist.gov/od/dm/nerdm-schema/pub/v0.1#/definitions/AccessPage" ] }, + { + "accessURL": "https://data.nist.gov/od/rp?@id=ark:/88434/mds2-2419", + "description": "This page provides a registration form that must be completed before downloading the data.", + "title": "Gateway for Registered Data Access", + "@type": [ + "nrdp:RestrictedAccessPage", + "nrdp:AccessPage", + "dcat:Distribution" + ], + "@id": "#pdr?@id=ark:/88434/mds2-2419", + "_extensionSchemas": [ + "https://data.nist.gov/od/dm/nerdm-schema/pub/v0.7#/definitions/AccessPage" + ] + }, + { + "accessURL": "https://doi.org/10.18434/mds0000fbk", + "description": "DOI Access to landing page", + "title": "DOI Access to \"Multiple Encounter Dataset (MEDS-I)\"", + "@type": [ + "nrdp:AccessPage", + "dcat:Distribution" + ], + "@id": "#doi:10.18434/mds0000fbk", + "_extensionSchemas": [ + "https://www.nist.gov/od/dm/nerdm-schema/pub/v0.1#/definitions/" + ] + }, { "accessURL": "https://www.nist.gov/itl/iad/image-group/special-database-32-multiple-encounter-dataset-meds", "description": "zip file with html page with jpeg images of faces.", @@ -416,14 +443,36 @@ export const testdata: {} = { "filepath": "NIST_SD32_MEDS-I_html.zip", "@type": [ "nrdp:DataFile", - "dcat:Distribution", - "nrdp:AccessPage" + "dcat:Distribution" ], "@id": "cmps/NIST_SD32_MEDS-I_html.zip", "_extensionSchemas": [ "https://www.nist.gov/od/dm/nerdm-schema/pub/v0.1#/definitions/DataFile" ] }, + { + "@id": "cmps/nfiq2_conformance_expected_output.csv", + "@type": [ + "nrdp:DataFile", + "nrdp:DownloadableFile", + "dcat:Distribution" + ], + "_extensionSchemas": [ + "https://data.nist.gov/od/dm/nerdm-schema/pub/v0.7#/definitions/DataFile" + ], + "filepath": "nfiq2_conformance_expected_output.csv", + "mediaType": "text/csv", + "description": "Expected output from NFIQ 2 when run against the conformance dataset.", + "title": "NFIQ 2 Conformance Expected Output", + "size": 74061, + "checksum": { + "hash": "863b33fd8b5a725616d21d5f482205ea7d0e625162f883b6aadfb20ad6cea34e", + "algorithm": { + "tag": "sha256", + "@type": "Thing" + } + } + }, { "accessURL": "https://doi.org/10.18434/mds0000fbk", "description": "DOI Access to landing page", From 1b6b92ab51cbecdf3f0607227dd4e1a9d0d359bf Mon Sep 17 00:00:00 2001 From: chuanlin2018 Date: Tue, 13 Jun 2023 12:24:19 -0400 Subject: [PATCH 3/4] Remote a statement: Note: this... --- angular/src/app/landing/data-files/data-files.component.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/angular/src/app/landing/data-files/data-files.component.html b/angular/src/app/landing/data-files/data-files.component.html index b2ed6ce47..ed80f698e 100644 --- a/angular/src/app/landing/data-files/data-files.component.html +++ b/angular/src/app/landing/data-files/data-files.component.html @@ -2,8 +2,6 @@
-
Note: This dataset is designated as restricted public data; this file list - will not be shown in the public version of this page.
From db9643bcadeebdff24e4269fd0a3c84ec762bb7d Mon Sep 17 00:00:00 2001 From: chuanlin2018 Date: Thu, 15 Jun 2023 12:51:34 -0400 Subject: [PATCH 4/4] Removed grey background of the file list section --- angular/src/app/landing/data-files/data-files.component.css | 2 +- angular/src/app/landing/data-files/data-files.component.html | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/angular/src/app/landing/data-files/data-files.component.css b/angular/src/app/landing/data-files/data-files.component.css index b0ee8da45..0467cf191 100644 --- a/angular/src/app/landing/data-files/data-files.component.css +++ b/angular/src/app/landing/data-files/data-files.component.css @@ -1,5 +1,5 @@ .restrict-public { - background-color: rgb(238, 238, 238); padding: 20px; + padding-left: 20px; } .ui-treetable .ui-state-highlight { diff --git a/angular/src/app/landing/data-files/data-files.component.html b/angular/src/app/landing/data-files/data-files.component.html index ed80f698e..942afee5d 100644 --- a/angular/src/app/landing/data-files/data-files.component.html +++ b/angular/src/app/landing/data-files/data-files.component.html @@ -1,7 +1,6 @@ -
+