Skip to content

Commit

Permalink
πŸ‘©πŸ»β€πŸ’» WORKING IN PROGRESS
Browse files Browse the repository at this point in the history
  • Loading branch information
XuTheBunny committed Jan 26, 2022
1 parent 9558c47 commit bf282de
Show file tree
Hide file tree
Showing 19 changed files with 1,630 additions and 9 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"query-string": "^6.12.1",
"react": "^16.8.3",
"react-app-rewire-postcss": "^3.0.2",
"react-charts": "^2.0.0-beta.7",
"react-copy-to-clipboard": "^5.0.1",
"react-datasheet": "^1.4.1",
"react-dom": "^16.8.3",
Expand All @@ -49,6 +50,7 @@
"react-editor-js": "^1.9.0",
"react-helmet": "^5.2.1",
"react-hot-loader": "^4.3.12",
"react-icons": "^4.3.1",
"react-markdown": "^4.2.2",
"react-modal": "^3.8.1",
"react-router-dom": "^5.2.0",
Expand Down
16 changes: 16 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ body {
margin-top: 0px !important;
}

.mt--10 {
margin-top: -10px !important;
}

.mr-0 {
margin-right: 0px !important;
}
Expand Down Expand Up @@ -342,6 +346,10 @@ body {
color: #676767 !important;
}

.text-dark-grey {
color: #5e5e5e !important;
}

.text-black {
color: #000000 !important;
}
Expand Down Expand Up @@ -542,6 +550,14 @@ body {
height: 38px !important;
}

.h-24 {
height: 24px !important;
}

.h-220 {
height: 220px !important;
}

.small-inline {
display: inline-block;
padding-top: 10px;
Expand Down
Binary file added src/assets/s3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 33 additions & 2 deletions src/common/dateUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Reformat time to the "DD MMM YYYY" format like "12 Aug 2019"
export const longDate = (date) => {
export const longDate = date => {
var mydate = new Date(date);
var month = [
'Jan',
Expand All @@ -19,7 +19,7 @@ export const longDate = (date) => {
return str;
};

export const toYearMonthDay = (isoDate) => {
export const toYearMonthDay = isoDate => {
/*
* Convert ISO8601 UTC datetime string to local datetime and format as
* yyyy-mm-dd date string.
Expand All @@ -39,3 +39,34 @@ export const toYearMonthDay = (isoDate) => {
}
return date;
};

// Reformat time to the date and time format
export const dateTime = date => {
var mydate = new Date(date);
var month = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sept',
'Oct',
'Nov',
'Dec',
][mydate.getMonth()];
const weekday = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
var str =
weekday[mydate.getDay()] +
', ' +
month +
' ' +
mydate.getUTCDate() +
', ' +
mydate.getFullYear() +
', ' +
mydate.toLocaleTimeString([], {hour: '2-digit', minute: '2-digit'});
return str;
};
1 change: 1 addition & 0 deletions src/common/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ export const permissionIcon = {
validationresultset: 'code',
datatemplate: 'file excel',
organization: 'group',
storageanalysis: 'box',
};

// Icon color for different permissions
Expand Down
6 changes: 6 additions & 0 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ const Header = ({location}) => {
<Label content="beta" color="blue" attached="bottom right" />
</Menu.Item>
)}
{hasPermission(profile, 'view_settings') && (
<Menu.Item as={Nav} to="/s3-accounting">
S3 Accounting
<Label content="beta" color="blue" attached="bottom right" />
</Menu.Item>
)}
<Menu.Menu position="right">
{hasPermission(profile, 'add_referraltoken') && (
<AddUserButton profile={profile} />
Expand Down
3 changes: 2 additions & 1 deletion src/documents/utilities.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {KF_STUDY_API} from '../common/globals';
import * as stringSimilarity from 'string-similarity';

import {KF_STUDY_API} from '../common/globals';

// Compare date of file versions based on their createdAt time. (Latest first)
export const dateCompare = (version1, version2) => {
return new Date(version2.node.createdAt) - new Date(version1.node.createdAt);
Expand Down
2 changes: 2 additions & 0 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
TemplatesView,
} from '../admin/views';
import ReleaseRoutes from '../releases/routes';
import S3AccountingRoutes from '../s3Accounting/routes';
import TrackedRoute from './TrackedRoute';

const Routes = () => (
Expand All @@ -74,6 +75,7 @@ const Routes = () => (
<PrivateRoute exact path="/" component={StudyListView} />
<PrivateRoute exact path="/study" component={StudyListView} />
<ReleaseRoutes path="/releases" />
<S3AccountingRoutes path="/s3-accounting" />
<TrackedRoute
path="/welcome"
component={WelcomeView}
Expand Down
Loading

0 comments on commit bf282de

Please sign in to comment.