Skip to content

Commit

Permalink
Merge pull request #2 from redbox-mint/develop
Browse files Browse the repository at this point in the history
Version 1.0.0
  • Loading branch information
shilob authored Dec 5, 2024
2 parents b456c7d + 4f25981 commit 032db74
Show file tree
Hide file tree
Showing 89 changed files with 9,339 additions and 16,695 deletions.
106 changes: 106 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
version: 2.1
jobs:
build_and_publish:
docker:
- image: cimg/node:20.9.0
working_directory: ~/repo
steps:
- checkout
- run:
command: |
set +e
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
- run: export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && nvm install && npm install && node_modules/.bin/tsc
- run: chmod +x support/build/compileAngularLegacy.sh && support/build/compileAngularLegacy.sh labarchives
# run tests!
# - run: npm test
# # store test results
# - store_test_results:
# path: test_results

# store code coverage
# - persist_to_workspace:
# root: ~/repo
# paths: .
- run:
name: Authenticate with NPM
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
- run:
name: Publish package
command: npm publish --access public
build_only:
docker:
- image: cimg/node:20.9.0
working_directory: ~/repo
steps:
- checkout
- run:
command: |
set +e
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
- run: export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && nvm install && npm install && node_modules/.bin/tsc
- run: chmod +x support/build/compileAngularLegacy.sh && support/build/compileAngularLegacy.sh labarchives
# run tests!
# - run: npm test
# # store test results
# - store_test_results:
# path: test_results

# store code coverage
# - persist_to_workspace:
# root: ~/repo
# paths: .


workflows:
publish:
jobs:
- build_and_publish:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
build:
jobs:
- build_only:
filters:
tags:
ignore: /.*/
branches:
only: /.*/
# jobs:
# build:
# docker:
# - image: "cimg/base:stable"
# - checkout
# - node/install:
# node-version: 12.16.0
# - run: npm install --production
# - run: node_modules/.bin/tsc
# - persist_to_workspace:
# root: .
# paths:
# - .
# test:
# machine: true
# steps:
# - docker/install-docker-compose
# - attach_workspace:
# 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: 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
#
# orbs:
# node: circleci/[email protected]
# docker: circleci/[email protected]
# version: 2.1
# workflows:
#
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ e2e/*.map
Thumbs.db

test/angular
api/*
angular-legacy/shared
dist/
assets/angular
10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.circleci
support
test
.editorconfig
.gitignore
angular-legacy
.idea
typescript
.nvmrc
tsconfig.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.9.0
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "labarchives"
"name": "angular"
},
"apps": [
{
"name": "labarchives",
"root": "src",
"outDir": "dist",
"root": "labarchives",
"outDir": "../assets/angular/labarchives",
"assets": [
"assets",
"favicon.ico"
Expand All @@ -20,17 +20,17 @@
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
"styles.scss"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}

],
"e2e": {
"protractor": {
Expand Down
File renamed without changes.
44 changes: 44 additions & 0 deletions angular-legacy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
dist/*
/tmp
/out-tsc
shared/*

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings
yarn-error.log

# e2e
/e2e/*.js
/e2e/*.map

# System Files
.DS_Store
Thumbs.db
1 change: 1 addition & 0 deletions angular-legacy/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.19.0
5 changes: 3 additions & 2 deletions angular/labarchives/README.md → angular-legacy/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Labarchives
# Angular

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.4.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.2.7.

## Development server

Expand All @@ -21,6 +21,7 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Further help

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
// https://karma-runner.github.io/0.13/config/configuration-file.html

module.exports = function (config) {
config.set({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Input, Output, Component, OnInit, Inject, Injector, EventEmitter} from '@angular/core';
import {SimpleComponent} from '../shared/form/field-simple.component';
import {FieldBase} from '../shared/form/field-base';
import {SimpleComponent} from '../../../shared/form/field-simple.component';
import {FieldBase} from '../../../shared/form/field-base';
import {FormGroup, FormControl, Validators} from '@angular/forms';
import * as _ from "lodash-es";
import * as _ from "lodash";

import {Checks} from './helpers';
import {LabarchivesService} from '../labarchives.service';
Expand Down Expand Up @@ -47,6 +47,9 @@ export class LabarchivesCreateField extends FieldBase<any> {
userEmail: string;
notebookName: string;
supervisorEmail: string;
errorMessageMap = {
createErrorMessage: 'There was an error creating your notebook'
};
errorMessages: Array<string> = [];

@Input() LinkItem: EventEmitter<any> = new EventEmitter<any>();
Expand Down Expand Up @@ -78,6 +81,7 @@ export class LabarchivesCreateField extends FieldBase<any> {
this.processingNoPermission = options['processingNoPermission'] || 'You are not allowed to modify this item'
this.processingLabel = options['processingLabel'] || 'Processing...';
this.processingMessage = '';
this.errorMessageMap = options['errorMessageMap'] || this.errorMessageMap;
this.checks = new Checks();
}

Expand Down Expand Up @@ -134,13 +138,22 @@ export class LabarchivesCreateField extends FieldBase<any> {
this.processingStatus = 'Creating Notebook...';
const createNotebook = await this.labarchivesService.createNotebook(this.rdmp, this.notebookName, this.supervisorEmail, this.userEmail);
console.log(createNotebook);
if (createNotebook.status === false) {
this.processingStatus = "";
this.errorMessages = [this.errorMessageMap['createErrorMessage']];
if (createNotebook.message) {
this.errorMessages = [createNotebook.message];
}
this.processing = false;
return;
}
this.processingStart = false;
this.processingFinished = true;
this.processingStatus = 'Your notebook has been created';
jQuery('#createModal').modal('hide');
this.link.emit({name: createNotebook.name, id: createNotebook.nb});
} catch (e) {
this.processingStatus = 'There was an error creating your notebook';
this.processingStatus = this.errorMessageMap['createErrorMessage'];
}
} else {
this.processingFail = '';
Expand Down Expand Up @@ -195,17 +208,17 @@ export class LabarchivesCreateField extends FieldBase<any> {
attr.aria-label="{{ field.supervisorEmail }}" disabled="true">
</div>
<div class="form-group">
<button *ngIf="waitForProcessing" type="button" class="form-control btn btn-block btn-primary"
<button *ngIf="waitForProcessing && field.errorMessages.length == 0" type="button" class="form-control btn btn-block btn-primary"
(click)="field.createNotebook()"
attr.aria-label="{{ field.createNotebookLabel }}">{{ field.createNotebookLabel }}</button>
</div>
<div class="form-group">
<div>{{ field.processingStatus }}</div>
</div>
<div class="form-group">
<div class="alert-danger">
<ul class="list-group">
<li class="list-group-item" *ngFor="let msg of field.errorMessages">{{msg}}</li>
<div class="form-group" *ngIf="field.errorMessages.length > 0">
<div class="alert alert-danger" role="alert">
<ul>
<li *ngFor="let msg of field.errorMessages">{{msg}}</li>
</ul>
</div>
</div>
Expand All @@ -215,10 +228,10 @@ export class LabarchivesCreateField extends FieldBase<any> {
<div class="modal-footer">
<span *ngIf="field.processing; then waitForProcessing; else finishProcessing"></span>
<ng-template #finishProcessing>
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ field.closeLabel }}</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ field.closeLabel }}</button>
</ng-template>
<ng-template #waitForProcessing>
<button type="button" class="btn btn-secondary disabled" data-dismiss="modal">{{ field.closeLabel }}
<button type="button" class="btn btn-secondary disabled" data-bs-dismiss="modal">{{ field.closeLabel }}
</button>
</ng-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Input, Output, Component, OnInit, Inject, Injector, EventEmitter} from '@angular/core';
import {SimpleComponent} from '../shared/form/field-simple.component';
import {FieldBase} from '../shared/form/field-base';
import {SimpleComponent} from '../../../shared/form/field-simple.component';
import {FieldBase} from '../../../shared/form/field-base';
import {FormGroup, FormControl, Validators} from '@angular/forms';
import * as _ from "lodash-es";
import * as _ from "lodash";

import {Checks} from './helpers';
import {LabarchivesService} from '../labarchives.service';
Expand Down Expand Up @@ -102,9 +102,13 @@ export class LabarchivesLinkField extends FieldBase<any> {
this.checks.master = true;
this.processingFail = undefined;
this.list.emit();
} else if(link.message === 'cannot insert node'){
this.processingFail = this.processingNoPermission;
this.checks.linkWithOther = true
} else {
if(link.message === 'cannot insert node'){
this.processingFail = this.processingNoPermission;
this.checks.linkWithOther = true
} else {
this.processingFail = link.message;
}
}
} catch (e) {
this.processing = false;
Expand Down Expand Up @@ -144,10 +148,10 @@ export class LabarchivesLinkField extends FieldBase<any> {
<div class="modal-footer">
<span *ngIf="field.processing; then waitForProcessing; else finishProcessing"></span>
<ng-template #finishProcessing>
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ field.closeLabel }}</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ field.closeLabel }}</button>
</ng-template>
<ng-template #waitForProcessing>
<button type="button" class="btn btn-secondary disabled" data-dismiss="modal">{{ field.closeLabel }}
<button type="button" class="btn btn-secondary disabled" data-bs-dismiss="modal">{{ field.closeLabel }}
</button>
</ng-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Output, EventEmitter, Component, OnInit, Inject, Injector, Input} from '@angular/core';
import {FormGroup, FormControl, Validators, NgForm} from '@angular/forms';
import {SimpleComponent} from '../shared/form/field-simple.component';
import {FieldBase} from '../shared/form/field-base';
import {SimpleComponent} from '../../../shared/form/field-simple.component';
import {FieldBase} from '../../../shared/form/field-base';
import {LabarchivesService} from "../labarchives.service";

export class LabarchivesListField extends FieldBase<any> {
Expand Down
Loading

0 comments on commit 032db74

Please sign in to comment.