diff --git a/additional-documentation/rest-api.html b/additional-documentation/rest-api.html index 23508f3094..93ae01a84b 100644 --- a/additional-documentation/rest-api.html +++ b/additional-documentation/rest-api.html @@ -1,4 +1,4 @@ -ReDBox Portal API Back to top

ReDBox Portal API

The ReDBox Portal API provides authorized access to manage functions related to records, user management, roles, search functionalities, and more. This document outlines the available endpoints, request/response formats, and other relevant technical details.

+ReDBox Portal API Back to top

ReDBox Portal API

The ReDBox Portal API provides authorized access to manage functions related to records, user management, roles, search functionalities, and more. This document outlines the available endpoints, request/response formats, and other relevant technical details.

Overview

Authorization

The ReDBox Portal API secures access through the use of bearer tokens. A bearer token must be obtained from the ReDBox admin user interface and included in the Authorization header as a Bearer token for all API requests.

@@ -809,7 +809,7 @@

Error Handling

GET/default/rdmp/api/records/datastreams/{oid}{?datastreamId}

Example URI

GET https://demo.redboxresearchdata.com.au/default/rdmp/api/records/datastreams/7e72b5952e8e323c77f72ae268a27c46?datastreamId=9159dc90fa9511edbc38b7f112a6db3d
URI Parameters
HideShow
oid
string (required) Example: 7e72b5952e8e323c77f72ae268a27c46

The identifier for the record

+}

Get attachment in record
GET/default/rdmp/api/records/datastreams/{oid}/{datastreamId}

Example URI

GET https://demo.redboxresearchdata.com.au/default/rdmp/api/records/datastreams/7e72b5952e8e323c77f72ae268a27c46/9159dc90fa9511edbc38b7f112a6db3d
URI Parameters
HideShow
oid
string (required) Example: 7e72b5952e8e323c77f72ae268a27c46

The identifier for the record

datastreamId
string (required) Example: 9159dc90fa9511edbc38b7f112a6db3d

The datastream identifier

Request  Get Attachment
HideShow
Headers
Content-Type: application/json
Authorization: Bearer abcabcab-abca-abca-abca-abcabcabcabc
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
   "message": "Failed to get attachment.",
@@ -832,7 +832,7 @@ 

Error Handling

PUT/default/rdmp/api/records/datastreams/{oid}

Example URI

PUT https://demo.redboxresearchdata.com.au/default/rdmp/api/records/datastreams/7e72b5952e8e323c77f72ae268a27c46
URI Parameters
HideShow
oid
string (required) Example: 7e72b5952e8e323c77f72ae268a27c46

The identifier for the record

+}

List attachments in record
GET/default/rdmp/api/records/datastreams/{oid}

Example URI

GET https://demo.redboxresearchdata.com.au/default/rdmp/api/records/datastreams/7e72b5952e8e323c77f72ae268a27c46
URI Parameters
HideShow
oid
string (required) Example: 7e72b5952e8e323c77f72ae268a27c46

The identifier for the record

Request  Get Records
HideShow
Headers
Content-Type: application/json
Authorization: Bearer abcabcab-abca-abca-abca-abcabcabcabc
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
   "summary": {
     "numFound": "1",
@@ -1239,52 +1239,80 @@ 

Error Handling

GET/default/rdmp/api/search/index{?oid}

Example URI

GET https://demo.redboxresearchdata.com.au/default/rdmp/api/search/index?oid=7e72b5952e8e323c77f72ae268a27c46
URI Parameters
HideShow
oid
string (required) Example: 7e72b5952e8e323c77f72ae268a27c46

The identifier for the record.

Request
HideShow
Headers
Authorization: Bearer abcabcab-abca-abca-abca-abcabcabcabc
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
-  "summary": {
-    "numFound": "1",
-    "page": "1",
-    "start": "0"
-  },
-  "records": [
-    {
-      "oid": "7e72b5952e8e323c77f72ae268a27c46",
-      "title": "A sample record title",
-      "dateCreated": "2020",
-      "dateModified": "2020",
-      "metadata": {}
+  "oid": "1234abcd",
+  "message": "Index request added to message queue for processing",
+  "details": "Additional details",
+  "status": "200"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "oid": {
+      "type": "string",
+      "description": "The object identifier"
+    },
+    "message": {
+      "type": "string",
+      "description": "The response message"
+    },
+    "details": {
+      "type": "string",
+      "description": "Additional details about the response"
+    },
+    "status": {
+      "type": "string"
     }
-  ]
+  }
+}

Index all records
GET/default/rdmp/api/search/indexAll

Example URI

GET https://demo.redboxresearchdata.com.au/default/rdmp/api/search/indexAll
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer abcabcab-abca-abca-abca-abcabcabcabc
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
+  "oid": "1234abcd",
+  "message": "Index all records request added to message queue for processing",
+  "details": "Additional details",
+  "status": "200"
 }
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "type": "object",
   "properties": {
-    "summary": {
-      "type": "object",
-      "properties": {
-        "numFound": {
-          "type": "string"
-        },
-        "page": {
-          "type": "string"
-        },
-        "start": {
-          "type": "string"
-        }
-      },
-      "required": [
-        "numFound",
-        "page",
-        "start"
-      ]
+    "oid": {
+      "type": "string",
+      "description": "The object identifier"
     },
-    "records": {
-      "type": "array"
+    "message": {
+      "type": "string",
+      "description": "The response message"
+    },
+    "details": {
+      "type": "string",
+      "description": "Additional details about the response"
+    },
+    "status": {
+      "type": "string"
     }
-  },
-  "required": [
-    "summary",
-    "records"
-  ],
-  "additionalProperties": false
+  }
+}

Remove all records from index
DELETE/default/rdmp/api/search/index/removeAll

Example URI

DELETE https://demo.redboxresearchdata.com.au/default/rdmp/api/search/index/removeAll
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer abcabcab-abca-abca-abca-abcabcabcabc
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
+  "oid": "1234abcd",
+  "message": "Remove all records request added to message queue for processing",
+  "details": "Additional details",
+  "status": "200"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "oid": {
+      "type": "string",
+      "description": "The object identifier"
+    },
+    "message": {
+      "type": "string",
+      "description": "The response message"
+    },
+    "details": {
+      "type": "string",
+      "description": "Additional details about the response"
+    },
+    "status": {
+      "type": "string"
+    }
+  }
 }

Report

Report

Execute Named Query
GET/default/rdmp/api/report/namedQuery/{queryName}{?rows,start}

Executes a named query based on the provided query name and parameters.

Example URI

GET https://demo.redboxresearchdata.com.au/default/rdmp/api/report/namedQuery/queryName?rows=&start=
URI Parameters
HideShow
queryName
string (required) 

The name of the query to execute.

start
number (optional) 

The starting index for the query results. Defaults to 0.

@@ -1950,7 +1978,7 @@

Example URI

GET& "additionalProperties": false }

Search Mint records

This endpoint is an authenticated wrapper to Apache solr’s search endpoint and supports all the basic common query parameters.

Search
GET/mint/api/v1.1/search{?q}

Example URI

GET https://demo.redboxresearchdata.com.au/mint/api/v1.1/search?q=query
URI Parameters
HideShow
q
string (required) Example: query

The search string to query the index.

-
Request
HideShow
Headers
Authorization: Bearer abcabcab-abca-abca-abca-abcabcabcabc
Response  200
HideShow
Headers
Content-Type: application/json

Generated by aglio on 30 Jul 2024

+ + + + + +
+
+ + +
+
+ + + + + + + + + + + + + + + + +
+
+

+

File

+

+

+ angular/projects/researchdatabox/portal-ng-common/src/lib/dashboard-models.ts +

+ + + + + + + + + + +
+

Indexable

+ + + + + + + + + +
+ [key: string]: literal type + +
+ +
+
+ + + + + +
+ + +
+
export class PlanTable {
+  totalItems: number = 0;
+  currentPage: number = 0;
+  noItems: number = 0;
+  items: any[] = [];
+}
+
+export class RecordResponseTable {
+  totalItems: number = 0;
+  currentPage: number = 0;
+  noItems: number = 0;
+  items: any[] = [];
+}
+
+export class Plan {
+  oid: string = '';
+  title: string = '';
+  dateCreated: string = '';
+  dateModified: string = '';
+  hasEditAccess:boolean = false;
+  metadata: object = {};
+  dashboardTitle: string = '';
+}
+
+export declare class FilterField {
+    name: string;
+    path: string;
+}
+
+export declare class QueryFilter {
+  filterType: string;
+  filterFields: FilterField[];
+}
+
+export declare class SortGroupBy {
+  rowLevel: number;
+  compareFieldValue: string;
+  compareField: string;
+  relatedTo: string;
+}
+
+export declare class FormatRules {
+  filterBy: any;
+  filterWorkflowStepsBy: string[];
+  recordTypeFilterBy: string;
+  queryFilters: { [key: string]: QueryFilter[] };
+  sortBy: string;
+  groupBy: string;
+  sortGroupBy: SortGroupBy[];
+  hideWorkflowStepTitleForRecordType: string[];
+}
+
+export declare class DashboardConfig {
+  [key: string]: {
+      formatRules: FormatRules;
+  }
+}
+
+
+ + + + + + + + + +
+
+

results matching ""

+
    +
    +
    +

    No results matching ""

    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/classes/FilterField.html b/classes/FilterField.html new file mode 100644 index 0000000000..6a807531e2 --- /dev/null +++ b/classes/FilterField.html @@ -0,0 +1,371 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
    +
    + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +

    +

    File

    +

    +

    + angular/projects/researchdatabox/portal-ng-common/src/lib/dashboard-models.ts +

    + + + + + + +
    +

    Index

    + + + + + + + + + + + + + + + +
    +
    Properties
    +
    + +
    +
    + + +
    + +

    + Properties +

    + + + + + + + + + + + + + + +
    + + + name + + +
    + Type : string + +
    + +
    + + + + + + + + + + + + + + +
    + + + path + + +
    + Type : string + +
    + +
    +
    + + + + + + + +
    + + +
    +
    export class PlanTable {
    +  totalItems: number = 0;
    +  currentPage: number = 0;
    +  noItems: number = 0;
    +  items: any[] = [];
    +}
    +
    +export class RecordResponseTable {
    +  totalItems: number = 0;
    +  currentPage: number = 0;
    +  noItems: number = 0;
    +  items: any[] = [];
    +}
    +
    +export class Plan {
    +  oid: string = '';
    +  title: string = '';
    +  dateCreated: string = '';
    +  dateModified: string = '';
    +  hasEditAccess:boolean = false;
    +  metadata: object = {};
    +  dashboardTitle: string = '';
    +}
    +
    +export declare class FilterField {
    +    name: string;
    +    path: string;
    +}
    +
    +export declare class QueryFilter {
    +  filterType: string;
    +  filterFields: FilterField[];
    +}
    +
    +export declare class SortGroupBy {
    +  rowLevel: number;
    +  compareFieldValue: string;
    +  compareField: string;
    +  relatedTo: string;
    +}
    +
    +export declare class FormatRules {
    +  filterBy: any;
    +  filterWorkflowStepsBy: string[];
    +  recordTypeFilterBy: string;
    +  queryFilters: { [key: string]: QueryFilter[] };
    +  sortBy: string;
    +  groupBy: string;
    +  sortGroupBy: SortGroupBy[];
    +  hideWorkflowStepTitleForRecordType: string[];
    +}
    +
    +export declare class DashboardConfig {
    +  [key: string]: {
    +      formatRules: FormatRules;
    +  }
    +}
    +
    +
    + + + + + + + + + +
    +
    +

    results matching ""

    +
      +
      +
      +

      No results matching ""

      +
      +
      +
      + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/classes/FormatRules.html b/classes/FormatRules.html new file mode 100644 index 0000000000..b137dc267f --- /dev/null +++ b/classes/FormatRules.html @@ -0,0 +1,545 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + +
      +
      +

      +

      File

      +

      +

      + angular/projects/researchdatabox/portal-ng-common/src/lib/dashboard-models.ts +

      + + + + + + +
      +

      Index

      + + + + + + + + + + + + + + + +
      +
      Properties
      +
      + +
      +
      + + +
      + +

      + Properties +

      + + + + + + + + + + + + + + +
      + + + filterBy + + +
      + Type : any + +
      + +
      + + + + + + + + + + + + + + +
      + + + filterWorkflowStepsBy + + +
      + Type : string[] + +
      + +
      + + + + + + + + + + + + + + +
      + + + groupBy + + +
      + Type : string + +
      + +
      + + + + + + + + + + + + + + +
      + + + hideWorkflowStepTitleForRecordType + + +
      + Type : string[] + +
      + +
      + + + + + + + + + + + + + + +
      + + + queryFilters + + +
      + Type : literal type + +
      + +
      + + + + + + + + + + + + + + +
      + + + recordTypeFilterBy + + +
      + Type : string + +
      + +
      + + + + + + + + + + + + + + +
      + + + sortBy + + +
      + Type : string + +
      + +
      + + + + + + + + + + + + + + +
      + + + sortGroupBy + + +
      + Type : SortGroupBy[] + +
      + +
      +
      + + + + + + + +
      + + +
      +
      export class PlanTable {
      +  totalItems: number = 0;
      +  currentPage: number = 0;
      +  noItems: number = 0;
      +  items: any[] = [];
      +}
      +
      +export class RecordResponseTable {
      +  totalItems: number = 0;
      +  currentPage: number = 0;
      +  noItems: number = 0;
      +  items: any[] = [];
      +}
      +
      +export class Plan {
      +  oid: string = '';
      +  title: string = '';
      +  dateCreated: string = '';
      +  dateModified: string = '';
      +  hasEditAccess:boolean = false;
      +  metadata: object = {};
      +  dashboardTitle: string = '';
      +}
      +
      +export declare class FilterField {
      +    name: string;
      +    path: string;
      +}
      +
      +export declare class QueryFilter {
      +  filterType: string;
      +  filterFields: FilterField[];
      +}
      +
      +export declare class SortGroupBy {
      +  rowLevel: number;
      +  compareFieldValue: string;
      +  compareField: string;
      +  relatedTo: string;
      +}
      +
      +export declare class FormatRules {
      +  filterBy: any;
      +  filterWorkflowStepsBy: string[];
      +  recordTypeFilterBy: string;
      +  queryFilters: { [key: string]: QueryFilter[] };
      +  sortBy: string;
      +  groupBy: string;
      +  sortGroupBy: SortGroupBy[];
      +  hideWorkflowStepTitleForRecordType: string[];
      +}
      +
      +export declare class DashboardConfig {
      +  [key: string]: {
      +      formatRules: FormatRules;
      +  }
      +}
      +
      +
      + + + + + + + + + +
      +
      +

      results matching ""

      +
        +
        +
        +

        No results matching ""

        +
        +
        +
        + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/classes/Plan.html b/classes/Plan.html index e7c91b49bb..995f364257 100644 --- a/classes/Plan.html +++ b/classes/Plan.html @@ -432,7 +432,40 @@

        metadata: object = {}; dashboardTitle: string = ''; } - + +export declare class FilterField { + name: string; + path: string; +} + +export declare class QueryFilter { + filterType: string; + filterFields: FilterField[]; +} + +export declare class SortGroupBy { + rowLevel: number; + compareFieldValue: string; + compareField: string; + relatedTo: string; +} + +export declare class FormatRules { + filterBy: any; + filterWorkflowStepsBy: string[]; + recordTypeFilterBy: string; + queryFilters: { [key: string]: QueryFilter[] }; + sortBy: string; + groupBy: string; + sortGroupBy: SortGroupBy[]; + hideWorkflowStepTitleForRecordType: string[]; +} + +export declare class DashboardConfig { + [key: string]: { + formatRules: FormatRules; + } +} diff --git a/classes/PlanTable.html b/classes/PlanTable.html index 77d66ffea3..669db7a49d 100644 --- a/classes/PlanTable.html +++ b/classes/PlanTable.html @@ -330,7 +330,40 @@

        metadata: object = {}; dashboardTitle: string = ''; } - + +export declare class FilterField { + name: string; + path: string; +} + +export declare class QueryFilter { + filterType: string; + filterFields: FilterField[]; +} + +export declare class SortGroupBy { + rowLevel: number; + compareFieldValue: string; + compareField: string; + relatedTo: string; +} + +export declare class FormatRules { + filterBy: any; + filterWorkflowStepsBy: string[]; + recordTypeFilterBy: string; + queryFilters: { [key: string]: QueryFilter[] }; + sortBy: string; + groupBy: string; + sortGroupBy: SortGroupBy[]; + hideWorkflowStepTitleForRecordType: string[]; +} + +export declare class DashboardConfig { + [key: string]: { + formatRules: FormatRules; + } +} diff --git a/classes/QueryFilter.html b/classes/QueryFilter.html new file mode 100644 index 0000000000..15981e7b87 --- /dev/null +++ b/classes/QueryFilter.html @@ -0,0 +1,371 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
        +
        + + +
        +
        + + + + + + + + + + + + + + + + +
        +
        +

        +

        File

        +

        +

        + angular/projects/researchdatabox/portal-ng-common/src/lib/dashboard-models.ts +

        + + + + + + +
        +

        Index

        + + + + + + + + + + + + + + + +
        +
        Properties
        +
        + +
        +
        + + +
        + +

        + Properties +

        + + + + + + + + + + + + + + +
        + + + filterFields + + +
        + Type : FilterField[] + +
        + +
        + + + + + + + + + + + + + + +
        + + + filterType + + +
        + Type : string + +
        + +
        +
        + + + + + + + +
        + + +
        +
        export class PlanTable {
        +  totalItems: number = 0;
        +  currentPage: number = 0;
        +  noItems: number = 0;
        +  items: any[] = [];
        +}
        +
        +export class RecordResponseTable {
        +  totalItems: number = 0;
        +  currentPage: number = 0;
        +  noItems: number = 0;
        +  items: any[] = [];
        +}
        +
        +export class Plan {
        +  oid: string = '';
        +  title: string = '';
        +  dateCreated: string = '';
        +  dateModified: string = '';
        +  hasEditAccess:boolean = false;
        +  metadata: object = {};
        +  dashboardTitle: string = '';
        +}
        +
        +export declare class FilterField {
        +    name: string;
        +    path: string;
        +}
        +
        +export declare class QueryFilter {
        +  filterType: string;
        +  filterFields: FilterField[];
        +}
        +
        +export declare class SortGroupBy {
        +  rowLevel: number;
        +  compareFieldValue: string;
        +  compareField: string;
        +  relatedTo: string;
        +}
        +
        +export declare class FormatRules {
        +  filterBy: any;
        +  filterWorkflowStepsBy: string[];
        +  recordTypeFilterBy: string;
        +  queryFilters: { [key: string]: QueryFilter[] };
        +  sortBy: string;
        +  groupBy: string;
        +  sortGroupBy: SortGroupBy[];
        +  hideWorkflowStepTitleForRecordType: string[];
        +}
        +
        +export declare class DashboardConfig {
        +  [key: string]: {
        +      formatRules: FormatRules;
        +  }
        +}
        +
        +
        + + + + + + + + + +
        +
        +

        results matching ""

        +
          +
          +
          +

          No results matching ""

          +
          +
          +
          + +
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/classes/RecordResponseTable.html b/classes/RecordResponseTable.html index 2187e1d6a8..6f957f9106 100644 --- a/classes/RecordResponseTable.html +++ b/classes/RecordResponseTable.html @@ -330,7 +330,40 @@

          metadata: object = {}; dashboardTitle: string = ''; } - + +export declare class FilterField { + name: string; + path: string; +} + +export declare class QueryFilter { + filterType: string; + filterFields: FilterField[]; +} + +export declare class SortGroupBy { + rowLevel: number; + compareFieldValue: string; + compareField: string; + relatedTo: string; +} + +export declare class FormatRules { + filterBy: any; + filterWorkflowStepsBy: string[]; + recordTypeFilterBy: string; + queryFilters: { [key: string]: QueryFilter[] }; + sortBy: string; + groupBy: string; + sortGroupBy: SortGroupBy[]; + hideWorkflowStepTitleForRecordType: string[]; +} + +export declare class DashboardConfig { + [key: string]: { + formatRules: FormatRules; + } +} diff --git a/classes/SortGroupBy.html b/classes/SortGroupBy.html new file mode 100644 index 0000000000..37ab19709e --- /dev/null +++ b/classes/SortGroupBy.html @@ -0,0 +1,429 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
          +
          + + +
          +
          + + + + + + + + + + + + + + + + +
          +
          +

          +

          File

          +

          +

          + angular/projects/researchdatabox/portal-ng-common/src/lib/dashboard-models.ts +

          + + + + + + +
          +

          Index

          + + + + + + + + + + + + + + + +
          +
          Properties
          +
          + +
          +
          + + +
          + +

          + Properties +

          + + + + + + + + + + + + + + +
          + + + compareField + + +
          + Type : string + +
          + +
          + + + + + + + + + + + + + + +
          + + + compareFieldValue + + +
          + Type : string + +
          + +
          + + + + + + + + + + + + + + +
          + + + relatedTo + + +
          + Type : string + +
          + +
          + + + + + + + + + + + + + + +
          + + + rowLevel + + +
          + Type : number + +
          + +
          +
          + + + + + + + +
          + + +
          +
          export class PlanTable {
          +  totalItems: number = 0;
          +  currentPage: number = 0;
          +  noItems: number = 0;
          +  items: any[] = [];
          +}
          +
          +export class RecordResponseTable {
          +  totalItems: number = 0;
          +  currentPage: number = 0;
          +  noItems: number = 0;
          +  items: any[] = [];
          +}
          +
          +export class Plan {
          +  oid: string = '';
          +  title: string = '';
          +  dateCreated: string = '';
          +  dateModified: string = '';
          +  hasEditAccess:boolean = false;
          +  metadata: object = {};
          +  dashboardTitle: string = '';
          +}
          +
          +export declare class FilterField {
          +    name: string;
          +    path: string;
          +}
          +
          +export declare class QueryFilter {
          +  filterType: string;
          +  filterFields: FilterField[];
          +}
          +
          +export declare class SortGroupBy {
          +  rowLevel: number;
          +  compareFieldValue: string;
          +  compareField: string;
          +  relatedTo: string;
          +}
          +
          +export declare class FormatRules {
          +  filterBy: any;
          +  filterWorkflowStepsBy: string[];
          +  recordTypeFilterBy: string;
          +  queryFilters: { [key: string]: QueryFilter[] };
          +  sortBy: string;
          +  groupBy: string;
          +  sortGroupBy: SortGroupBy[];
          +  hideWorkflowStepTitleForRecordType: string[];
          +}
          +
          +export declare class DashboardConfig {
          +  [key: string]: {
          +      formatRules: FormatRules;
          +  }
          +}
          +
          +
          + + + + + + + + + +
          +
          +

          results matching ""

          +
            +
            +
            +

            No results matching ""

            +
            +
            +
            + +
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/AppConfigComponent.html b/components/AppConfigComponent.html new file mode 100644 index 0000000000..1cc9166d91 --- /dev/null +++ b/components/AppConfigComponent.html @@ -0,0 +1,1430 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
            +
            + + +
            +
            + + + + + + + + +
            +

            +

            File

            +

            +

            + angular/projects/researchdatabox/app-config/src/app/app-config.component.ts +

            + + +

            +

            Description

            +

            +

            +

            Application Config Component

            + +

            + +

            +

            Extends

            +

            +

            + BaseComponent +

            + + + +
            +

            Metadata

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + +
            +

            Index

            + + + + + + + + + + + + + + + + + + + + + +
            +
            Properties
            +
            + +
            +
            Methods
            +
            + +
            +
            + +
            +

            Constructor

            + + + + + + + + + + + + + +
            +constructor(loggerService: LoggerService, utilService: UtilityService, fb: FormBuilder, document: Document, translationService: TranslationService, appConfigService: AppConfigService, formlyJsonschema: FormlyJsonschema, elementRef: ElementRef) +
            + +
            +
            + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            NameTypeOptional
            loggerService + LoggerService + + No +
            utilService + UtilityService + + No +
            fb + FormBuilder + + No +
            document + Document + + No +
            translationService + TranslationService + + No +
            appConfigService + AppConfigService + + No +
            formlyJsonschema + FormlyJsonschema + + No +
            elementRef + ElementRef + + No +
            +
            +
            +
            + + + + + +
            + +

            + Methods +

            + + + + + + + + + + + + + + + + + + + + + + +
            + + + Protected + + Async + initComponent + + +
            + + initComponent() +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:69 +
            +
            + +
            + Returns : Promise<void> + +
            +
            + + + + + + + + + + + + + + + + + + + +
            + + + onSubmit + + +
            +onSubmit(model: any) +
            + +
            + +
            + Parameters : + + + + + + + + + + + + + + + + + + + +
            NameTypeOptional
            model + any + + No +
            +
            +
            + Returns : void + +
            +
            + +
            +
            + + + + + + + + + + + + + + + + + + + + + + +
            + + + getInitSubject + + +
            +getInitSubject() +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:71 +
            +
            +

            For those interested in the init from RXJS-land.

            +

            Note that it returns a BehaviorSubject instance, and will have an initial value of false, so process the return value as needed.

            +
            + +
            + Returns : Subject<any> + +
            +
            + + + + + + + + + + + + + + + + + + + + + + +
            + + + isInitializing + + +
            +isInitializing() +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:95 +
            +
            +

            Main flag to indicate the init status

            +
            + +
            + Returns : boolean + +
            +
            + + + + + + + + + + + + + + + + + + + + + + +
            + + + ngOnInit + + +
            +ngOnInit() +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:50 +
            +
            + + +
            + Returns : void + +
            +
            + + + + + + + + + + + + + + + + + + + + + + +
            + + + Async + waitForDeps + + +
            + + waitForDeps() +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:78 +
            +
            +

            Wait for dependencies to initialise

            +
            + +
            + Returns : Promise<any> + +
            +
            + + + + + + + + + + + + + + + + + + + + + + +
            + + + Async + waitForInit + + +
            + + waitForInit() +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:89 +
            +
            +

            For those interested in the init from the Promise-land

            +
            + +
            + Returns : Promise<any> + +
            +
            +
            +
            + +

            + Properties +

            + + + + + + + + + + + + + + +
            + + + configKey + + +
            + Type : any + +
            + +
            + + + + + + + + + + + + + + + + + +
            + + + fields + + +
            + Type : FormlyFieldConfig[] + +
            + Default value : [ + + ] +
            + +
            + + + + + + + + + + + + + + +
            + + + form + + +
            + Default value : new FormGroup({}) +
            + +
            + + + + + + + + + + + + + + + + + +
            + + + formSaveSuccessful + + +
            + Type : boolean + +
            + Default value : false +
            + +
            + + + + + + + + + + + + + + + + + +
            + + + formSaveUnsuccessful + + +
            + Type : boolean + +
            + Default value : false +
            + +
            + + + + + + + + + + + + + + + + + +
            + + + formSaving + + +
            + Type : boolean + +
            + Default value : false +
            + +
            + + + + + + + + + + + + + + + + + +
            + + + model + + +
            + Type : object + +
            + Default value : {} +
            + +
            + + + + + + + + + + + + + + +
            + + + window + + +
            + Type : any + +
            + +
            + + + + + + + + + + + + + + + + + + + + +
            + + + Protected + brandingAndPortalUrl + + +
            + Type : string + +
            + Default value : '' +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:42 +
            +
            + + + + + + + + + + + + + + + + + +
            + + + Private + filterFn + + +
            + Default value : function(initStat: boolean) { return initStat; } +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:40 +
            +
            + + + + + + + + + + + + + + + + + + + + +
            + + + Protected + initDependencies + + +
            + Type : Initable[] + +
            + Default value : [] +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:39 +
            +
            + + + + + + + + + + + + + + + + + + + + +
            + + + Protected + initSubject + + +
            + Type : BehaviorSubject<any> + +
            + Default value : new BehaviorSubject(false) +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:38 +
            +
            + + + + + + + + + + + + + + + + + + + + +
            + + + Protected + isReady + + +
            + Type : boolean + +
            + Default value : false +
            +
            Inherited from BaseComponent +
            +
            +
            Defined in BaseComponent:37 +
            +
            +
            + +
            + + +
            +
            import { Component, ElementRef, Inject } from '@angular/core';
            +import { FormGroup, Validators, FormBuilder } from '@angular/forms';
            +import { DOCUMENT } from "@angular/common"
            +import { BaseComponent, UtilityService, LoggerService, TranslationService, AppConfigService } from '@researchdatabox/portal-ng-common';
            +import { FormlyFieldConfig } from '@ngx-formly/core';
            +import { FormlyJsonschema } from '@ngx-formly/core/json-schema';
            +import { JSONSchema7 } from 'json-schema';
            +import { AppConfig } from 'projects/researchdatabox/portal-ng-common/src/public-api';
            +import { clone as _clone } from 'lodash'
            +/**
            + * Application Config  Component
            + *
            + */
            +@Component({
            +  selector: 'app-config',
            +  templateUrl: './app-config.component.html'
            +})
            +export class AppConfigComponent extends BaseComponent {
            +
            +  window: any;
            +  form = new FormGroup({});
            +  model = {};
            +  fields: FormlyFieldConfig[] = [
            +   
            +  ];
            +  configKey: any;
            +  formSaving: boolean = false;
            +  formSaveSuccessful: boolean = false;
            +  formSaveUnsuccessful: boolean = false;
            +
            +
            +  constructor(
            +    @Inject(LoggerService) private loggerService: LoggerService,
            +    @Inject(UtilityService) protected utilService: UtilityService,
            +    @Inject(FormBuilder) private fb: FormBuilder,
            +    @Inject(DOCUMENT) private document: Document,
            +    @Inject(TranslationService) private translationService: TranslationService,
            +    @Inject(AppConfigService) private appConfigService: AppConfigService,
            +    private formlyJsonschema: FormlyJsonschema,
            +    @Inject(ElementRef) elementRef: ElementRef
            +  ) {
            +    super();
            +    this.loggerService.debug(`AppConfig waiting for deps to init...`);
            +    this.window = this.document.defaultView;
            +    // set this component's dependencies
            +    this.configKey = elementRef.nativeElement.getAttribute('configKey');
            +    this.initDependencies = [translationService, appConfigService];
            +  }
            +
            +  protected override async initComponent(): Promise<void> {
            +    let result: AppConfig = await this.appConfigService.getAppConfigForm(this.configKey)
            +    const jsonObject: JSONSchema7 = result.schema as JSONSchema7;
            +    const fieldOrder = result.fieldOrder;
            +    let originalProperties = _clone(jsonObject.properties);
            +    jsonObject.properties = {};
            +    for (let field of fieldOrder) {
            +      if (originalProperties) {
            +        jsonObject.properties[field] = originalProperties[field];
            +      }
            +    }
            +
            +    this.fields = [this.formlyJsonschema.toFieldConfig(jsonObject)]
            +    this.model = result.model;
            +    this.loggerService.debug(`AppConfig initialised.`);
            +  }
            +
            +
            +  onSubmit(model: any) {
            +    this.formSaving = true;
            +    this.formSaveUnsuccessful = false;
            +    this.formSaveSuccessful = false;
            +    this.appConfigService.saveAppConfig(this.configKey, model).then((result: AppConfig) => {
            +      this.formSaveSuccessful = true;
            +      setTimeout(() => {
            +        this.formSaveSuccessful = false;
            +      }, 3000);
            +      this.formSaving = false;
            +    }).catch((error: any) => {
            +      this.formSaveSuccessful = false;
            +      this.formSaveUnsuccessful = true;
            +      this.formSaving = false;
            +    });
            +  }
            +}
            +
            +
            + +
            +
            <!-- ngIf is needed so init completes and view has all the information it needs -->
            +<ng-container *ngIf="isReady"> 
            +  <form [formGroup]="form" (ngSubmit)="onSubmit(model)">
            +    <formly-form [form]="form" [fields]="fields" [model]="model"></formly-form>
            +    <button type="submit" class="btn btn-default">Submit</button>
            +  </form>
            +  <p class="alert-info text-16 padding-10 mt-2" *ngIf="formSaving">Configuration is being saved <i class="fa fa-spinner fa-pulse fa-1x fa-fw"></i></p>
            +  <p class="alert-success text-16 padding-10 mt-2" *ngIf="formSaveSuccessful">Configuration saved successfully</p>
            +  <p class="alert-danger text-16 padding-10 mt-2" *ngIf="formSaveUnsuccessful">Configuration failed to save. Please try again.</p>
            +</ng-container>
            +
            + + +
            +
            +
            +
            + Legend +
            +
            +
            Html element +
            +
            +
            Component +
            +
            +
            Html element with directive +
            +
            +
            + + +
            + + + + + + + + + + + + + + + + + + + + + + + +
            +
            +

            results matching ""

            +
              +
              +
              +

              No results matching ""

              +
              +
              +
              + +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/ArrayTypeComponent.html b/components/ArrayTypeComponent.html new file mode 100644 index 0000000000..6d7985f553 --- /dev/null +++ b/components/ArrayTypeComponent.html @@ -0,0 +1,352 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
              +
              + + +
              +
              + + + + + + + + +
              +

              +

              File

              +

              +

              + angular/projects/researchdatabox/app-config/src/app/fieldTypes/array.type.ts +

              + + + +

              +

              Extends

              +

              +

              + FieldArrayType +

              + + + +
              +

              Metadata

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              + + + + + + + + + +
              + + +
              +
              import { Component } from '@angular/core';
              +import { FieldArrayType } from '@ngx-formly/core';
              +
              +@Component({
              +  selector: 'formly-array-type',
              +  template: `
              +    <div class="mb-3">
              +      <legend *ngIf="props.label">{{ props.label }}</legend>
              +      <p *ngIf="props.description">{{ props.description }}</p>
              +      <div class="d-flex flex-row-reverse">
              +        <button class="btn btn-primary" type="button" (click)="add()">+</button>
              +      </div>
              +
              +      <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
              +        <formly-validation-message [field]="field"></formly-validation-message>
              +      </div>
              +
              +      <div *ngFor="let field of field.fieldGroup; let i = index" class="row align-items-start">
              +        <formly-field class="col" [field]="field"></formly-field>
              +        <div  class="col-2 text-right">
              +          <button class="btn btn-danger" type="button" (click)="remove(i)">-</button>
              +        </div>
              +      </div>
              +    </div>
              +  `,
              +})
              +export class ArrayTypeComponent extends FieldArrayType {}
              +
              + + + +
              +
              +
              +
              + Legend +
              +
              +
              Html element +
              +
              +
              Component +
              +
              +
              Html element with directive +
              +
              +
              + + +
              + + + + + + + + + + + + + + + + + + + + + + + +
              +
              +

              results matching ""

              +
                +
                +
                +

                No results matching ""

                +
                +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/BaseComponent.html b/components/BaseComponent.html index 7c601ca781..7b6a43ab80 100644 --- a/components/BaseComponent.html +++ b/components/BaseComponent.html @@ -799,7 +799,7 @@

                diff --git a/components/DashboardComponent.html b/components/DashboardComponent.html index 643a373091..826643a77e 100644 --- a/components/DashboardComponent.html +++ b/components/DashboardComponent.html @@ -209,6 +209,9 @@

                Properties
              • defaultDashboardTypeSelected
              • +
              • + defaultFilterField +
              • defaultFormatRules
              • @@ -219,14 +222,23 @@
                Properties
                defaultGroupRowRules
              • - defaultRowLevelRules + defaultRowConfig
              • - defaultTableConfig + defaultRowLevelRules
              • enableSort
              • +
              • + filterFieldName +
              • +
              • + filterFieldPath +
              • +
              • + filterSearchString +
              • formatRules
              • @@ -236,6 +248,15 @@
                Properties
              • groupRowRules
              • +
              • + hideWorkflowStepTitle +
              • +
              • + isFilterSearchDisplayed +
              • +
              • + isSearching +
              • packageType
              • @@ -316,35 +337,100 @@
                Methods
                Public evaluateRowLevelRules +
              • + Public + Async + filterChanged +
              • +
              • + Private + Async + getAllItemsGroupedByRecordType +
              • +
              • + Private + Async + getAllItemsGroupedByRelationships +
              • +
              • + Private + getFilters +
              • +
              • + Public + getFilterSearchDisplayed +
              • +
              • + Public + getFilterSearchString +
              • +
              • + Private + getFirstFilter +
              • +
              • + Private + getFirstTextFilter +
              • +
              • + Public + getIsSearching +
              • Private getSortString
              • +
              • + Public + getTextFilters +
              • Protected Async initComponent
              • +
              • + Private + initSortConfig +
              • Public Async initStep
              • +
              • + Private + initStepTableConfig +
              • Public Async initView
              • +
              • + Private + Async + initWorkflowSteps +
              • Public Async pageChanged
              • +
              • + Public + Async + resetFilterAndSearch +
              • Private runTemplate
              • +
              • + Public + setFilterField +
              • Public Async @@ -394,7 +480,7 @@

                Constructor

                -
                Defined in angular/projects/researchdatabox/dashboard/src/app/dashboard.component.ts:111
                +
                Defined in angular/projects/researchdatabox/dashboard/src/app/dashboard.component.ts:134
                @@ -547,8 +633,8 @@

                - + @@ -640,8 +726,8 @@

                - + @@ -757,8 +843,8 @@

                - + @@ -868,26 +954,27 @@

                - + - Private - getSortString - + Public + Async + filterChanged + - getSortString(sortDetails: any) + filterChanged(step: string) - + @@ -908,9 +995,9 @@

                - sortDetails + step - any + string @@ -923,7 +1010,7 @@

                - Returns : string + Returns : any
                @@ -937,74 +1024,27 @@

                - - - Protected - - Async - initComponent - - - - - - - - initComponent() - - - - - - -
                Inherited from BaseComponent -
                - - - - -
                Defined in BaseComponent:141 -
                - - - - - - - -
                - Returns : Promise<void> - -
                - - - - - - - - @@ -1024,6 +1064,18 @@

                + + + + + + + + - + - + @@ -1061,7 +1113,7 @@

                - + @@ -1073,9 +1125,33 @@

                - + + + + + + + + + + + + + + + + +
                - + - Public + Private Async - initStep - + getAllItemsGroupedByRecordType +
                - initStep(stepName: string, evaluateStepName: string, recordType: string, packageType: string, startIndex: number) + getAllItemsGroupedByRecordType(sortGroupBy: SortGroupBy[], stepName: string, startIndex: number, packageType: string, sortByString: string, filterFileds: any, filterString: any, filterMode: any)
                - +
                sortGroupBy + SortGroupBy[] + + No +
                stepName @@ -1037,9 +1089,9 @@

                evaluateStepNamestartIndex - string + number @@ -1049,7 +1101,7 @@

                recordTypepackageType string
                packageTypesortByString string
                startIndexfilterFileds - number + any + + No +
                filterString + any + + No +
                filterMode + any @@ -1088,7 +1164,7 @@

                - Returns : any + Returns : unknown
                @@ -1102,27 +1178,27 @@

                - + - Public + Private Async - initView - + getAllItemsGroupedByRelationships + - initView(recordType: string) + getAllItemsGroupedByRelationships(items: any, sortGroupBy: SortGroupBy[]) - + @@ -1143,9 +1219,21 @@

                - recordType + items - string + any + + + + No + + + + + + sortGroupBy + + SortGroupBy[] @@ -1158,7 +1246,7 @@

                - Returns : any + Returns : unknown
                @@ -1172,27 +1260,26 @@

                - + - Public - Async - pageChanged - + Private + getFilters + - pageChanged(event: PageChangedEvent, step: string) + getFilters(type: string) - + @@ -1213,19 +1300,7 @@

                - event - - PageChangedEvent - - - - No - - - - - - step + type string @@ -1240,7 +1315,7 @@

                - Returns : any + Returns : {}
                @@ -1254,26 +1329,26 @@

                - + - Private - runTemplate - + Public + getFilterSearchDisplayed + - runTemplate(templateString: string, imports: object) + getFilterSearchDisplayed(step: any) - + @@ -1294,21 +1369,9 @@

                - templateString - - string - - - - No - - - - - - imports + step - object + any @@ -1321,7 +1384,7 @@

                - Returns : any + Returns : boolean
                @@ -1335,27 +1398,26 @@

                - + Public - Async - sortChanged - + getFilterSearchString + - sortChanged(data: any) + getFilterSearchString(step: any) - + @@ -1376,7 +1438,7 @@

                - data + step any @@ -1391,7 +1453,7 @@

                - Returns : any + Returns : string
                @@ -1405,26 +1467,26 @@

                - + Private - updateSortMap - + getFirstFilter + - updateSortMap(sortData: any) + getFirstFilter(type: string) - + @@ -1445,9 +1507,9 @@

                - sortData + type - any + string @@ -1460,7 +1522,1143 @@

                - Returns : void + Returns : FilterField + +
                +
                + +
                + + + + + + + + + + + + + + + + + + + + + + + +
                + + + Private + getFirstTextFilter + + +
                + + getFirstTextFilter() +
                + +
                + +
                + Returns : FilterField + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Public + getIsSearching + + +
                + + getIsSearching(step: any) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                step + any + + No +
                +
                +
                + Returns : boolean + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Private + getSortString + + +
                + + getSortString(sortDetails: any) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                sortDetails + any + + No +
                +
                +
                + Returns : string + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Public + getTextFilters + + +
                + + getTextFilters() +
                + +
                + +
                + Returns : {} + +
                +
                + + + + + + + + + + + + + + + + + + + + + + +
                + + + Protected + + Async + initComponent + + +
                + + initComponent() +
                +
                Inherited from BaseComponent +
                +
                +
                Defined in BaseComponent:164 +
                +
                + +
                + Returns : Promise<void> + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Private + initSortConfig + + +
                + + initSortConfig(step: any) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                step + any + + No +
                +
                +
                + Returns : void + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Public + Async + initStep + + +
                + + initStep(stepName: string, evaluateStepName: string, recordType: string, packageType: string, startIndex: number) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                stepName + string + + No +
                evaluateStepName + string + + No +
                recordType + string + + No +
                packageType + string + + No +
                startIndex + number + + No +
                +
                +
                + Returns : any + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Private + initStepTableConfig + + +
                + + initStepTableConfig(recordType: string, step: any) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                recordType + string + + No +
                step + any + + No +
                +
                +
                + Returns : void + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Public + Async + initView + + +
                + + initView(recordType: string) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                recordType + string + + No +
                +
                +
                + Returns : any + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Private + Async + initWorkflowSteps + + +
                + + initWorkflowSteps(recordType: string) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                recordType + string + + No +
                +
                +
                + Returns : unknown + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Public + Async + pageChanged + + +
                + + pageChanged(event: PageChangedEvent, step: string) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                event + PageChangedEvent + + No +
                step + string + + No +
                +
                +
                + Returns : any + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Public + Async + resetFilterAndSearch + + +
                + + resetFilterAndSearch(step: string, e: any) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                step + string + + No +
                e + any + + No +
                +
                +
                + Returns : any + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Private + runTemplate + + +
                + + runTemplate(templateString: string, imports: object) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                templateString + string + + No +
                imports + object + + No +
                +
                +
                + Returns : any + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Public + setFilterField + + +
                + + setFilterField(filterField: FilterField, e: any) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                filterField + FilterField + + No +
                e + any + + No +
                +
                +
                + Returns : void + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + + + +
                + + + Public + Async + sortChanged + + +
                + + sortChanged(data: any) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                data + any + + No +
                +
                +
                + Returns : any + +
                +
                + +
                +
                + + + + + + + + + + + + + + + + + @@ -1761,7 +2959,7 @@

                @@ -1792,7 +2990,7 @@

                @@ -1823,7 +3021,7 @@

                @@ -1866,7 +3064,7 @@

                @@ -1897,7 +3095,7 @@

                @@ -1923,7 +3121,7 @@

                @@ -1954,7 +3152,7 @@

                @@ -1965,33 +3163,27 @@

                @@ -2002,27 +3194,48 @@

                @@ -2033,16 +3246,16 @@

                @@ -2053,7 +3266,7 @@

                @@ -2064,10 +3277,10 @@

                @@ -2084,7 +3297,7 @@

                @@ -2095,10 +3308,10 @@

                @@ -2152,7 +3365,193 @@

                + + + + +
                + + + Private + updateSortMap + + +
                + + updateSortMap(sortData: any) +
                + +
                + +
                + Parameters : + + + + + + + + + + + + + + + + + + + +
                NameTypeOptional
                sortData + any + + No +
                +
                +
                + Returns : void
                @@ -1730,7 +2928,7 @@

                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - + - defaultFormatRules - + defaultFilterField +
                - Type : any + Type : FilterField
                - Default value : { - filterBy: [], //filterBase can only have two values user or record - filterWorkflowStepsBy: [], //values: empty array (all) or a list with particular types i.e. [ 'draft', 'finalised' ] - sortBy: 'metaMetadata.lastSaveDate:-1', - groupBy: '', //values: empty (not grouped any order), groupedByRecordType, groupedByRelationships - sortGroupBy: [], //values: as many levels as required? - } + Default value : { name: this.filterFieldName, path: this.filterFieldPath }
                - +
                - + - defaultGroupRowConfig - + defaultFormatRules +
                - Type : object + Type : FormatRules
                - Default value : {} + Default value : { + filterBy: {}, //filterBase can only have two values user or record + filterWorkflowStepsBy: [], //values: empty array (all) or a list with particular types i.e. [ 'draft', 'finalised' ] + recordTypeFilterBy: '', + queryFilters: { + rdmp: [ + { + filterType: 'text', + filterFields: [ + { + name: 'Title', + path: 'metadata.title' + } + ] + } + ] + }, + sortBy: 'metaMetadata.lastSaveDate:-1', + groupBy: '', //values: empty (not grouped any order), groupedByRecordType, groupedByRelationships + sortGroupBy: [], //values: as many levels as required? + hideWorkflowStepTitleForRecordType: [] + }
                - +
                - + - defaultGroupRowRules - + defaultGroupRowConfig +
                - Type : any + Type : object
                - +
                - + - defaultRowLevelRules - + defaultGroupRowRules +
                - +
                - + - defaultTableConfig - + defaultRowConfig +
                - + +
                + + + + + + + + + + + + + + + + + +
                + + + defaultRowLevelRules + + +
                + Type : any + +
                + Default value : {} +
                + +
                + + + + + + + + + + + + + + + + + +
                + + + enableSort + + +
                + Type : boolean + +
                + Default value : true +
                + +
                + + + + + + + + + + + + + + + + + +
                + + + filterFieldName + + +
                + Type : string + +
                + Default value : 'Title' +
                + +
                + + + + + + + + + + + + + + + + + +
                + + + filterFieldPath + + +
                + Type : string + +
                + Default value : 'metadata.title' +
                + +
                + + + + + + + + + + + + + + + + + +
                + + + filterSearchString + + +
                + Type : any + +
                + Default value : {} +
                + +
                + + + + + + + + + + + + + @@ -2163,27 +3562,27 @@

                @@ -2194,10 +3593,10 @@

                @@ -2214,7 +3613,7 @@

                @@ -2225,16 +3624,47 @@

                + + + + + + + + + + +
                + + + formatRules + + +
                + Type : FormatRules + +
                + Default value : this.defaultFormatRules +
                +
                - + - enableSort - + groupRowConfig +
                - Type : boolean + Type : object
                - Default value : true + Default value : {}
                - +
                - + - formatRules - + groupRowRules +
                - +
                - + - groupRowConfig - + hideWorkflowStepTitle +
                - Type : object + Type : boolean + +
                + Default value : false +
                + +
                + + + + + + + @@ -2245,7 +3675,7 @@

                @@ -2256,10 +3686,10 @@

                @@ -2276,7 +3706,7 @@

                @@ -2302,7 +3732,7 @@

                @@ -2333,7 +3763,7 @@

                @@ -2364,7 +3794,7 @@

                @@ -2390,7 +3820,7 @@

                @@ -2421,7 +3851,7 @@

                @@ -2452,7 +3882,7 @@

                @@ -2478,7 +3908,7 @@

                @@ -2509,7 +3939,7 @@

                @@ -2540,7 +3970,7 @@

                @@ -2571,7 +4001,7 @@

                @@ -2602,7 +4032,7 @@

                @@ -2633,7 +4063,7 @@

                @@ -2837,10 +4267,11 @@

                import { Component, Inject, ElementRef } from '@angular/core';
                 import { PageChangedEvent } from 'ngx-bootstrap/pagination';
                -import { BaseComponent, UtilityService, LoggerService, TranslationService, RecordService, PlanTable, UserService, ConfigService } from '@researchdatabox/portal-ng-common';
                +import { BaseComponent, UtilityService, LoggerService, TranslationService, RecordService, PlanTable, UserService, ConfigService, FormatRules, SortGroupBy, QueryFilter, FilterField } from '@researchdatabox/portal-ng-common';
                 import { get as _get, set as _set, isEmpty as _isEmpty, isUndefined as _isUndefined, trim as _trim, isNull as _isNull, orderBy as _orderBy, map as _map, find as _find, indexOf as _indexOf, isArray as _isArray, forEach as _forEach, join as _join, first as _first } from 'lodash-es';
                 
                 import { LoDashTemplateUtilityService } from 'projects/researchdatabox/portal-ng-common/src/lib/lodash-template-utility.service';
                +import * as _ from 'lodash';
                 
                 @Component({
                   selector: 'dashboard',
                @@ -2865,8 +4296,15 @@ 

                rulesService: object; currentUser: object = {}; enableSort: boolean = true; - - defaultTableConfig = [ + filterFieldName: string = 'Title'; + filterFieldPath: string = 'metadata.title'; + defaultFilterField: FilterField = { name: this.filterFieldName, path: this.filterFieldPath }; + filterSearchString: any = {}; + hideWorkflowStepTitle: boolean = false; + isFilterSearchDisplayed: any = {}; + isSearching: any = {}; + + defaultRowConfig = [ { title: 'Record Title', variable: 'metadata.title', @@ -2927,14 +4365,29 @@

                sortFields = ['metaMetadata.lastSaveDate', 'metaMetadata.createdOn', 'metadata.title', 'metadata.contributor_ci.text_full_name', 'metadata.contributor_data_manager.text_full_name']; - defaultFormatRules: any = { - filterBy: [], //filterBase can only have two values user or record + defaultFormatRules: FormatRules = { + filterBy: {}, //filterBase can only have two values user or record filterWorkflowStepsBy: [], //values: empty array (all) or a list with particular types i.e. [ 'draft', 'finalised' ] + recordTypeFilterBy: '', + queryFilters: { + rdmp: [ + { + filterType: 'text', + filterFields: [ + { + name: 'Title', + path: 'metadata.title' + } + ] + } + ] + }, sortBy: 'metaMetadata.lastSaveDate:-1', groupBy: '', //values: empty (not grouped any order), groupedByRecordType, groupedByRelationships sortGroupBy: [], //values: as many levels as required? + hideWorkflowStepTitleForRecordType: [] }; - formatRules: any = {}; + formatRules: FormatRules = this.defaultFormatRules; defaultGroupRowConfig = {}; groupRowConfig = {}; @@ -2994,15 +4447,13 @@

                public async initView(recordType: string) { - //console.log('----------------------- initView -------------------------- '+this.dashboardTypeSelected); this.formatRules = this.defaultFormatRules; this.rowLevelRules = this.defaultRowLevelRules; this.groupRowConfig = this.defaultGroupRowConfig; this.groupRowRules = this.defaultGroupRowRules; - let dashboardType: any = await this.recordService.getDashboardType(this.dashboardTypeSelected); - let formatRules = _get(dashboardType, 'formatRules'); - let startIndex = 1; + let dashboardTypeConfig: any = await this.recordService.getDashboardType(this.dashboardTypeSelected); + let formatRules: FormatRules = _get(dashboardTypeConfig, 'formatRules'); if (!_isUndefined(formatRules) && !_isNull(formatRules) && !_isEmpty(formatRules)) { //global format rules from dashboardtype.js config this.formatRules = formatRules; @@ -3013,6 +4464,48 @@

                recordType = recordTypeFilterBy; } + for(let recType of formatRules.hideWorkflowStepTitleForRecordType) { + if(recType == recordType) { + this.hideWorkflowStepTitle = true; + } + } + + let steps = await this.initWorkflowSteps(recordType); + + let startIndex = 1; + for (let step of steps) { + + this.initStepTableConfig(recordType, step); + + this.initSortConfig(step); + + this.workflowSteps.push(step); + + let packageType = ''; + let stepName = ''; + let evaluateStepName = ''; + if (this.dashboardTypeSelected == 'consolidated') { + packageType = ''; + stepName = ''; + evaluateStepName = _get(step, 'name'); + recordType = _get(step, 'config.baseRecordType'); + } else if (this.dashboardTypeSelected == 'workspace') { + stepName = ''; + packageType = this.packageType; + evaluateStepName = _get(step, 'name'); + recordType = ''; + } else { + packageType = ''; + stepName = _get(step, 'name'); + evaluateStepName = stepName; + } + + await this.initStep(stepName, evaluateStepName, recordType, packageType, startIndex); + } + } + + private async initWorkflowSteps(recordType: string) { + let beforeFilterSteps: any = await this.recordService.getWorkflowSteps(recordType); let filterWorkflowStepsBy = _get(this.formatRules, 'filterWorkflowStepsBy'); @@ -3032,87 +4525,62 @@

                steps = beforeFilterSteps; } steps = _orderBy(steps, ['config.displayIndex'], ['asc']); + return steps; + } - for (let step of steps) { - - this.workflowSteps.push(step); - // console.log('----------------------- step -------------------------- '+step.config.workflow.stageLabel); - let stepTableConfig = this.defaultTableConfig; - if (_isEmpty(this.defaultTableConfig[0].title)) { - this.defaultTableConfig[0].title = `${recordType}-title` || 'Title'; - // console.log('----------------------- title -------------------------- '+this.defaultTableConfig[0].title); - } - if (!_isUndefined(_get(step, 'config.dashboard')) - && !_isUndefined(_get(step, 'config.dashboard.table'))) { - - if (!_isUndefined(_get(step, 'config.dashboard.table.rowConfig'))) { - stepTableConfig = _get(step, 'config.dashboard.table.rowConfig'); - this.sortFields = _map(_get(step, 'config.dashboard.table.rowConfig'), (config) => { return config.variable }); - } + private initStepTableConfig(recordType: string, step: any) { - if (!_isUndefined(_get(step, 'config.dashboard.table.rowRulesConfig'))) { - this.rowLevelRules = _get(step, 'config.dashboard.table.rowRulesConfig'); - console.log(JSON.stringify(this.rowLevelRules)); - } + let stepRowConfig = this.defaultRowConfig; - if (!_isUndefined(_get(step, 'config.dashboard.table.groupRowConfig'))) { - this.groupRowConfig = _get(step, 'config.dashboard.table.groupRowConfig'); - } + if (_isEmpty(this.defaultRowConfig[0].title)) { + this.defaultRowConfig[0].title = `${recordType}-title` || 'Title'; + } - if (!_isUndefined(_get(step, 'config.dashboard.table.groupRowRulesConfig'))) { - this.groupRowRules = _get(step, 'config.dashboard.table.groupRowRulesConfig'); - } + if (!_isUndefined(_get(step, 'config.dashboard')) + && !_isUndefined(_get(step, 'config.dashboard.table'))) { - //formtatRules override at step level from workflow.js config - if (!_isUndefined(_get(step, 'config.dashboard.table.formatRules'))) { - this.formatRules = _get(step, 'config.dashboard.table.formatRules'); - } + if (!_isUndefined(_get(step, 'config.dashboard.table.rowConfig'))) { + stepRowConfig = _get(step, 'config.dashboard.table.rowConfig'); + this.sortFields = _map(_get(step, 'config.dashboard.table.rowConfig'), (config) => { return config.variable; }); } - this.tableConfig[step.name] = stepTableConfig; - this.sortMap[step.name] = {}; - for (let rowConfig of stepTableConfig) { - this.sortMap[step.name][rowConfig.variable] = { - sort: rowConfig.initialSort - }; + if (!_isUndefined(_get(step, 'config.dashboard.table.rowRulesConfig'))) { + this.rowLevelRules = _get(step, 'config.dashboard.table.rowRulesConfig'); } - - if(this.dashboardTypeSelected == 'consolidated') { - this.enableSort = false; - } else { - this.enableSort = true; + + if (!_isUndefined(_get(step, 'config.dashboard.table.groupRowConfig'))) { + this.groupRowConfig = _get(step, 'config.dashboard.table.groupRowConfig'); } - if(this.dashboardTypeSelected == 'consolidated') { - this.enableSort = false; - } else { - this.enableSort = true; + if (!_isUndefined(_get(step, 'config.dashboard.table.groupRowRulesConfig'))) { + this.groupRowRules = _get(step, 'config.dashboard.table.groupRowRulesConfig'); } - let packageType = ''; - let stepName = ''; - let evaluateStepName = ''; - if (this.dashboardTypeSelected == 'consolidated') { - packageType = ''; - stepName = ''; - evaluateStepName = _get(step, 'name'); - recordType = _get(step, 'config.baseRecordType'); - } else if (this.dashboardTypeSelected == 'workspace') { - stepName = ''; - packageType = this.packageType; - evaluateStepName = _get(step, 'name'); - recordType = ''; - } else { - packageType = ''; - stepName = _get(step, 'name'); - evaluateStepName = stepName; + //formtatRules override at step level from workflow.js config + if (!_isUndefined(_get(step, 'config.dashboard.table.formatRules'))) { + this.formatRules = _get(step, 'config.dashboard.table.formatRules'); } + } - await this.initStep(stepName, evaluateStepName, recordType, packageType, startIndex); + this.tableConfig[step.name] = stepRowConfig; + } + + private initSortConfig(step: any) { + + let stepRowConfig: any[] = this.tableConfig[step.name]; + + this.sortMap[step.name] = {}; - // console.log('-------------------------------------------------'); - // console.log(JSON.stringify(this.records)); - // console.log('-------------------------------------------------'); + for (let columnConfig of stepRowConfig) { + this.sortMap[step.name][columnConfig.variable] = { + sort: columnConfig.initialSort + }; + } + + if (this.dashboardTypeSelected == 'consolidated') { + this.enableSort = false; + } else { + this.enableSort = true; } } @@ -3140,7 +4608,6 @@

                sortByString = sortBy; } - //TODO getRecords defaults to 10 perhaps add another param to set? let stagedRecords = await this.recordService.getRecords(recordType, stepName, startIndex, packageType, sortByString, filterFileds, filterString, filterMode); let planTable: PlanTable; @@ -3155,68 +4622,12 @@

                let sortGroupBy = _get(this.formatRules, 'sortGroupBy'); if (groupBy == 'groupedByRelationships' && !_isUndefined(sortGroupBy) && !_isEmpty(sortGroupBy)) { - for (let item of items) { - let oid = _get(item, 'oid'); - let itemsAfterApplyInnerGroupFormatRules = []; - - let itemsGroupRelated: any = await this.recordService.getRelatedRecords(oid); - let sortItems = _get(itemsGroupRelated, 'items'); - let totalSortItems = sortItems.length; - let countHerarchyLevels = sortGroupBy.length; - - for (let j = 0; j < totalSortItems; j++) { - let parentTreeNodeOid = oid; - for (let i = 0; i < countHerarchyLevels; i++) { - let rule = _find(sortGroupBy, function (o) { - if (_get(o, 'rowLevel') == i) { - return o; - } - }); - let compareField = _get(rule, 'compareField'); - let compareFieldValue = _get(rule, 'compareFieldValue'); - let relatedTo = _get(rule, 'relatedTo'); - - for (let sortItem of sortItems) { - let relatedToOid = _get(sortItem, relatedTo); - let foundParent = relatedToOid == parentTreeNodeOid; - let foundRecord = _get(sortItem, compareField) == compareFieldValue; - let foundTopLevelParent = relatedTo == ''; - if (foundRecord && (foundParent || foundTopLevelParent)) { - let currentOid = _get(sortItem, 'oid'); - let rowExists = _find(itemsAfterApplyInnerGroupFormatRules, ['oid', currentOid]); - if (_isUndefined(rowExists)) { - itemsAfterApplyInnerGroupFormatRules.push(sortItem); - if ((i + 1) < countHerarchyLevels) { - parentTreeNodeOid = currentOid; - break; - } - } - } - } - } - } - if (!_isEmpty(itemsAfterApplyInnerGroupFormatRules)) { - _set(itemsGroupRelated, 'items', itemsAfterApplyInnerGroupFormatRules); - } + allItemsByGroup = await this.getAllItemsGroupedByRelationships(items, sortGroupBy); - allItemsByGroup.push(itemsGroupRelated); - } } else if (groupBy == 'groupedByRecordType' && !_isUndefined(sortGroupBy) && !_isEmpty(sortGroupBy)) { - let countHerarchyLevels = sortGroupBy.length; - for (let i = 0; i < countHerarchyLevels; i++) { - - let rule = _find(sortGroupBy, function (o) { - if (_get(o, 'rowLevel') == i) { - return o; - } - }); - let compareFieldValue = _get(rule, 'compareFieldValue'); - let itemsGroupRelated: any = await this.recordService.getRecords(compareFieldValue, stepName, startIndex, packageType, sortByString, filterFileds, filterString, filterMode); - - allItemsByGroup.push(itemsGroupRelated); - } + allItemsByGroup = await this.getAllItemsGroupedByRecordType(sortGroupBy, stepName, startIndex, packageType, sortByString, filterFileds, filterString, filterMode); } let pageNumber = _get(stagedRecords, 'currentPage'); @@ -3233,11 +4644,90 @@

                } else { planTable = this.evaluatePlanTableColumns({}, {}, {}, evaluateStepName, stagedRecords); + + if (this.dashboardTypeSelected == 'standard') { + let filter: FilterField = this.getFirstTextFilter(); + this.filterFieldName = filter.name; + this.filterFieldPath = filter.path; + } } this.records[evaluateStepName] = planTable; } + private async getAllItemsGroupedByRecordType(sortGroupBy: SortGroupBy[], stepName: string, startIndex: number, packageType: string, sortByString: string, filterFileds: any, filterString: any, filterMode: any) { + let allItemsByGroup: any[] = []; + let countHerarchyLevels = sortGroupBy.length; + for (let i = 0; i < countHerarchyLevels; i++) { + + let rule = _find(sortGroupBy, function (o) { + if (_get(o, 'rowLevel') == i) { + return true; + } + return false; + }); + let compareFieldValue = _get(rule, 'compareFieldValue', ''); + let itemsGroupRelated: any = await this.recordService.getRecords(compareFieldValue, stepName, startIndex, packageType, sortByString, filterFileds, filterString, filterMode); + + allItemsByGroup.push(itemsGroupRelated); + } + + return allItemsByGroup; + } + + private async getAllItemsGroupedByRelationships(items: any, sortGroupBy: SortGroupBy[]) { + let allItemsByGroup: any[] = []; + for (let item of items) { + let oid = _get(item, 'oid'); + let itemsAfterApplyInnerGroupFormatRules = []; + + let itemsGroupRelated: any = await this.recordService.getRelatedRecords(oid); + let sortItems = _get(itemsGroupRelated, 'items'); + let totalSortItems = sortItems.length; + let countHerarchyLevels = sortGroupBy.length; + + for (let j = 0; j < totalSortItems; j++) { + let parentTreeNodeOid = oid; + for (let i = 0; i < countHerarchyLevels; i++) { + let rule = _find(sortGroupBy, function (o) { + if (_get(o, 'rowLevel') == i) { + return true; + } + return false; + }); + let compareField = _get(rule, 'compareField', ''); + let compareFieldValue = _get(rule, 'compareFieldValue', ''); + let relatedTo = _get(rule, 'relatedTo', ''); + + for (let sortItem of sortItems) { + let relatedToOid = _get(sortItem, relatedTo); + let foundParent = relatedToOid == parentTreeNodeOid; + let foundRecord = _get(sortItem, compareField) == compareFieldValue; + let foundTopLevelParent = relatedTo == ''; + if (foundRecord && (foundParent || foundTopLevelParent)) { + let currentOid = _get(sortItem, 'oid'); + let rowExists = _find(itemsAfterApplyInnerGroupFormatRules, ['oid', currentOid]); + if (_isUndefined(rowExists)) { + itemsAfterApplyInnerGroupFormatRules.push(sortItem); + if ((i + 1) < countHerarchyLevels) { + parentTreeNodeOid = currentOid; + break; + } + } + } + } + } + } + + if (!_isEmpty(itemsAfterApplyInnerGroupFormatRules)) { + _set(itemsGroupRelated, 'items', itemsAfterApplyInnerGroupFormatRules); + } + + allItemsByGroup.push(itemsGroupRelated); + } + return allItemsByGroup; + } + public evaluatePlanTableColumns(groupRowConfig: any, groupRowRules: any, rowLevelRulesConfig: any, stepName: string, stagedOrGroupedRecords: any): PlanTable { let recordRows: any = []; @@ -3279,14 +4769,11 @@

                let record: any = {}; + let stepRowConfig: any[] = this.tableConfig[stepName]; - let stepTableConfig = _isEmpty(this.tableConfig[stepName]) ? this.defaultTableConfig : this.tableConfig[stepName]; - - for (let rowConfig of stepTableConfig) { - - - const templateRes = this.runTemplate(rowConfig.template, imports) - record[rowConfig.variable] = templateRes; + for (let columnConfig of stepRowConfig) { + const templateRes = this.runTemplate(columnConfig.template, imports) + record[columnConfig.variable] = templateRes; } recordRows.push(record); } @@ -3322,15 +4809,12 @@

                _set(imports, 'portal', this.portal); _set(imports, 'translationService', this.translationService); - - let record: any = {}; - let stepTableCOnfig = _isEmpty(this.tableConfig[stepName]) ? this.defaultTableConfig : this.tableConfig[stepName]; - - for (let rowConfig of stepTableCOnfig) { + let stepRowConfig = this.tableConfig[stepName]; - const templateRes = this.runTemplate(rowConfig.template, imports); - record[rowConfig.variable] = templateRes; + for (let columnConfig of stepRowConfig) { + const templateRes = this.runTemplate(columnConfig.template, imports); + record[columnConfig.variable] = templateRes; } recordRows.push(record); } @@ -3342,9 +4826,6 @@

                return planTable; } - - - public evaluateRowLevelRules(rulesConfig: any, metadata: any, metaMetadata: any, workflow: any, oid: string, ruleSetName: string) { let res: any; @@ -3358,7 +4839,6 @@

                _set(imports, 'portal', this.portal); _set(imports, 'translationService', this.translationService); - let ruleSetConfig = _find(rulesConfig, ['ruleSetName', ruleSetName]); if (!_isUndefined(ruleSetConfig)) { @@ -3375,7 +4855,6 @@

                let evaluateRulesTemplate = _get(rule, 'evaluateRulesTemplate'); _set(imports, 'name', name); - let evaluatedAction = ''; let action = _get(rule, 'action'); @@ -3441,9 +4920,7 @@

                _set(imports, 'oid', oid); _set(imports, 'name', name); - - - const result = this.runTemplate(evaluateRulesTemplate, imports) + const result = this.runTemplate(evaluateRulesTemplate, imports); if (result == 'true') { results.push(result); } else if (mode == 'all') { @@ -3487,7 +4964,7 @@

                if (this.dashboardTypeSelected == 'workspace') { stagedRecords = await this.recordService.getRecords('', '', 1, this.dashboardTypeSelected, sortString); } else { - stagedRecords = await this.recordService.getRecords(this.recordType, data.step, 1, '', sortString); + stagedRecords = await this.recordService.getRecords(this.recordType, data.step, 1, '', sortString,this.filterFieldPath,this.getFilterSearchString(data.step)); } let planTable: PlanTable = this.evaluatePlanTableColumns({}, {}, {}, data.step, stagedRecords); @@ -3499,9 +4976,10 @@

                } private updateSortMap(sortData: any) { - let stepTableConfig = this.tableConfig[sortData.step]; - for (let rowConfig of stepTableConfig) { - this.sortMap[sortData.step][rowConfig.variable] = { sort: rowConfig.noSort }; + + let stepRowConfig: any[] = this.tableConfig[sortData.step]; + for (let columnConfig of stepRowConfig) { + this.sortMap[sortData.step][columnConfig.variable] = { sort: columnConfig.noSort }; } this.sortMap[sortData.step][sortData.variable] = { sort: sortData.sort }; @@ -3512,7 +4990,7 @@

                let sortDetails = this.sortMap[step]; if (this.dashboardTypeSelected == 'standard') { - let stagedRecords = await this.recordService.getRecords(this.recordType, step, event.page, '', this.getSortString(sortDetails)); + let stagedRecords = await this.recordService.getRecords(this.recordType, step, event.page, '', this.getSortString(sortDetails),this.filterFieldPath,this.getFilterSearchString(step)); let planTable: PlanTable = this.evaluatePlanTableColumns({}, {}, {}, step, stagedRecords); this.records[step] = planTable; } else if (this.dashboardTypeSelected == 'workspace') { @@ -3556,6 +5034,99 @@

                return 'metaMetadata.lastSaveDate:-1'; } + private getFirstFilter(type:string): FilterField { + try { + let queryFilters: QueryFilter[] = this.formatRules.queryFilters[this.recordType]; + for(let queryFilter of queryFilters) { + if(queryFilter.filterType == type) { + for(let filterField of queryFilter.filterFields) { + return filterField; + } + } + } + return this.defaultFilterField; + } catch(error) { + return this.defaultFilterField; + } + } + + private getFilters(type:string) { + let filterFields: FilterField[] = []; + let queryFilters: QueryFilter[] = this.formatRules.queryFilters[this.recordType]; + for(let queryFilter of queryFilters) { + if(queryFilter.filterType == type) { + for(let filterField of queryFilter.filterFields) { + filterFields.push(filterField); + } + } + } + return filterFields; + } + + private getFirstTextFilter(): FilterField { + return this.getFirstFilter('text'); + } + + public getTextFilters() { + return this.getFilters('text'); + } + + public getFilterSearchDisplayed(step: any): boolean { + let filterDisplayed = _.get(this.isFilterSearchDisplayed,step,''); + if(filterDisplayed == 'filterDisplayed') { + return true; + } else { + return false; + } + } + + public getIsSearching(step: any): boolean { + let searching = _.get(this.isSearching,step,''); + if(searching == 'searching') { + return true; + } else { + return false; + } + } + + public getFilterSearchString(step: any): string { + let filterString = _.get(this.filterSearchString,step,''); + return filterString; + } + + public async filterChanged(step: string) { + + if (this.dashboardTypeSelected == 'standard') { + this.isSearching[step] = 'searching'; + this.isFilterSearchDisplayed[step] = 'filterDisplayed'; + let sortDetails = this.sortMap[step]; + let stagedRecords = await this.recordService.getRecords(this.recordType, step, 1, '', this.getSortString(sortDetails),this.filterFieldPath,this.getFilterSearchString(step)); + let planTable: PlanTable = this.evaluatePlanTableColumns({}, {}, {}, step, stagedRecords); + this.records[step] = planTable; + this.isSearching[step] = ''; + } + } + + public async resetFilterAndSearch(step: string, e: any) { + if (this.dashboardTypeSelected == 'standard') { + this.setFilterField(this.getFirstTextFilter(), e); + this.isSearching[step] = 'searching'; + let sortDetails = this.sortMap[step]; + this.filterSearchString[step] = ''; + let stagedRecords = await this.recordService.getRecords(this.recordType, step, 1, '', this.getSortString(sortDetails),this.filterFieldPath,this.getFilterSearchString(step)); + let planTable: PlanTable = this.evaluatePlanTableColumns({}, {}, {}, step, stagedRecords); + this.records[step] = planTable; + this.isSearching[step] = ''; + } + } + + public setFilterField(filterField:FilterField, e: any) { + if (e) { + e.preventDefault(); + } + this.filterFieldName = filterField.name; + this.filterFieldPath = filterField.path; + } } @@ -3567,12 +5138,32 @@

                <div *ngIf="isReady">
                     <ng-container>
                         <div *ngFor="let workflowStep of workflowSteps">
                -            <h2 *ngIf="workflowSteps.length > 1 && (dashboardTypeSelected == 'standard' || dashboardTypeSelected == 'consolidated')" [innerHTML]="'dashboard-heading' | i18next: {stage: workflowStep.config.workflow.stageLabel, recordTypeName: typeLabel}">
                -            </h2>
                -            <h2 *ngIf="workflowSteps.length == 1 && (dashboardTypeSelected == 'standard' || dashboardTypeSelected == 'consolidated')" [innerHTML]="'dashboard-heading-one-step' | i18next: {recordTypeName: typeLabel}">
                -            </h2>
                +            <div class="d-flex flex-row">
                +              <div *ngIf="workflowSteps.length > 1 && (dashboardTypeSelected == 'standard' || dashboardTypeSelected == 'consolidated')" class="col-md-4">
                +                <h2>{{ 'dashboard-heading' | i18next: {stage: workflowStep.config.workflow.stageLabel, recordTypeName: typeLabel} }}</h2>
                +              </div>
                +              <div *ngIf="workflowSteps.length == 1 && !hideWorkflowStepTitle && (dashboardTypeSelected == 'standard' || dashboardTypeSelected == 'consolidated')" class="col-md-4">
                +                <h2>{{ 'dashboard-heading-one-step' | i18next: {recordTypeName: typeLabel} }}</h2>
                +              </div>
                +              <ng-container *ngIf="dashboardTypeSelected == 'standard' && (records[workflowStep.config.workflow.stage].totalItems > 0 || (records[workflowStep.config.workflow.stage].totalItems <= 0 && getFilterSearchDisplayed(workflowStep.config.workflow.stage)))">
                +                <div class="col-md-8">
                +                  <div class="d-flex flex-row mt-4">
                +                    <button class="btn btn-primary dropdown-toggle" type='button' data-bs-toggle="dropdown" aria-expanded="false" >Filter by {{ filterFieldName }}</button>
                +                    <ul class="dropdown-menu">
                +                      <li *ngFor="let filter of getTextFilters()"><a class="dropdown-item" href="#" (click)="setFilterField(filter, $event)">Filter by {{ filter.name }}</a></li>
                +                      <li><hr class="dropdown-divider"></li>
                +                      <li><a class="dropdown-item" href="#" (click)="resetFilterAndSearch(workflowStep.config.workflow.stage, $event)">{{ 'record-search-reset' | i18next }}</a></li>
                +                    </ul>
                +                    <input type="text" class="form-control" [(ngModel)]="filterSearchString[workflowStep.config.workflow.stage]" placeholder="{{ 'record-search-basic-search-placeholder' | i18next}}" (keyup.enter)="filterChanged(workflowStep.config.workflow.stage)" aria-describedby="basic-search-addon" autofocus>
                +                    <button class="btn btn-primary" type='button' aria-expanded="false" [disabled]="getIsSearching(workflowStep.config.workflow.stage) || getFilterSearchString(workflowStep.config.workflow.stage) == ''" (click)="filterChanged(workflowStep.config.workflow.stage)">{{ 'record-search-basic-search' | i18next }}</button>
                +                  </div>
                +                </div>
                +                <div class="col-md-4"></div>
                +              </ng-container>
                +            </div>
                             <div *ngIf="records[workflowStep.config.workflow.stage] != null">
                -                <div *ngIf="records[workflowStep.config.workflow.stage].totalItems <= 0" class="padding-bottom-10" [innerHTML]="'no-records' | i18next: {stage: workflowStep.config.workflow.stageLabel.toLowerCase(), recordTypeName: typeLabel.toLowerCase()}">
                +                <div *ngIf="records[workflowStep.config.workflow.stage].totalItems <= 0" class="padding-bottom-10" >
                +                    {{ 'no-records' | i18next: {stage: workflowStep.config.workflow.stageLabel.toLowerCase(), recordTypeName: typeLabel.toLowerCase()} }}
                                 </div>
                                 <div *ngIf="records[workflowStep.config.workflow.stage].totalItems > 0">
                                 <table class="table">
                @@ -3624,8 +5215,8 @@ 

                diff --git a/components/ExportComponent.html b/components/ExportComponent.html index 5024d7c4a8..49128ecc03 100644 --- a/components/ExportComponent.html +++ b/components/ExportComponent.html @@ -1720,7 +1720,7 @@

                diff --git a/components/FormBaseComponent.html b/components/FormBaseComponent.html index 63dc51f19c..8effcece05 100644 --- a/components/FormBaseComponent.html +++ b/components/FormBaseComponent.html @@ -170,7 +170,7 @@

                File

                diff --git a/components/FormComponent.html b/components/FormComponent.html index 7a54249779..c9fd4159d3 100644 --- a/components/FormComponent.html +++ b/components/FormComponent.html @@ -1158,7 +1158,7 @@

                diff --git a/components/FormFieldWrapperComponent.html b/components/FormFieldWrapperComponent.html index b470e72120..522f4c406f 100644 --- a/components/FormFieldWrapperComponent.html +++ b/components/FormFieldWrapperComponent.html @@ -488,7 +488,7 @@

                diff --git a/components/LocalAuthComponent.html b/components/LocalAuthComponent.html index 92e01ce75d..3351be0d9e 100644 --- a/components/LocalAuthComponent.html +++ b/components/LocalAuthComponent.html @@ -1275,7 +1275,7 @@

                diff --git a/components/ManageRolesComponent.html b/components/ManageRolesComponent.html index e9a35581c0..b34818d49d 100644 --- a/components/ManageRolesComponent.html +++ b/components/ManageRolesComponent.html @@ -1973,7 +1973,7 @@

                diff --git a/components/ManageUsersComponent.html b/components/ManageUsersComponent.html index 8e918d98f8..5d4d739ac6 100644 --- a/components/ManageUsersComponent.html +++ b/components/ManageUsersComponent.html @@ -3481,7 +3481,7 @@

                diff --git a/components/ObjectTypeComponent.html b/components/ObjectTypeComponent.html new file mode 100644 index 0000000000..1d2c37e1df --- /dev/null +++ b/components/ObjectTypeComponent.html @@ -0,0 +1,330 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
                +
                + + +
                +
                + + + + + + + + +
                +

                +

                File

                +

                +

                + angular/projects/researchdatabox/app-config/src/app/fieldTypes/object.type.ts +

                + + + +

                +

                Extends

                +

                +

                + FieldType +

                + + + +
                +

                Metadata

                +

                + + + isFilterSearchDisplayed + + +
                + Type : any
                - +
                - + - groupRowRules - + isSearching +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                - +
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                +
                import { Component } from '@angular/core'; 
                +import { FieldType } from '@ngx-formly/core'; 
                +@Component({ 
                +    selector: 'formly-object-type', 
                +    template: `
                +    <div class="mb-3">
                +      <legend *ngIf="props.label">{{ props.label }}</legend>
                +      <p *ngIf="props.description">{{ props.description }}</p>
                +      <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
                +        <formly-validation-message [field]="field"></formly-validation-message>
                +      </div>
                +      <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
                +    </div>
                +  `, }) 
                +export class ObjectTypeComponent extends FieldType { }
                +
                + + + +
                +
                +
                +
                + Legend +
                +
                +
                Html element +
                +
                +
                Component +
                +
                +
                Html element with directive +
                +
                +
                + + + + + + + + + + + + + + + + + + + + + + + + + + +
                +
                +

                results matching ""

                +
                  +
                  +
                  +

                  No results matching ""

                  +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/RecordTableComponent.html b/components/RecordTableComponent.html index 1a2ab95e52..c36e830d47 100644 --- a/components/RecordTableComponent.html +++ b/components/RecordTableComponent.html @@ -1520,7 +1520,7 @@

                  diff --git a/components/ReportComponent.html b/components/ReportComponent.html index de6303ed27..9614b26b9b 100644 --- a/components/ReportComponent.html +++ b/components/ReportComponent.html @@ -1963,7 +1963,7 @@

                  diff --git a/components/SortComponent.html b/components/SortComponent.html index 36aaf84ec0..66e63cdcd6 100644 --- a/components/SortComponent.html +++ b/components/SortComponent.html @@ -493,7 +493,7 @@

                  diff --git a/components/TextAreaComponent.html b/components/TextAreaComponent.html index bd53c87e69..d81fe0025b 100644 --- a/components/TextAreaComponent.html +++ b/components/TextAreaComponent.html @@ -8,1003 +8,78 @@ - - + + + - -

                • @researchdatabox/sails-hook-redbox-storage-mongo : ^1.4.5
                • @researchdatabox/sails-ng-common : ^0.1.0
                • - @tsconfig/node18 : ^18.2.2
                • + @tsconfig/node18 : ^18.2.4
                • agenda : github:redbox-mint-contrib/agenda#dist
                • async : 3.2.5
                • - axios : ^1.6.8
                • + axios : ^1.7.3
                • bcryptjs : ^2.4.3
                • @@ -132,15 +132,15 @@
                • copy-webpack-plugin : ^12.0.2
                • - core-js : ^3.36.1
                • + core-js : ^3.37.1
                • - css-loader : ^6.10.0
                • + css-loader : ^7.1.2
                • - css-minimizer-webpack-plugin : ^6.0.0
                • + css-minimizer-webpack-plugin : ^7.0.0
                • csv-parser : ^3.0.0
                • - csv-stringify : ^6.4.6
                • + csv-stringify : ^6.5.1
                • dotenv : ^16.4.5
                • @@ -153,16 +153,22 @@ font-awesome-sass : 4.7.0
                • fs-extra : ^11.2.0
                • +
                • + genson-js : ^0.0.8
                • +
                • + glob : ^11.0.0
                • har-validator : 5.1.5
                • - i18next : 23.10.1
                • + i18next : ^23.12.2
                • - i18next-fs-backend : ^2.3.1
                • + i18next-fs-backend : ^2.3.2
                • include-all : ^4.0.3
                • jquery : ^3.7.1
                • +
                • + language-data-commons-vocabs : github:Language-Research-Technology/language-data-commons-vocabs
                • less : ^4.2.0
                • @@ -176,19 +182,23 @@
                • luxon : ^3.4.4
                • - mini-css-extract-plugin : ^2.8.1
                • + mini-css-extract-plugin : ^2.9.0
                • moment : ^2.30.1
                • - mongodb : ^6.5.0
                • + mongodb : ^6.3.0
                • node-cache : ^5.1.2
                • node-schedule : ^2.1.1
                • - nodemailer : ^6.9.13
                • + nodemailer : ^6.9.14
                • numeral : ^2.0.6
                • +
                • + nyc : ^17.0.0
                • +
                • + oni-ocfl : github:Language-Research-Technology/oni-ocfl
                • openid-client : ^5.6.5
                • @@ -200,7 +210,7 @@
                • passport-local : ^1.0.0
                • - postcss : ^8.4.37
                • + postcss : ^8.4.40
                • rc : 1.2.8
                • @@ -210,17 +220,17 @@
                • rxjs-compat : 6.6.7
                • - sails : ^1.5.10
                • + sails : ^1.5.11
                • sails-hook-orm : ^4.0.3
                • sails-hook-sockets : ^3.0.0
                • - sails-mongo : ^2.1.0
                • + sails-mongo : ^2.1.1
                • - sass : ^1.72.0
                • + sass : ^1.77.8
                • - sass-loader : ^14.1.1
                • + sass-loader : ^16.0.0
                • skipper : ^0.9.4
                • @@ -228,23 +238,27 @@
                • solr-client : ^0.9.0
                • - style-loader : ^3.3.4
                • + style-loader : ^4.0.0
                • - systemjs : 6.14.3
                • + systemjs : 6.15.1
                • ts-node : ^10.9.2
                • tus-node-server : ^0.9.0
                • typescript : 5.4
                • +
                • + typescript-json-schema : ^0.64.0
                • typescript-require : ~0.3.0
                • url-pattern : ^1.0.3
                • - webpack : ^5.91.0
                • + webpack : ^5.93.0 +
                • + wkt-parser-helper : ^4.1.0
                • - zone.js : ^0.14.4
                • + zone.js : ^0.14.8 diff --git a/graph/dependencies.svg b/graph/dependencies.svg index bb8632b03a..e49c621a34 100644 --- a/graph/dependencies.svg +++ b/graph/dependencies.svg @@ -4,595 +4,691 @@ - + dependencies - -Legend - -  Declarations - -  Module - -  Bootstrap - -  Providers - -  Exports + +Legend + +  Declarations + +  Module + +  Bootstrap + +  Providers + +  Exports -cluster_DashboardModule - +cluster_AppConfigModule + -cluster_DashboardModule_declarations - - - -cluster_DashboardModule_imports - +cluster_AppConfigModule_declarations + -cluster_DashboardModule_bootstrap - +cluster_AppConfigModule_imports + +cluster_AppConfigModule_bootstrap + + + +cluster_DashboardModule + + + +cluster_DashboardModule_declarations + + + +cluster_DashboardModule_bootstrap + + + cluster_ExportModule - + - + cluster_ExportModule_declarations - + - + cluster_ExportModule_bootstrap - + - + cluster_FormModule - + - + cluster_FormModule_declarations - + - + cluster_FormModule_FormComponent_providers - + - + cluster_FormModule_bootstrap - + - + cluster_FormModule_providers - + - + cluster_LocalAuthModule - + - + cluster_LocalAuthModule_declarations - + - + cluster_LocalAuthModule_bootstrap - + - + cluster_ManageRolesModule - + - + cluster_ManageRolesModule_declarations - + - + cluster_ManageRolesModule_bootstrap - + - + cluster_ManageUsersModule - + - + cluster_ManageUsersModule_declarations - + - + cluster_ManageUsersModule_bootstrap - + - + cluster_RedboxPortalCoreModule - + - + cluster_RedboxPortalCoreModule_declarations - + - + cluster_RedboxPortalCoreModule_exports - + - + cluster_RedboxPortalCoreModule_providers - + - + cluster_ReportModule - + - + cluster_ReportModule_declarations - + - + cluster_ReportModule_bootstrap - + - + -DashboardComponent - -DashboardComponent +AppConfigComponent + +AppConfigComponent - - -DashboardModule - -DashboardModule + + +AppConfigModule + +AppConfigModule - + -DashboardComponent->DashboardModule - - +AppConfigComponent->AppConfigModule + + - + -SortComponent - -SortComponent +ArrayTypeComponent + +ArrayTypeComponent - + -SortComponent->DashboardModule - - +ArrayTypeComponent->AppConfigModule + + - - -DashboardComponent - -DashboardComponent + + +ObjectTypeComponent + +ObjectTypeComponent - + + +ObjectTypeComponent->AppConfigModule + + + + + +TextAreaComponent + +TextAreaComponent + + -DashboardModule->DashboardComponent - - +TextAreaComponent->AppConfigModule + + + + + +AppConfigComponent + +AppConfigComponent + + + +AppConfigModule->AppConfigComponent + + - + RedboxPortalCoreModule - -RedboxPortalCoreModule + +RedboxPortalCoreModule + + + +RedboxPortalCoreModule->AppConfigModule + + + + + +DashboardModule + +DashboardModule - + RedboxPortalCoreModule->DashboardModule - - + + - + ExportModule - -ExportModule + +ExportModule - + RedboxPortalCoreModule->ExportModule - - + + - + FormModule - -FormModule + +FormModule - + RedboxPortalCoreModule->FormModule - - + + - + LocalAuthModule - -LocalAuthModule + +LocalAuthModule - + RedboxPortalCoreModule->LocalAuthModule - - + + - + ManageRolesModule - -ManageRolesModule + +ManageRolesModule - + RedboxPortalCoreModule->ManageRolesModule - - + + - + ManageUsersModule - -ManageUsersModule + +ManageUsersModule - + RedboxPortalCoreModule->ManageUsersModule - - + + - + RecordTableComponent - -RecordTableComponent + +RecordTableComponent - + RedboxPortalCoreModule->RecordTableComponent - - + + - + ReportModule - -ReportModule + +ReportModule - + RedboxPortalCoreModule->ReportModule - - + + + + + +DashboardComponent + +DashboardComponent + + + +DashboardComponent->DashboardModule + + + + + +SortComponent + +SortComponent + + + +SortComponent->DashboardModule + + + + + +DashboardComponent + +DashboardComponent + + + +DashboardModule->DashboardComponent + + - + ExportComponent - -ExportComponent + +ExportComponent - + ExportComponent->ExportModule - - + + - + ExportComponent - -ExportComponent + +ExportComponent - + ExportModule->ExportComponent - - + + - + FormComponent - -FormComponent + +FormComponent - + FormComponent->FormModule - - + + - + FormFieldWrapperComponent - -FormFieldWrapperComponent + +FormFieldWrapperComponent - + FormFieldWrapperComponent->FormModule - - + + - + FormFieldWrapperDirective - -FormFieldWrapperDirective + +FormFieldWrapperDirective - + FormFieldWrapperDirective->FormModule - - + + - + TextFieldComponent - -TextFieldComponent + +TextFieldComponent - + TextFieldComponent->FormModule - - + + - + FormComponent - -FormComponent + +FormComponent - + FormModule->FormComponent - - + + - + Location - -Location + +Location - + Location->FormComponent - - + + - + { provide: LocationStrategy, useClass: PathLocationStrategy } - -{ provide: LocationStrategy, useClass: PathLocationStrategy } + +{ provide: LocationStrategy, useClass: PathLocationStrategy } - + { provide: LocationStrategy, useClass: PathLocationStrategy }->FormComponent - - + + - + FormService - -FormService + +FormService - + FormService->FormModule - - + + - + LocalAuthComponent - -LocalAuthComponent + +LocalAuthComponent - + LocalAuthComponent->LocalAuthModule - - + + - + LocalAuthComponent - -LocalAuthComponent + +LocalAuthComponent - + LocalAuthModule->LocalAuthComponent - - + + - + ManageRolesComponent - -ManageRolesComponent + +ManageRolesComponent - + ManageRolesComponent->ManageRolesModule - - + + - + ManageRolesComponent - -ManageRolesComponent + +ManageRolesComponent - + ManageRolesModule->ManageRolesComponent - - + + - + ManageUsersComponent - -ManageUsersComponent + +ManageUsersComponent - + ManageUsersComponent->ManageUsersModule - - + + - + ManageUsersComponent - -ManageUsersComponent + +ManageUsersComponent - + ManageUsersModule->ManageUsersComponent - - + + - + RecordTableComponent - -RecordTableComponent + +RecordTableComponent - + RecordTableComponent->RedboxPortalCoreModule - - + + + + + +AppConfigService + +AppConfigService + + + +AppConfigService->RedboxPortalCoreModule + + - + ConfigService - -ConfigService + +ConfigService - + ConfigService->RedboxPortalCoreModule - - + + - + CsrfInterceptor - -CsrfInterceptor + +CsrfInterceptor - + CsrfInterceptor->RedboxPortalCoreModule - - + + - + LoggerService - -LoggerService + +LoggerService - + LoggerService->RedboxPortalCoreModule - - + + - + RecordService - -RecordService + +RecordService - + RecordService->RedboxPortalCoreModule - - + + - + ReportService - -ReportService + +ReportService - + ReportService->RedboxPortalCoreModule - - + + - + TranslationService - -TranslationService + +TranslationService - + TranslationService->RedboxPortalCoreModule - - + + - + UserService - -UserService + +UserService - + UserService->RedboxPortalCoreModule - - + + - + UtilityService - -UtilityService + +UtilityService - + UtilityService->RedboxPortalCoreModule - - + + - + ReportComponent - -ReportComponent + +ReportComponent - + ReportComponent->ReportModule - - + + - + ReportComponent - -ReportComponent + +ReportComponent - + ReportModule->ReportComponent - - + + diff --git a/images/coverage-badge-documentation.svg b/images/coverage-badge-documentation.svg index f00accc4ed..94eca357f2 100644 --- a/images/coverage-badge-documentation.svg +++ b/images/coverage-badge-documentation.svg @@ -4,6 +4,6 @@ documentation - 16% + 13% diff --git a/injectables/AppConfigService.html b/injectables/AppConfigService.html new file mode 100644 index 0000000000..7fc89766f1 --- /dev/null +++ b/injectables/AppConfigService.html @@ -0,0 +1,1243 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
                  +
                  + + +
                  +
                  + + + + + + + + + + + + +
                  +
                  +

                  +

                  File

                  +

                  +

                  + angular/projects/researchdatabox/portal-ng-common/src/lib/appconfig.service.ts +

                  + + +

                  +

                  Description

                  +

                  +

                  +

                  User-centric functions.

                  +

                  Note: functions will be ported over as these are consumed by the apps/

                  +

                  Author: Shilo Banihit

                  + +

                  + +

                  +

                  Extends

                  +

                  +

                  + HttpClientService +

                  + + +
                  +

                  Index

                  + + + + + + + + + + + + + + + + + + + + + +
                  +
                  Properties
                  +
                  + +
                  +
                  Methods
                  +
                  + +
                  +
                  + +
                  +

                  Constructor

                  + + + + + + + + + + + + + +
                  +constructor(http: HttpClient, rootContext: string, utilService: UtilityService, configService: ConfigService, loggerService: LoggerService) +
                  + +
                  +
                  + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  NameTypeOptional
                  http + HttpClient + + No +
                  rootContext + string + + No +
                  utilService + UtilityService + + No +
                  configService + ConfigService + + No +
                  loggerService + LoggerService + + No +
                  +
                  +
                  +
                  + +
                  + +

                  + Methods +

                  + + + + + + + + + + + + + + + + + + + +
                  + + + Public + Async + getAppConfigForm + + +
                  + + getAppConfigForm(appConfigId: string) +
                  + +
                  + +
                  + Parameters : + + + + + + + + + + + + + + + + + + + +
                  NameTypeOptional
                  appConfigId + string + + No +
                  +
                  +
                  + Returns : Promise<AppConfig> + +
                  +
                  + +
                  +
                  + + + + + + + + + + + + + + + + + + + +
                  + + + Public + Async + saveAppConfig + + +
                  + + saveAppConfig(appConfigId: string, model: any) +
                  + +
                  + +
                  + Parameters : + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  NameTypeOptional
                  appConfigId + string + + No +
                  model + any + + No +
                  +
                  +
                  + Returns : Promise<AppConfig> + +
                  +
                  + +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + +
                  + + + Public + + Async + waitForInit + + +
                  + + waitForInit() +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + +
                  + Returns : Promise<any> + +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + +
                  + + + Protected + enableCsrfHeader + + +
                  + + enableCsrfHeader() +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  +

                  Call from extending class to enable CSRF in the header

                  +
                  + +
                  + Returns : void + +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + +
                  + + + Public + getConfig + + +
                  + + getConfig() +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  +

                  Returns the config block

                  +
                  + +
                  + Returns : any + +
                  +
                  + +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + +
                  + + + Public + getInitSubject + + +
                  + + getInitSubject() +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + +
                  + Returns : Subject<any> + +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + +
                  + + + Public + isInitializing + + +
                  + + isInitializing() +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  +

                  Default checks if we've loaded the config. Extensions can add more conditions as needed.

                  +
                  + +
                  + Returns : boolean + +
                  +
                  +

                  true if service is ready

                  + +
                  +
                  +
                  +
                  + +

                  + Properties +

                  + + + + + + + + + + + + + + + + + +
                  + + + Private + requestOptions + + +
                  + Type : any + +
                  + Default value : null as any +
                  + +
                  + + + + + + + + + + + + + + + + + + + + +
                  + + + + Public + + rootContext + + +
                  + Type : string + +
                  + Decorators : +
                  + + @Inject(APP_BASE_HREF)
                  +
                  +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + + + + + + + + + + + + + + + + + +
                  + + + Public + baseUrl + + +
                  + Type : string + +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + + + + + + + + + + + + + + + + + +
                  + + + Public + baseUrlWithContext + + +
                  + Type : string + +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + + + + + + + + + + + + + + + + + +
                  + + + Public + brandingAndPortalUrl + + +
                  + Type : string + +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + + + + + + + + + + + + + + + + + +
                  + + + Protected + config + + +
                  + Type : any + +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + + + + + + + + + + + + + + + + + + + + +
                  + + + Protected + httpContext + + +
                  + Type : HttpContext + +
                  + Default value : null as any +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + + + + + + + + + + + + + + + + + +
                  + + + Protected + initSubject + + +
                  + Type : any + +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  + + + + + + + + + + + + + + + + + + + + +
                  + + + Protected + reqOptsJsonBodyOnly + + +
                  + Type : any + +
                  + Default value : {responseType: 'json', observe: 'body'} +
                  +
                  Inherited from HttpClientService +
                  +
                  + +
                  +
                  + +
                  + + +
                  +
                  import { map, firstValueFrom } from 'rxjs';
                  +import { Inject, Injectable } from '@angular/core';
                  +import { HttpClient } from '@angular/common/http';
                  +import { APP_BASE_HREF } from '@angular/common';
                  +
                  +import { ConfigService } from './config.service';
                  +import { UtilityService } from './utility.service';
                  +import { HttpClientService } from './httpClient.service';
                  +import { LoggerService } from './logger.service';
                  +import { merge as _merge } from 'lodash-es';
                  +
                  +export interface AppConfig {
                  +  schema: object;
                  +  model: object;
                  +  fieldOrder:string[];
                  +}
                  +
                  +
                  +/**
                  + * User-centric functions. 
                  + * 
                  + * Note: functions will be ported over as these are consumed by the apps/
                  + *
                  + * Author: <a href='https://github.com/shilob' target='_blank'>Shilo Banihit</a>
                  + *
                  + * 
                  + */
                  +@Injectable()
                  +export class AppConfigService extends HttpClientService {
                  +
                  +  private requestOptions:any = null as any;
                  +  
                  +  constructor( 
                  +    @Inject(HttpClient) protected override http: HttpClient, 
                  +    @Inject(APP_BASE_HREF) public override rootContext: string,
                  +    @Inject(UtilityService) protected override utilService: UtilityService,
                  +    @Inject(ConfigService) protected override configService: ConfigService,
                  +    @Inject(LoggerService) private loggerService: LoggerService
                  +  ) {
                  +    super(http, rootContext, utilService, configService);
                  +  }
                  +  
                  +  public override async waitForInit(): Promise<any> {
                  +    await super.waitForInit();
                  +    this.requestOptions = this.reqOptsJsonBodyOnly;
                  +    this.enableCsrfHeader();
                  +    _merge(this.requestOptions, {context: this.httpContext});
                  +    return this;
                  +  }
                  +
                  +  
                  +
                  +  public async getAppConfigForm(appConfigId:string): Promise<AppConfig> {
                  +    let url = `${this.brandingAndPortalUrl}/appconfig/form/${appConfigId}`;
                  +    const req = this.http.get<AppConfig>(url, {responseType: 'json', observe: 'body', context: this.httpContext});
                  +    req.pipe(
                  +      map((data:any) => {
                  +        return data as AppConfig;
                  +      })
                  +    );
                  +    let result = await firstValueFrom(req);
                  +    return result;
                  +  } 
                  +
                  +  public async saveAppConfig(appConfigId:string, model:any): Promise<AppConfig> {
                  +    let url = `${this.brandingAndPortalUrl}/appconfig/form/${appConfigId}`;
                  +    const req = this.http.post<AppConfig>(url, model, {responseType: 'json', observe: 'body', context: this.httpContext});
                  +    req.pipe(
                  +      map((data:any) => {
                  +        return data as AppConfig;
                  +      })
                  +    );
                  +    let result = await firstValueFrom(req);
                  +    return result;
                  +  } 
                  +
                  +  
                  +}
                  +
                  + +
                  + + + + + + + + + + + + + +
                  +
                  +

                  results matching ""

                  +
                    +
                    +
                    +

                    No results matching ""

                    +
                    +
                    +
                    + +
                    +
                    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interfaces/AppConfig.html b/interfaces/AppConfig.html new file mode 100644 index 0000000000..33b757b50b --- /dev/null +++ b/interfaces/AppConfig.html @@ -0,0 +1,436 @@ + + + + + + ReDBox Portal - NG2 Apps + + + + + + + + + + + + + + + +
                    +
                    + + +
                    +
                    + + + + + + + + + + + + + + + + + +
                    +
                    +

                    +

                    File

                    +

                    +

                    + angular/projects/researchdatabox/portal-ng-common/src/lib/appconfig.service.ts +

                    + + + + +
                    +

                    Index

                    + + + + + + + + + +
                    +
                    Properties
                    +
                    + +
                    +
                    + + + +
                    +

                    Properties

                    + + + + + + + + + + + + + + + + + + + +
                    + + fieldOrder + + + + +
                    + fieldOrder: string[] + +
                    + Type : string[] + +
                    + + + + + + + + + + + + + + + + + + + +
                    + + model + + + + +
                    + model: object + +
                    + Type : object + +
                    + + + + + + + + + + + + + + + + + + + +
                    + + schema + + + + +
                    + schema: object + +
                    + Type : object + +
                    +
                    +
                    + + +
                    +
                    import { map, firstValueFrom } from 'rxjs';
                    +import { Inject, Injectable } from '@angular/core';
                    +import { HttpClient } from '@angular/common/http';
                    +import { APP_BASE_HREF } from '@angular/common';
                    +
                    +import { ConfigService } from './config.service';
                    +import { UtilityService } from './utility.service';
                    +import { HttpClientService } from './httpClient.service';
                    +import { LoggerService } from './logger.service';
                    +import { merge as _merge } from 'lodash-es';
                    +
                    +export interface AppConfig {
                    +  schema: object;
                    +  model: object;
                    +  fieldOrder:string[];
                    +}
                    +
                    +
                    +/**
                    + * User-centric functions. 
                    + * 
                    + * Note: functions will be ported over as these are consumed by the apps/
                    + *
                    + * Author: <a href='https://github.com/shilob' target='_blank'>Shilo Banihit</a>
                    + *
                    + * 
                    + */
                    +@Injectable()
                    +export class AppConfigService extends HttpClientService {
                    +
                    +  private requestOptions:any = null as any;
                    +  
                    +  constructor( 
                    +    @Inject(HttpClient) protected override http: HttpClient, 
                    +    @Inject(APP_BASE_HREF) public override rootContext: string,
                    +    @Inject(UtilityService) protected override utilService: UtilityService,
                    +    @Inject(ConfigService) protected override configService: ConfigService,
                    +    @Inject(LoggerService) private loggerService: LoggerService
                    +  ) {
                    +    super(http, rootContext, utilService, configService);
                    +  }
                    +  
                    +  public override async waitForInit(): Promise<any> {
                    +    await super.waitForInit();
                    +    this.requestOptions = this.reqOptsJsonBodyOnly;
                    +    this.enableCsrfHeader();
                    +    _merge(this.requestOptions, {context: this.httpContext});
                    +    return this;
                    +  }
                    +
                    +  
                    +
                    +  public async getAppConfigForm(appConfigId:string): Promise<AppConfig> {
                    +    let url = `${this.brandingAndPortalUrl}/appconfig/form/${appConfigId}`;
                    +    const req = this.http.get<AppConfig>(url, {responseType: 'json', observe: 'body', context: this.httpContext});
                    +    req.pipe(
                    +      map((data:any) => {
                    +        return data as AppConfig;
                    +      })
                    +    );
                    +    let result = await firstValueFrom(req);
                    +    return result;
                    +  } 
                    +
                    +  public async saveAppConfig(appConfigId:string, model:any): Promise<AppConfig> {
                    +    let url = `${this.brandingAndPortalUrl}/appconfig/form/${appConfigId}`;
                    +    const req = this.http.post<AppConfig>(url, model, {responseType: 'json', observe: 'body', context: this.httpContext});
                    +    req.pipe(
                    +      map((data:any) => {
                    +        return data as AppConfig;
                    +      })
                    +    );
                    +    let result = await firstValueFrom(req);
                    +    return result;
                    +  } 
                    +
                    +  
                    +}
                    +
                    +
                    + + + + + + + + +
                    +
                    +

                    results matching ""

                    +
                      +
                      +
                      +

                      No results matching ""

                      +
                      +
                      +
                      + +
                      +
                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/js/menu-wc.js b/js/menu-wc.js index 84c2011f5c..a2c1bdff1c 100644 --- a/js/menu-wc.js +++ b/js/menu-wc.js @@ -104,17 +104,43 @@ customElements.define('compodoc-menu', class extends HTMLElement {