Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/angular/ini-1.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbrazzatti committed Apr 29, 2021
2 parents 2f8083b + daac577 commit d4182ca
Show file tree
Hide file tree
Showing 128 changed files with 8,408 additions and 4,815 deletions.
55 changes: 51 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
at: /home/circleci/project
- run: export NVM_DIR=/opt/circleci/.nvm && source /opt/circleci/.nvm/nvm.sh && nvm install 12.16.0 && nvm use 12.16.0
- run: export NVM_DIR=/opt/circleci/.nvm && source /opt/circleci/.nvm/nvm.sh && nvm use 12.16.0 && node_modules/.bin/tsc -p tsconfig-codecov.json
- run: (cd support/integration-testing && docker-compose -f docker-compose.newman.yml up --abort-on-container-exit --exit-code-from redboxportal && docker-compose -f docker-compose.mocha.yml up --abort-on-container-exit --exit-code-from redboxportal)
- run: (sudo chmod -R 777 . && cd support/integration-testing && sudo mkdir -p .tmp/attachments/staging && sudo chmod -R 777 . && docker-compose -f docker-compose.newman.yml up --abort-on-container-exit --exit-code-from redboxportal && docker-compose -f docker-compose.mocha.yml up --abort-on-container-exit --exit-code-from redboxportal)
- run: export NVM_DIR=/opt/circleci/.nvm && source /opt/circleci/.nvm/nvm.sh && nvm use 12.16.0 && npm i -g codecov && codecov -t $CODECOV_TOKEN
- run: export NVM_DIR=/opt/circleci/.nvm && source /opt/circleci/.nvm/nvm.sh && nvm use 12.16.0 && node_modules/.bin/tsc
deploy:
Expand All @@ -62,7 +62,7 @@ jobs:
| sed 's/[", \t]//g')
RBPORTAL_FILENAME=$(ls redbox-portal-*.tgz)
curl -v -u $MAVEN_USER:$MAVEN_PASSWORD --upload-file $RBPORTAL_FILENAME "https://nexus-prod.redboxresearchdata.com.au/nexus/repository/maven-snapshots/au/edu/qcif/redbox-portal/${PACKAGE_VERSION}-SNAPSHOT/redbox-portal-${PACKAGE_VERSION}-SNAPSHOT.tgz"
deploy-bcryotjs:
deploy-bcryptjs:
docker:
- image: 'cimg/base:stable'
steps:
Expand Down Expand Up @@ -119,10 +119,57 @@ workflows:
- test:
requires:
- build-bcryptjs
- deploy-bcryotjs:
- deploy-bcryptjs:
requires:
- test
filters:
branches:
ignore: /^dependabot.*/

release_build_test_gendocs_and_deploy:
jobs:
- build:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- test:
requires:
- build
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- deploy:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
release_bcryptjs_test_gendocs_and_deploy:
jobs:
- build-bcryptjs:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- test:
requires:
- build-bcryptjs
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- deploy-bcryptjs:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.dev
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,6 @@ api/controllers/**/*.js
typescript/api/controllers/**/*.js
typescript/api/services/**/*.js
assets/angular
api/core/*.js
api/core/**/*.js
dev
.dev
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM node:12.16.0
ENV node_env production
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
RUN apt-get update && \
apt-get install --no-install-recommends -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget && rm -rf /var/lib/apt/lists/*

COPY . /opt/redbox-portal/
RUN echo "Australia/Brisbane" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
COPY --chown=node:node . /opt/redbox-portal
RUN chown -R node:node /opt/redbox-portal; ls -l /opt; ls -l /opt/redbox-portal;
USER node
RUN echo "Permissions should be set, running as 'node' user, dumping permissions again: "; ls -l /opt; ls -l /opt/redbox-portal;
CMD NODE_ENV=$node_env node app.js
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ The [Queensland Cyber Infrastructure Foundation](http://www.qcif.edu.au) (QCIF)
## Development
Requirements:

- Node 8.11.0

- Node 12.16.0
Development requires Docker. Run `./runForDev.sh install jit` at least once.

- Docker

Run `./runForDev.sh install jit`

It will
- Pull qcifengineering/redbox-portal from docker hub (If a local copy does not exist)
- Compile backend
- Compile frontend
- Then start docker-compose

Open http://localhost:1500 to start browsing

### Build local docker image

Run `./dockerlocal_dev.sh`

It will
- Build a local docker image of qcifengineering/redbox-portal:latest
66 changes: 33 additions & 33 deletions angular/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,72 @@ help:

build-frontend:
@echo "Building local_auth"
ng build -a=0 --extract-css true
node_modules/.bin/ng build -a=0 --extract-css true
@echo "Building dashboard"
ng build -a=1 --extract-css true
node_modules/.bin/ng build -a=1 --extract-css true
@echo "Building record_search"
ng build -a=2 --extract-css true
node_modules/.bin/ng build -a=2 --extract-css true
@echo "Building transfer_owner"
ng build -a=3 --extract-css true
node_modules/.bin/ng build -a=3 --extract-css true
@echo "Building report"
ng build -a=4 --extract-css true
node_modules/.bin/ng build -a=4 --extract-css true
@echo "Building manageRoles"
ng build -a=5 --extract-css true
node_modules/.bin/ng build -a=5 --extract-css true
@echo "Building manageUsers"
ng build -a=6 --extract-css true
node_modules/.bin/ng build -a=6 --extract-css true
@echo "Building export"
ng build -a=7 --extract-css true
node_modules/.bin/ng build -a=7 --extract-css true
@echo "Building userProfile"
ng build -a=8 --extract-css true
node_modules/.bin/ng build -a=8 --extract-css true
@echo "Building dmp"
ng build -a=9 --extract-css true
node_modules/.bin/ng build -a=9 --extract-css true
@echo "Building workspace_list"
ng build -a=10 --extract-css true
node_modules/.bin/ng build -a=10 --extract-css true

build-frontend-prod:
@echo "Building local_auth"
ng build -a=0 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=0 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building dashboard"
ng build -a=1 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=1 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building record_search"
ng build -a=2 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=2 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building transfer_owner"
ng build -a=3 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=3 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building report"
ng build -a=4 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=4 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building manageRoles"
ng build -a=5 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=5 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building manageUsers"
ng build -a=6 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=6 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building export"
ng build -a=7 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=7 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building userProfile"
ng build -a=8 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=8 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building dmp"
ng build -a=9 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=9 --prod --build-optimizer --output-hashing=none --extract-css true
@echo "Building workspace_list"
ng build -a=10 --prod --build-optimizer --output-hashing=none --extract-css true
node_modules/.bin/ng build -a=10 --prod --build-optimizer --output-hashing=none --extract-css true

build-frontend-prod-sourcemaps:
@echo "Building local_auth"
ng build -a=0 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=0 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building dashboard"
ng build -a=1 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=1 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building record_search"
ng build -a=2 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=2 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building transfer_owner"
ng build -a=3 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=3 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building report"
ng build -a=4 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=4 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building manageRoles"
ng build -a=5 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=5 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building manageUsers"
ng build -a=6 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=6 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building export"
ng build -a=7 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=7 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building userProfile"
ng build -a=8 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=8 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building dmp"
ng build -a=9 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=9 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
@echo "Building workspace_list"
ng build -a=10 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
node_modules/.bin/ng build -a=10 --prod --build-optimizer --output-hashing=none --sourcemaps=true --extract-css true
38 changes: 21 additions & 17 deletions angular/dashboard/app/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,39 +77,43 @@ export class DashboardComponent extends LoadableComponent {
// <a *ngIf="plan.hasEditAccess" href="/{{ branding }}/{{ portal }}/record/edit/{{ plan.oid }}" [attr.aria-label]="'edit-link-label' | translate"><i class="fa fa-pencil" aria-hidden="true"></i></a>
// </span>
defaultTableConfig = [{
title: 'Record Title',
variable: 'metadata.title',
template: `<a href='/<%= branding %>/<%= portal %>/record/view/<%= oid %>'><%= metadata.title %></a>
title: 'Record Title',
variable: 'metadata.title',
template: `<a href='/<%= branding %>/<%= portal %>/record/view/<%= oid %>'><%= metadata.title %></a>
<span class="dashboard-controls">
<% if(hasEditAccess) { %>
<a href='/<%= branding %>/<%= portal %>/record/edit/<%= oid %>' aria-label='<%= translationService.t('edit-link-label') %>'><i class="fa fa-pencil" aria-hidden="true"></i></a>
<% } %>
</span>
`,
initialSort: 'desc'
},
initialSort: 'desc'
},
{
title: 'header-ci',
variable: 'metadata.contributor_ci.text_full_name',
template: '<%= metadata.contributor_ci != undefined ? metadata.contributor_ci.text_full_name : "" %>'
template: '<%= metadata.contributor_ci != undefined ? metadata.contributor_ci.text_full_name : "" %>',
initialSort: 'desc'
},
{
title: 'header-data-manager',
variable: 'metadata.contributor_data_manager.text_full_name',
template: '<%= metadata.contributor_data_manager != undefined ? metadata.contributor_data_manager.text_full_name : "" %>'
template: '<%= metadata.contributor_data_manager != undefined ? metadata.contributor_data_manager.text_full_name : "" %>',
initialSort: 'desc'
},
{
title: 'header-created',
variable: 'date_object_created',
template: '<%= dateCreated %>'
variable: 'metaMetadata.createdOn',
template: '<%= dateCreated %>',
initialSort: 'desc'
},
{
title: 'header-modified',
variable: 'date_object_modified',
template: '<%= dateModified %>'
variable: 'metaMetadata.lastSaveDate',
template: '<%= dateModified %>',
initialSort: 'desc'
}
];
sortFields = ['date_object_modified', 'date_object_created', 'metadata.title', 'metadata.contributor_ci.text_full_name', 'metadata.contributor_data_manager.text_full_name'];
sortFields = ['metaMetadata.lastSaveDate', 'metaMetadata.createdOn', 'metadata.title', 'metadata.contributor_ci.text_full_name', 'metadata.contributor_data_manager.text_full_name'];
viewAsPackageType: boolean = false;

constructor(@Inject(DashboardService) protected dashboardService: DashboardService, protected recordsService: RecordsService, @Inject(DOCUMENT) protected document: any, elementRef: ElementRef, translationService: TranslationService) {
Expand Down Expand Up @@ -176,7 +180,7 @@ export class DashboardComponent extends LoadableComponent {
};
}
this.initTracker.target++;
let stagedRecords: RecordResponseTable = await this.dashboardService.getRecords(null, null, 1, packageType, 'date_object_modified:-1');
let stagedRecords: RecordResponseTable = await this.dashboardService.getRecords(null, null, 1, packageType, 'metaMetadata.lastSaveDate:-1');
let planTable: PlanTable = this.evaluatePlanTableColumns(packageType, stagedRecords);
this.initTracker.loaded++;
this.setDashboardTitle(planTable);
Expand Down Expand Up @@ -208,7 +212,7 @@ export class DashboardComponent extends LoadableComponent {
};
}
this.initTracker.target++;
let stagedRecords: RecordResponseTable = await this.dashboardService.getRecords(recordType, step.name, 1, null, 'date_object_modified:-1');
let stagedRecords: RecordResponseTable = await this.dashboardService.getRecords(recordType, step.name, 1, null, 'metaMetadata.lastSaveDate:-1');
let planTable: PlanTable = this.evaluatePlanTableColumns(step.name, stagedRecords);
this.initTracker.loaded++;
this.setDashboardTitle(planTable);
Expand Down Expand Up @@ -293,7 +297,7 @@ export class DashboardComponent extends LoadableComponent {

for (let i = 0; i < fields.length; i++) {
let sortField = fields[i];
let sortString = `'${sortField}':`;
let sortString = `${sortField}:`;

if (sortDetails[sortField].sort != null) {
if (sortDetails[sortField].sort == 'desc') {
Expand All @@ -304,7 +308,7 @@ export class DashboardComponent extends LoadableComponent {
return sortString;
}
}
return 'date_object_modified:-1';
return 'metaMetadata.lastSaveDate:-1';
}

getTranslated(key, defValue) {
Expand All @@ -325,7 +329,7 @@ export class DashboardComponent extends LoadableComponent {
}

async sortChanged(data) {
let sortString = `'${data.variable}':`;
let sortString = `${data.variable}:`;
if (data.sort == 'desc') {
sortString = sortString + "-1";
} else {
Expand Down
Loading

0 comments on commit d4182ca

Please sign in to comment.