This repository has been archived by the owner on Nov 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Export to FireCloud button Also remove items from menu that don't apply to Commons instance.
- Loading branch information
Showing
29 changed files
with
436 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,15 @@ RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | ||
RUN npm install pm2 -g | ||
# Install app dependencies | ||
COPY package.json /usr/src/app/ | ||
COPY . /usr/src/app/ | ||
RUN npm install | ||
# Bundle app source | ||
COPY ./dist /usr/src/app/dist | ||
COPY ./server/dist /usr/src/app/server/dist | ||
COPY ./views /usr/src/app/views | ||
RUN npm -g install grunt-cli | ||
RUN npm -g install [email protected] | ||
RUN grunt build | ||
RUN rm boardwalk.zip | ||
RUN rm -rf spa/node_modules | ||
|
||
EXPOSE 3000 | ||
#Set the node env | ||
ENV NODE_ENV local | ||
CMD ["pm2-docker", "server/dist/server.js"] | ||
#RUN chmod a+x run.sh | ||
#CMD ["./run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
1. Fix ugly hack in cc-base.dao.ts where added getNoCatch method; but otherwise I don't get the error. | ||
2. CORS errors provides no details. | ||
3. `FilesService.exportToFireCloud` returns a string for success and error, then there is an ugly hardcoded test in | ||
file.effects.ts to see if the string starts with `Error`. | ||
4. In file.dao.ts, construct FireCloud url from response. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
spa/src/app/files/_ngrx/file-export/file-export.actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Action } from "@ngrx/store"; | ||
import { WorkspaceDescriptor } from "./file-export.state"; | ||
|
||
export class FileExportManifestRequestAction implements Action { | ||
public static ACTION_TYPE = "FILE.MANIFEST_EXPORT_REQUEST"; | ||
public readonly type = FileExportManifestRequestAction.ACTION_TYPE; | ||
constructor(public payload: WorkspaceDescriptor) { | ||
} | ||
} | ||
|
||
export class FileExportManifestSuccessAction implements Action { | ||
public static ACTION_TYPE = "FILE.MANIFEST_EXPORT_SUCCESS"; | ||
public readonly type = FileExportManifestSuccessAction.ACTION_TYPE; | ||
constructor(public fireCloudUrl: string) { | ||
} | ||
} | ||
|
||
export class FileExportManifestErrorAction implements Action { | ||
public static ACTION_TYPE = "FILE.MANIFEST_EXPORT_ERROR"; | ||
public readonly type = FileExportManifestErrorAction.ACTION_TYPE; | ||
constructor(public errorReason: string) { | ||
} | ||
} | ||
|
||
export type All = FileExportManifestRequestAction | ||
| FileExportManifestSuccessAction | ||
| FileExportManifestErrorAction; |
23 changes: 23 additions & 0 deletions
23
spa/src/app/files/_ngrx/file-export/file-export.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Action } from "@ngrx/store"; | ||
import { | ||
FileExportManifestRequestAction, FileExportManifestErrorAction, | ||
FileExportManifestSuccessAction | ||
} from "./file-export.actions"; | ||
import { FileExportManifestState } from "./file-export.state"; | ||
|
||
export function reducer(state: FileExportManifestState = FileExportManifestState.getDefaultState(), action: Action): FileExportManifestState { | ||
switch (action.type) { | ||
case FileExportManifestSuccessAction.ACTION_TYPE: { | ||
return new FileExportManifestState((action as FileExportManifestSuccessAction).fireCloudUrl, "success"); | ||
} | ||
case FileExportManifestErrorAction.ACTION_TYPE: { | ||
return new FileExportManifestState(null, "error", | ||
(action as FileExportManifestErrorAction).errorReason); | ||
} | ||
case FileExportManifestRequestAction.ACTION_TYPE: { | ||
return new FileExportManifestState(null, "request"); | ||
} | ||
default: | ||
return state; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export interface WorkspaceDescriptor { | ||
name: string; | ||
namespace: string; | ||
} | ||
|
||
export type FileExportManifestStatus = "request" | "success" | "error" | null; | ||
|
||
// export interface FileExportStatus | ||
export class FileExportManifestState { | ||
constructor(public fireCloudUrl = "", | ||
public status: FileExportManifestStatus = null, | ||
public statusMessage = "") { | ||
} | ||
|
||
public static getDefaultState() { | ||
return new FileExportManifestState(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.column-flex { | ||
flex-direction: column; | ||
display: flex; | ||
font-size: large; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<h1 mat-dialog-title>Export to FireCloud</h1> | ||
<div mat-dialog-content> | ||
<mat-progress-bar mode="indeterminate" *ngIf="exporting"></mat-progress-bar> | ||
<p *ngIf="exported">The selected files were exported to the FireCloud <a [href]="firecloudUrl" target="_blank">{{data.workspace}} workspace.</a></p> | ||
<p *ngIf="errorMessage">There was an error exporting to FireCloud: {{errorMessage}}</p> | ||
<div *ngIf="!exported && !errorMessage"> | ||
<p>Export the selected facets into a new FireCloud workspace.</p> | ||
<div class="column-flex"> | ||
<mat-form-field> | ||
<input matInput [(ngModel)]="data.workspace" placeholder="Workspace name" required autofocus [disabled]="exporting"> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-select placeholder="Billing project" [(value)]="data.namespace" [disabled]="exporting" required> | ||
<mat-option *ngFor="let namespace of data.namespaces" [value]="namespace">{{namespace}}</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</div> | ||
</div> | ||
</div> | ||
<div mat-dialog-actions align="end"> | ||
<button mat-button (click)="onClose()" *ngIf="!exported && !errorMessage">Cancel</button> | ||
<button mat-button (click)="onExport()" *ngIf="!exported && !errorMessage" [disabled]="exporting || !data.workspace">Export</button> | ||
<button mat-button (click)="onClose()" *ngIf="exported || errorMessage">Close</button> | ||
</div> |
25 changes: 25 additions & 0 deletions
25
spa/src/app/files/file-export/file-export.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { FileExportComponent } from './file-export.component'; | ||
|
||
describe('FileExportComponent', () => { | ||
let component: FileExportComponent; | ||
let fixture: ComponentFixture<FileExportComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ FileExportComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FileExportComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.