Skip to content

Commit

Permalink
Configurable S3 Bucket Name (#5)
Browse files Browse the repository at this point in the history
* Get Demos Initial Commit

Added a text box, moved requesting s3 demos to an internal function from the bucket url. "https://nih-demos.s3.us-west-2.amazonaws.com/" fro reference. Added CORS policy to aws to accomodate.

* Dynamic + Customizable S3 Bucket Pulling, Minor State Fixes for autogen

Added javascript-side ajax request for buckets to s3 bucket.

added parser for ajax request for s3 xml data.

added xml->json converter for s3 bucket data to autogen s3 bucket object.

object is nested for device[] --> projects[] -> files[]

Added tabs for each device to aid in project visibility, and clutter management.

Removed current s3 bucket parsing from client application (injected ajax request in-place).

Added minor fix to autogen behavior on loading configurations.

Added minor logic to attempt to update configuration when incoming data is empty.

* AvailableDemos Update. Fixed Spinner

Added fix for spinner to autogendemos.

Added additional null checks etc, for autogen objects.

* Added dynamic bucket input to proxy server, and download request.

^

* Added fix for s3 download not sending proper json.41

Updated Download S3 configuration parser to accept any json, and pass through to user.

Added call to update json from download s3 demos.  Temporary.

* Added update Button

Commit for Update Button.

Added Update Button for bucket query.
Avail. Demos is now Avail Projects.

* Added FrostProjects

nih-demos --> frost-projects

* Minor Convention update (AutogenDemos -> S3ProjectsContainer)

Added dynamic, bootstrap compatible (start) for typing, and use.
AutogenDemos is now S3ProjectsContainer since it is a container for S3Projects :)
Added additional props and handling for defaults such as className, and defaultBucket.  This will allow us to reuse this component (potentially), or update for specific builds, or pages on the component declaration itself as opposed to within the component.
Available projects can now be hidden from the component level.

Co-authored-by: adventure <[email protected]>
  • Loading branch information
dack-fe and FE-Sobrero authored Nov 6, 2020
1 parent 2090ba4 commit 251ff2d
Show file tree
Hide file tree
Showing 28 changed files with 4,026 additions and 3,481 deletions.
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/OpenSpeechTools.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
42 changes: 42 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/OpenSpeechTools.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/OpenSpeechTools.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/OpenSpeechTools.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
5,080 changes: 2,164 additions & 2,916 deletions ClientApp/package-lock.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
"@types/popper.js": "^1.11.0",
"@types/react-leaflet": "^2.5.1",
"@types/signalr": "^2.2.36",
"amazon-s3-uri": "^0.1.0",
"aws-sdk": "^2.775.0",
"bootstrap": "^4.4.1",
"chartist": "^0.11.4",
"connected-react-router": "^6.5.2",
"create-react-app": "^3.4.1",
"history": "^4.10.1",
"immutability-helper": "^3.1.1",
"input-moment": "^0.4.0",
Expand All @@ -23,7 +26,7 @@
"leaflet": "^1.6.0",
"merge": "1.2.1",
"moment": "^2.24.0",
"node-sass": "^4.13.1",
"node-sass": "^4.12.0",
"popper.js": "^1.16.1",
"react": "^16.11.0",
"react-bootstrap": "^1.0.0-beta.17",
Expand All @@ -45,7 +48,8 @@
"reactstrap": "8.1.1",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0",
"svgo": "1.3.0"
"svgo": "1.3.0",
"xml-js": "^1.6.11"
},
"devDependencies": {
"@types/history": "4.7.3",
Expand Down
4 changes: 2 additions & 2 deletions ClientApp/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
-->
<!--
<script src="/Range2DSlider/jquery.js"></script>
<!---<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="/Range2DSlider/jquery.range2dslider.js"></script>
<link rel="stylesheet" href="/Range2DSlider/jquery.range2dslider.css">--->
<link rel="stylesheet" href="/Range2DSlider/jquery.range2dslider.css">
--->

<link href="/font-awesome/css/fontawesome.css" rel="stylesheet" />
<link href="/font-awesome/css/all.css" rel="stylesheet" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,27 @@ const checkOptionalProps = (optionalProps, dataProps) => {
export function getViewsFromData(modelDataArray, options) {
var views = modelDataArray.map((modelData, index) => {
var optionsIndex;
if (options && options !== {}) {
options.forEach((option) => {
if (option.data) {
option.data.forEach((dataIndex) => {
if (dataIndex === index) {
console.log("Has Options!");
optionsIndex = dataIndex;
}
});
}
});
if(options){
if (options && options !== {}) {
options.forEach((option) => {
if (option.data) {
option.data.forEach((dataIndex) => {
if (dataIndex === index) {
console.log("Has Options!");
optionsIndex = dataIndex;
}
});
}
});
}
}
var combinedProps;
if(options){
combinedProps = combineDataAndOptions(modelData,options,index);
}
else{
combinedProps = modelData;
}
const combinedProps = combineDataAndOptions(modelData,options,index);
const component = MatchDataToComponent(combinedProps);
const view = {
name: modelData.name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
exports.FileUploaderPresentationalComponent = void 0;
var React = __importStar(require("react"));
var react_bootstrap_1 = require("react-bootstrap");
exports.FileUploaderPresentationalComponent = function (props) {
var dragging = props.dragging, file = props.file, onSelectFileClick = props.onSelectFileClick, onDrag = props.onDrag, onDragStart = props.onDragStart, onDragEnd = props.onDragEnd, onDragOver = props.onDragOver, onDragEnter = props.onDragEnter, onDragLeave = props.onDragLeave, onDrop = props.onDrop;
var uploaderClasses = "file-uploader flex-right";
if (dragging) {
uploaderClasses += " file-uploader--dragging";
}
return (React.createElement("div", { className: uploaderClasses, onDrag: onDrag, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragEnter: onDragEnter, onDragLeave: onDragLeave, onDrop: onDrop },
React.createElement("div", { className: "file-uploader__contents" },
React.createElement(react_bootstrap_1.Button, { variant: "primary", className: "float-right btn-simple btn-icon", onClick: onSelectFileClick },
React.createElement("i", { className: "fa fa-upload large-icon" }))),
props.children));
return (<div className={uploaderClasses} onDrag={onDrag} onDragStart={onDragStart} onDragEnd={onDragEnd} onDragOver={onDragOver} onDragEnter={onDragEnter} onDragLeave={onDragLeave} onDrop={onDrop}>
<div className="file-uploader__contents">
<react_bootstrap_1.Button variant="primary" className="float-right btn-simple btn-icon" onClick={onSelectFileClick}>
<i className="fa fa-upload large-icon"/>
</react_bootstrap_1.Button>
</div>
{props.children}
</div>);
};
//# sourceMappingURL=FileUploaderPresentationalComponent.js.map
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from "react";
import { Row, Col, Button} from "react-bootstrap";

export class OpenSpeechDemoCard extends Component {
export class OpenSpeechProjectCard extends Component {
render() {

const removeUnderscore = (title) => {
Expand Down Expand Up @@ -56,4 +56,4 @@ export class OpenSpeechDemoCard extends Component {
}
}

export default OpenSpeechDemoCard;
export default OpenSpeechProjectCard;
23 changes: 21 additions & 2 deletions ClientApp/src/SignalR/ModelDataClient.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var signalR = require("@microsoft/signalr");
exports.ModelDataClient = void 0;
var signalR = __importStar(require("@microsoft/signalr"));
var connection = new signalR.HubConnectionBuilder().withUrl("/model-data").build();
var ModelDataClient = /** @class */ (function () {
function ModelDataClient() {
Expand Down Expand Up @@ -51,4 +71,3 @@ var ModelDataClient = /** @class */ (function () {
}()); //End ModelDataClient
exports.ModelDataClient = ModelDataClient;
exports.default = new ModelDataClient();
//# sourceMappingURL=ModelDataClient.js.map
Loading

0 comments on commit 251ff2d

Please sign in to comment.