Skip to content

Commit

Permalink
Dashboard Loading + Prettier files (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaldivia authored May 15, 2020
1 parent 6fef30f commit 35c3b53
Show file tree
Hide file tree
Showing 24 changed files with 483 additions and 456 deletions.
219 changes: 121 additions & 98 deletions portal-ui/bindata_assetfs.go

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBo
const styles = (theme: Theme) =>
createStyles({
errorBlock: {
color: "red"
color: "red",
},
buttonContainer: {
textAlign: "right"
textAlign: "right",
},
...modalBasic
...modalBasic,
});

interface IAddBucketProps {
Expand All @@ -51,7 +51,7 @@ class AddBucket extends React.Component<IAddBucketProps, IAddBucketState> {
state: IAddBucketState = {
addLoading: false,
addError: "",
bucketName: ""
bucketName: "",
};

addRecord(event: React.FormEvent) {
Expand All @@ -63,23 +63,23 @@ class AddBucket extends React.Component<IAddBucketProps, IAddBucketState> {
this.setState({ addLoading: true }, () => {
api
.invoke("POST", "/api/v1/buckets", {
name: bucketName
name: bucketName,
})
.then(res => {
.then((res) => {
this.setState(
{
addLoading: false,
addError: ""
addError: "",
},
() => {
this.props.closeModalAndRefresh();
}
);
})
.catch(err => {
.catch((err) => {
this.setState({
addLoading: false,
addError: err
addError: err,
});
});
});
Expand Down
44 changes: 22 additions & 22 deletions portal-ui/src/screens/Console/Buckets/ViewBucket/AddEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapp
const styles = (theme: Theme) =>
createStyles({
errorBlock: {
color: "red"
color: "red",
},
minTableHeader: {
color: "#393939",
"& tr": {
"& th": {
fontWeight: "bold"
}
}
fontWeight: "bold",
},
},
},
buttonContainer: {
textAlign: "right"
textAlign: "right",
},
...modalBasic
...modalBasic,
});

interface IAddEventProps {
Expand Down Expand Up @@ -76,7 +76,7 @@ class AddEvent extends React.Component<IAddEventProps, IAddEventState> {
suffix: "",
arn: "",
selectedEvents: [],
arnList: []
arnList: [],
};

addRecord(event: React.FormEvent) {
Expand All @@ -93,25 +93,25 @@ class AddEvent extends React.Component<IAddEventProps, IAddEventState> {
arn: arn,
events: selectedEvents,
prefix: prefix,
suffix: suffix
suffix: suffix,
},
ignoreExisting: true
ignoreExisting: true,
})
.then(res => {
.then((res) => {
this.setState(
{
addLoading: false,
addError: ""
addError: "",
},
() => {
this.props.closeModalAndRefresh();
}
);
})
.catch(err => {
.catch((err) => {
this.setState({
addLoading: false,
addError: err
addError: err,
});
});
});
Expand All @@ -129,7 +129,7 @@ class AddEvent extends React.Component<IAddEventProps, IAddEventState> {
this.setState({
addLoading: false,
arnList: arns,
addError: ""
addError: "",
});
})
.catch((err: any) => {
Expand All @@ -151,13 +151,13 @@ class AddEvent extends React.Component<IAddEventProps, IAddEventState> {
selectedEvents,
arnList,
prefix,
suffix
suffix,
} = this.state;

const events = [
{ label: "PUT - Object Uploaded", value: "put" },
{ label: "GET - Object accessed", value: "get" },
{ label: "DELETE - Object Deleted", value: "delete" }
{ label: "DELETE - Object Deleted", value: "delete" },
];

const handleClick = (
Expand All @@ -183,9 +183,9 @@ class AddEvent extends React.Component<IAddEventProps, IAddEventState> {
this.setState({ selectedEvents: newSelected });
};

const arnValues = arnList.map(arnConstant => ({
const arnValues = arnList.map((arnConstant) => ({
label: arnConstant,
value: arnConstant
value: arnConstant,
}));

return (
Expand Down Expand Up @@ -239,19 +239,19 @@ class AddEvent extends React.Component<IAddEventProps, IAddEventState> {
</TableRow>
</TableHead>
<TableBody>
{events.map(row => (
{events.map((row) => (
<TableRow
key={`group-${row.value}`}
onClick={event => handleClick(event, row.value)}
onClick={(event) => handleClick(event, row.value)}
>
<TableCell padding="checkbox">
<Checkbox
value={row.value}
color="primary"
inputProps={{
"aria-label": "secondary checkbox"
"aria-label": "secondary checkbox",
}}
onChange={event => handleClick(event, row.value)}
onChange={(event) => handleClick(event, row.value)}
checked={selectedEvents.includes(row.value)}
/>
</TableCell>
Expand Down
16 changes: 8 additions & 8 deletions portal-ui/src/screens/Console/Buckets/ViewBucket/DeleteEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
DialogContent,
DialogContentText,
DialogTitle,
LinearProgress
LinearProgress,
} from "@material-ui/core";
import api from "../../../../common/api";
import { BucketEvent, BucketList } from "../types";
Expand All @@ -33,8 +33,8 @@ import Typography from "@material-ui/core/Typography";
const styles = (theme: Theme) =>
createStyles({
errorBlock: {
color: "red"
}
color: "red",
},
});

interface IDeleteEventProps {
Expand All @@ -56,7 +56,7 @@ class DeleteEvent extends React.Component<
> {
state: IDeleteEventState = {
deleteLoading: false,
deleteError: ""
deleteError: "",
};

removeRecord() {
Expand All @@ -80,24 +80,24 @@ class DeleteEvent extends React.Component<
{
events,
prefix,
suffix
suffix,
}
)
.then((res: BucketList) => {
this.setState(
{
deleteLoading: false,
deleteError: ""
deleteError: "",
},
() => {
this.props.closeDeleteModalAndRefresh(true);
}
);
})
.catch(err => {
.catch((err) => {
this.setState({
deleteLoading: false,
deleteError: err
deleteError: err,
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapp
const styles = (theme: Theme) =>
createStyles({
errorBlock: {
color: "red"
color: "red",
},
...modalBasic
...modalBasic,
});

interface ISetAccessPolicyProps {
Expand All @@ -51,7 +51,7 @@ class SetAccessPolicy extends React.Component<
state: ISetAccessPolicyState = {
addLoading: false,
addError: "",
accessPolicy: ""
accessPolicy: "",
};

addRecord(event: React.FormEvent) {
Expand All @@ -64,23 +64,23 @@ class SetAccessPolicy extends React.Component<
this.setState({ addLoading: true }, () => {
api
.invoke("PUT", `/api/v1/buckets/${bucketName}/set-policy`, {
access: accessPolicy
access: accessPolicy,
})
.then(res => {
.then((res) => {
this.setState(
{
addLoading: false,
addError: ""
addError: "",
},
() => {
this.props.closeModalAndRefresh();
}
);
})
.catch(err => {
.catch((err) => {
this.setState({
addLoading: false,
addError: err
addError: err,
});
});
});
Expand Down Expand Up @@ -130,7 +130,7 @@ class SetAccessPolicy extends React.Component<
}}
options={[
{ value: "PRIVATE", label: "Private" },
{ value: "PUBLIC", label: "Public" }
{ value: "PUBLIC", label: "Public" },
]}
/>
</Grid>
Expand Down
Loading

0 comments on commit 35c3b53

Please sign in to comment.