Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
"private": true,
"scripts": {
"build": "webpack --mode production --config webpack.prod.js",
"clean-source": "rm ./public/hdb.css && rm ./public/hdb.js",
"start": "webpack-dev-server --mode development --config webpack.dev.js",
"lint": "eslint --fix src && sass-lint --verbose",
"deploy": "npm run build && npm run clean-source && scp -r ./public/* ubuntu@fcfleet.demo.harperdb.io:/home/ubuntu/sites/studio-stage"
"lint": "eslint --fix src && sass-lint --verbose"
},
"author": "harperdb",
"license": "Apache-2.0",
Expand Down
1 change: 0 additions & 1 deletion src/api/instance/addUser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import queryInstance from '../queryInstance';

export default async ({ auth, role, username, password }) => queryInstance({ operation: 'add_user', role, username, password, active: true }, auth);

1 change: 0 additions & 1 deletion src/api/instance/listUsers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import queryInstance from '../queryInstance';

export default async ({ auth }) => queryInstance({ operation: 'list_users' }, auth);

2 changes: 1 addition & 1 deletion src/api/lms/addLicense.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export default async ({ auth, payload: { instance_id, customer_id, stripe_produc
auth,
});

return response.body
return response.body;
};
16 changes: 7 additions & 9 deletions src/api/lms/getProducts.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import queryLMS from '../queryLMS';

const buildRadioSelectProductOptions = ({ id, amount_decimal, interval, amount, metadata: { instance_ram } }) => {
return {
price: amount_decimal !== '0' ? (amount_decimal / 100).toFixed(2) : 'FREE',
ram: instance_ram,
interval,
label: `${instance_ram} RAM | ${amount_decimal !== '0' ? `${amount}/${interval}` : 'FREE'}`,
value: id,
};
};
const buildRadioSelectProductOptions = ({ id, amount_decimal, interval, amount, metadata: { instance_ram } }) => ({
price: amount_decimal !== '0' ? (amount_decimal / 100).toFixed(2) : 'FREE',
ram: instance_ram,
interval,
label: `${instance_ram} RAM | ${amount_decimal !== '0' ? `${amount}/${interval}` : 'FREE'}`,
value: id,
});

const buildRadioSelectStorageOptions = (size, { tiers, interval }) => {
const pricingTier = tiers.find((p) => (p.up_to && size <= p.up_to) || !p.up_to);
Expand Down
2 changes: 1 addition & 1 deletion src/api/lms/updateLicense.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export default async ({ auth, payload: { license_id, instance_id, customer_id, s
});

return response.body;
}
};
13 changes: 2 additions & 11 deletions src/api/queryLMS.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,11 @@ import licenses from '../../mock_data/LMS_API.licenses.json';

// eslint-disable-next-line no-unused-vars
export default async ({ endpoint, payload, auth }) => {
if ((auth.user !== 'test@harperdb.io' || auth.pass !== 'a') && (auth.user !== 'david@harperdb.io' || auth.pass !== 'harperdb')) {
return {
body: {
result: false,
message: 'unknown user or password',
},
};
}

const completedEndpoints = ['addCustomer'];
const completedEndpoints = ['addCustomer', 'getUser'];

if (completedEndpoints.includes(endpoint)) {
const request = await fetch(
`https://api.harperdbcloudservices.com/Prod/${endpoint}`,
`https://poqwe1evwb.execute-api.us-east-2.amazonaws.com/Dev/${endpoint}`,
{
method: 'POST',
body: JSON.stringify(payload),
Expand Down
2 changes: 1 addition & 1 deletion src/components/account/billing/cardEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button, Row, Col, Input } from '@nio/ui-kit';
import { CardNumberElement, CardExpiryElement, CardCvcElement, useElements, useStripe } from '@stripe/react-stripe-js';
import useAsyncEffect from 'use-async-effect';
import { useLocation, useHistory } from 'react-router-dom';
import queryString from 'query-string'
import queryString from 'query-string';

import cardOptions from '../../../util/stripe/cardOptions';
import useLMS from '../../../state/stores/lmsAuth';
Expand Down
2 changes: 1 addition & 1 deletion src/components/instance/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export default ({ auth, details, refreshInstance }) => {
)}
</>
);
}
};
1 change: 0 additions & 1 deletion src/util/datatable/instanceUserColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { Button } from '@nio/ui-kit';



const toggleCellPadding = { paddingTop: 3, paddingBottom: 0, paddingLeft: 0, paddingRight: 2 };

export default ({ deleteUser }) => [{
Expand Down
4 changes: 0 additions & 4 deletions src/util/stripe/getInstancePrice.js

This file was deleted.