Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soft launch to staging #87

Merged
merged 73 commits into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
604ce03
finished bucket drop down
andrewaltman1 Apr 3, 2023
5f7644f
pulled down dev changes
andrewaltman1 Apr 3, 2023
2428e86
pulled down dev changes
andrewaltman1 Apr 3, 2023
54cfea3
commit before pull
andrewaltman1 Apr 6, 2023
6012e45
Merge branch 'dev' of https://github.com/oslabs-beta/CloudShift into …
andrewaltman1 Apr 10, 2023
d4fae81
commit before pull
andrewaltman1 Apr 13, 2023
e0aa8b3
remote
Apr 13, 2023
d253de6
consolidating remotes into one component
andrewaltman1 Apr 13, 2023
f78557b
combined two remote components into one
andrewaltman1 Apr 13, 2023
d0bb9db
half
Apr 13, 2023
85f7efa
ErrorComponent
Apr 13, 2023
d55e084
combined oirigin/destination components to remote
andrewaltman1 Apr 13, 2023
bfd58a5
a
Apr 13, 2023
2027093
Merge branch 'UI' of https://github.com/oslabs-beta/CloudShift into UI
Apr 13, 2023
43cd27a
added migration button logic
Apr 13, 2023
2ad4a00
Merge pull request #50 from oslabs-beta/UI
mjhuff Apr 13, 2023
e708c2c
added red error input
Apr 14, 2023
702469b
Merge pull request #60 from oslabs-beta/UI
mjhuff Apr 14, 2023
3897d43
Boilerplate and basic controllers
mjhuff Mar 28, 2023
9713575
solved merge conflicts
mjhuff Apr 14, 2023
009b68a
Deleted unnecessary files
mjhuff Apr 14, 2023
253fc53
Prettified Code!
mjhuff Apr 14, 2023
7c13c03
Merge pull request #71 from oslabs-beta/mergeFix
mjhuff Apr 14, 2023
f6fc792
updated styling given azure update
Apr 14, 2023
7eedb7a
Merge pull request #72 from oslabs-beta/ansel
mjhuff Apr 14, 2023
a109dd2
Solved css change merge conflicts
mjhuff Apr 14, 2023
059c346
Delete build directory
mjhuff Apr 14, 2023
00b0f9c
Prettified Code!
mjhuff Apr 14, 2023
d6ab0b4
Merge pull request #74 from oslabs-beta/anselMergeFixes
mjhuff Apr 14, 2023
56db7fa
Merge pull request #73 from oslabs-beta/mjhuff-patch-1
Apr 14, 2023
777a9c9
added new CI for build folder
mjhuff Apr 14, 2023
2ced56a
Merge pull request #75 from oslabs-beta/updateCICD
mjhuff Apr 14, 2023
230d6f8
Fixed CSS & added button hover
mjhuff Apr 14, 2023
021ef54
Prettified Code!
mjhuff Apr 14, 2023
0964da9
Merge pull request #77 from oslabs-beta/cssFixes
mjhuff Apr 14, 2023
c898214
added focus and back button
Apr 15, 2023
368e492
Merge branch 'dev' into focus
Apr 15, 2023
8609752
added focus
Apr 15, 2023
88a1e97
Prettified Code!
iredonkulousv2 Apr 15, 2023
2193cdb
Basic testing boilerplate
mjhuff Apr 15, 2023
9b9a1bf
Fixed spelling
mjhuff Apr 15, 2023
8406e71
Prettified Code!
mjhuff Apr 15, 2023
fac1ce4
Merge pull request #78 from oslabs-beta/focus
mjhuff Apr 15, 2023
8997e09
Merge branch 'dev' of https://github.com/oslabs-beta/CloudShift into dev
Apr 15, 2023
9acf294
Merge pull request #79 from oslabs-beta/jest
iredonkulousv2 Apr 15, 2023
76ff680
merged with jest
Apr 15, 2023
4d0ff82
made vertical and added zoom
Apr 15, 2023
40e1c63
Started readme
mjhuff Apr 15, 2023
90db3f5
added reset icon
Apr 15, 2023
fc0e75f
Finished installation section
mjhuff Apr 15, 2023
803eadc
add cloudshift icon
Apr 15, 2023
577e424
Prettified Code!
iredonkulousv2 Apr 15, 2023
53b1b34
Finished Usage & Credentials section
mjhuff Apr 15, 2023
937fa9e
Finished basic readme
mjhuff Apr 15, 2023
391f05d
Merge pull request #81 from oslabs-beta/readme
Apr 15, 2023
dd513de
Update README.md
mjhuff Apr 15, 2023
1fa1da9
Merge pull request #82 from oslabs-beta/patch-1
mjhuff Apr 15, 2023
ed12f31
Update README.md
mjhuff Apr 15, 2023
d91d34a
Merge pull request #83 from oslabs-beta/patch-2
mjhuff Apr 15, 2023
4033cdb
Update README.md
mjhuff Apr 15, 2023
700f181
Merge pull request #84 from oslabs-beta/patch-3
mjhuff Apr 15, 2023
c51ea0e
New logo & readme fixes
mjhuff Apr 15, 2023
2cccb79
Added banner to imgur
mjhuff Apr 15, 2023
4307495
solved merge conflict with dev
mjhuff Apr 15, 2023
4224c29
Merge pull request #85 from oslabs-beta/readme
mjhuff Apr 15, 2023
149b29d
styling adapts to changing browser size
Apr 15, 2023
8d48bef
Merge branch 'resizing' of https://github.com/oslabs-beta/CloudShift …
mjhuff Apr 15, 2023
82dcae0
Fixed minor CSS bugs
mjhuff Apr 15, 2023
b99b4cb
Prettified Code!
mjhuff Apr 15, 2023
5995bb3
Merge pull request #86 from oslabs-beta/cssUpdates
andrewaltman1 Apr 15, 2023
8012236
updated package*.json
mjhuff Apr 15, 2023
f7541ca
added build
mjhuff Apr 15, 2023
7c15bb4
solved staging merge conflicts
mjhuff Apr 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Prettified Code!
  • Loading branch information
mjhuff authored and actions-user committed Apr 14, 2023
commit 253fc53b47557909719482b937d460cc804dd3dd
1,888 changes: 944 additions & 944 deletions build/index_bundle.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/components/ErrorDisplay.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { useSelector } from 'react-redux';
import React from "react";
import { useSelector } from "react-redux";

const ErrorDisplay = () => {
const { origin, destination } = useSelector((state) => state.GUI);
Expand Down
18 changes: 9 additions & 9 deletions client/components/Overlay.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import { useSelector } from 'react-redux';
import aws_edited from '../public/aws_edited.png';
import cloudflare_edited from '../public/cloudflare_edited.png';
import ReactDOM from 'react-dom';
import ProgressBar from './ProgressBar';
import React from "react";
import { useSelector } from "react-redux";
import aws_edited from "../public/aws_edited.png";
import cloudflare_edited from "../public/cloudflare_edited.png";
import ReactDOM from "react-dom";
import ProgressBar from "./ProgressBar";

const Overlay = (props) => {
const { origin, destination } = useSelector((state) => state.GUI);
const originSrc = origin.name === 'AWS' ? aws_edited : cloudflare_edited;
const originSrc = origin.name === "AWS" ? aws_edited : cloudflare_edited;
const destinationSrc =
destination.name === 'AWS' ? aws_edited : cloudflare_edited;
destination.name === "AWS" ? aws_edited : cloudflare_edited;
return ReactDOM.createPortal(
<>
<div className="flex left-0 top-0 justify-center item-center fixed z-9999 h-screen w-screen backdrop-blur-xl">
Expand All @@ -18,7 +18,7 @@ const Overlay = (props) => {
</div>
</div>
</>,
document.querySelector('#portal')
document.querySelector("#portal")
);
};

Expand Down
52 changes: 26 additions & 26 deletions client/components/Remote.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import React, { useEffect } from 'react';
import { updateSecretKey, updateAccessId, updateAccountId } from '../slice';
import { useDispatch, useSelector } from 'react-redux';
import BucketSelect from './BucketSelect';
import { getUserBuckets } from '../services/getBuckets';
import aws_edited from '../public/aws_edited.png';
import cloudflare_edited from '../public/cloudflare_edited.png';
import ErrorDisplay from './ErrorDisplay';
import StartMigrationButton from './MigrationButton';
import React, { useEffect } from "react";
import { updateSecretKey, updateAccessId, updateAccountId } from "../slice";
import { useDispatch, useSelector } from "react-redux";
import BucketSelect from "./BucketSelect";
import { getUserBuckets } from "../services/getBuckets";
import aws_edited from "../public/aws_edited.png";
import cloudflare_edited from "../public/cloudflare_edited.png";
import ErrorDisplay from "./ErrorDisplay";
import StartMigrationButton from "./MigrationButton";

const Remote = (props) => {
const dispatch = useDispatch();
const { origin, destination } = useSelector((state) => state.GUI);

let { remoteType } = props;

const remote = remoteType === 'origin' ? origin : destination;
const remote = remoteType === "origin" ? origin : destination;

let bucketSelect;

const requireAccountId = remote.name === 'Cloudflare' ? true : false;
const requireAccountId = remote.name === "Cloudflare" ? true : false;

if (!requireAccountId) {
bucketSelect = remote.accessId && remote.secretKey && (
Expand All @@ -33,14 +33,14 @@ const Remote = (props) => {
//Get the list of buckets if all credentials are present.
useEffect(() => {
if (!remote.accessId || !remote.secretKey) return;
if (remote.name === 'Cloudflare' && !remote.accountId) return;
if (remote.name === "Cloudflare" && !remote.accountId) return;
dispatch(getUserBuckets({ ...remote, originOrDestination: remoteType }));
}, [remote.accessId, remote.secretKey, remote.name, remote.accountId]);

let correctInputClass =
'block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-800 appearance-none focus:outline-none focus:ring-0 focus:border-blue-600 peer';
"block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-800 appearance-none focus:outline-none focus:ring-0 focus:border-blue-600 peer";
let wrongInputClass =
'block py-2.5 px-0 w-full text-sm text-red-600 bg-transparent border-2 border-b-2 border-red-600 rounded-lg appearance-none focus:outline-none focus:ring-0 focus:border-red-600 peer';
"block py-2.5 px-0 w-full text-sm text-red-600 bg-transparent border-2 border-b-2 border-red-600 rounded-lg appearance-none focus:outline-none focus:ring-0 focus:border-red-600 peer";

return (
<div>
Expand All @@ -58,8 +58,8 @@ const Remote = (props) => {
<input
type="key"
className={
remote.errorField === 'accessId' ||
(remote.name === 'azureblob' && remote.errorMessage)
remote.errorField === "accessId" ||
(remote.name === "azureblob" && remote.errorMessage)
? wrongInputClass
: correctInputClass
}
Expand All @@ -76,16 +76,16 @@ const Remote = (props) => {
htmlFor={`${remoteType}AccessId`}
className="peer-focus:font-medium absolute text-base duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6"
>
{remote.name === 'azureblob' ? 'Account ID' : 'Access ID'}
{remote.accessId ? <>{' \u2705'}</> : <></>}
{remote.name === "azureblob" ? "Account ID" : "Access ID"}
{remote.accessId ? <>{" \u2705"}</> : <></>}
</label>
</div>

<div className="block relative z-0 w-full h-full mb-6 group">
<input
className={
remote.errorField === 'secretKey' ||
(remote.name === 'azureblob' && remote.errorMessage)
remote.errorField === "secretKey" ||
(remote.name === "azureblob" && remote.errorMessage)
? wrongInputClass
: correctInputClass
}
Expand All @@ -104,12 +104,12 @@ const Remote = (props) => {
htmlFor="secretKey"
className="peer-focus:font-medium absolute text-base duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6"
>
{remote.name === 'azureblob' ? 'Access Key' : 'Secret Key'}
{remote.secretKey ? <>{' \u2705'}</> : <></>}
{remote.name === "azureblob" ? "Access Key" : "Secret Key"}
{remote.secretKey ? <>{" \u2705"}</> : <></>}
</label>
</div>

{remote.name === 'Cloudflare' && (
{remote.name === "Cloudflare" && (
<div className="relative z-0 w-full h-full mb-6 group">
<input
className="block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-800 appearance-none focus:outline-none focus:ring-0 focus:border-blue-600 peer"
Expand All @@ -122,7 +122,7 @@ const Remote = (props) => {
dispatch(
updateAccountId({
accountId: e.target.value.trim(),
remoteType
remoteType,
})
);
}}
Expand All @@ -131,7 +131,7 @@ const Remote = (props) => {
htmlFor="accountId"
className="peer-focus:font-medium absolute text-base duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6"
>
Account ID {remote.accountId.length > 1 && <>{'\u2705'}</>}
Account ID {remote.accountId.length > 1 && <>{"\u2705"}</>}
</label>
</div>
)}
Expand All @@ -144,7 +144,7 @@ const Remote = (props) => {
</div>
)}

{remote.selectedBucket && remoteType === 'destination' ? (
{remote.selectedBucket && remoteType === "destination" ? (
<StartMigrationButton></StartMigrationButton>
) : null}
</div>
Expand Down
26 changes: 13 additions & 13 deletions client/components/RemoteContainer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useSelector } from 'react-redux';
import RemoteSelection from './RemoteSelection';
import Remote from './Remote';
import React from "react";
import { useSelector } from "react-redux";
import RemoteSelection from "./RemoteSelection";
import Remote from "./Remote";

export const RemoteContainer = (props) => {
const { origin, destination } = useSelector((state) => state.GUI);
Expand All @@ -11,10 +11,10 @@ export const RemoteContainer = (props) => {
<div className="grid grid-rows-1 grid-cols-2 mx-32 my-16 p-6">
<div className="mx-20 my-8">
{!origin.name ? (
<RemoteSelection source={'Origin'}></RemoteSelection>
<RemoteSelection source={"Origin"}></RemoteSelection>
) : (
<Remote
remoteType={'origin'}
remoteType={"origin"}
accessIdHandler={accessIdHandler}
secretKeyHandler={secretKeyHandler}
displayName={origin.displayName}
Expand All @@ -24,10 +24,10 @@ export const RemoteContainer = (props) => {

<div className="mx-20 my-8">
{!destination.name ? (
<RemoteSelection source={'Destinaton'}></RemoteSelection>
<RemoteSelection source={"Destinaton"}></RemoteSelection>
) : (
<Remote
remoteType={'destination'}
remoteType={"destination"}
accessIdHandler={accessIdHandler}
secretKeyHandler={secretKeyHandler}
displayName={destination.displayName}
Expand All @@ -46,20 +46,20 @@ const accessIdHandler = (e, remote) => {
);
const isCloudflareAccessId = /^[a-z0-9]{32}$/.test(accessId);
const isMicrosoftAccessId =
remote.name === 'azureblob' && !isAmazonAccessId && !isCloudflareAccessId
remote.name === "azureblob" && !isAmazonAccessId && !isCloudflareAccessId
? true
: false;
if (isAmazonAccessId || isCloudflareAccessId || isMicrosoftAccessId) {
return {
...remote,
accessId: accessId.trim(),
errorField: ''
errorField: "",
};
} else {
//this should probably just return a red check mark
return {
...remote,
accessId: ''
accessId: "",
};
}
};
Expand All @@ -74,13 +74,13 @@ const secretKeyHandler = (e, remote) => {
return {
...remote,
secretKey: secretKey.trim(),
errorField: ''
errorField: "",
};
} else {
//this should probably just return a red check mark
return {
...remote,
secretKey: ''
secretKey: "",
};
}
};
50 changes: 28 additions & 22 deletions client/components/RemoteSelection.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
import React from 'react';
import { useDispatch } from 'react-redux';
import React from "react";
import { useDispatch } from "react-redux";

import awsIcon from '../public/aws_edited.png'
import cloudflareIcon from '../public/cloudflare_edited.png'
import {updateRemoteName} from '../slice'
import awsIcon from "../public/aws_edited.png";
import cloudflareIcon from "../public/cloudflare_edited.png";
import { updateRemoteName } from "../slice";

const RemoteSelection = (props) => {
const dispatch = useDispatch()
const {source} = props
const dispatch = useDispatch();
const { source } = props;

const changeSourceHandler = (e) => {
const displayNames = {
azureblob: 'Microsoft Storage Container',
Cloudflare: 'Cloudflare R2',
AWS: 'Amazon S3'
}
azureblob: "Microsoft Storage Container",
Cloudflare: "Cloudflare R2",
AWS: "Amazon S3",
};

const name = e.target.id;
const displayName = displayNames[name]
dispatch(updateRemoteName({name, source, displayName}))
}
const displayName = displayNames[name];

dispatch(updateRemoteName({ name, source, displayName }));
};

return (
<>
<h1>{props.source}</h1>
<button typeof='button' onClick={changeSourceHandler}><img id='AWS' src={awsIcon} alt='aws'></img>AWS</button>
<button typeof='button' onClick={changeSourceHandler}><img id='Cloudflare' src={cloudflareIcon} alt='cloudflare'></img>Cloudflare</button>
<button typeof='button' onClick={changeSourceHandler}><img id='azureblob' src={awsIcon} alt='azure'></img>MS Azure</button>
<h1>{props.source}</h1>
<button typeof="button" onClick={changeSourceHandler}>
<img id="AWS" src={awsIcon} alt="aws"></img>AWS
</button>
<button typeof="button" onClick={changeSourceHandler}>
<img id="Cloudflare" src={cloudflareIcon} alt="cloudflare"></img>
Cloudflare
</button>
<button typeof="button" onClick={changeSourceHandler}>
<img id="azureblob" src={awsIcon} alt="azure"></img>MS Azure
</button>
</>

)
);
};

export default RemoteSelection;
Loading