Skip to content

Commit

Permalink
changed the button position as well as fixed the localstorage check e…
Browse files Browse the repository at this point in the history
…rror
  • Loading branch information
sudipt1999 committed Mar 10, 2020
1 parent 02f6c37 commit e85c5b4
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 39 deletions.
6 changes: 3 additions & 3 deletions console-frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"files": {
"main.css": "/static/css/main.b015b8f6.chunk.css",
"main.js": "/static/js/main.d86d5b45.chunk.js",
"main.js.map": "/static/js/main.d86d5b45.chunk.js.map",
"main.js": "/static/js/main.4752fb84.chunk.js",
"main.js.map": "/static/js/main.4752fb84.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.a8a9905a.js",
"runtime~main.js.map": "/static/js/runtime~main.a8a9905a.js.map",
"static/js/2.cd05a796.chunk.js": "/static/js/2.cd05a796.chunk.js",
"static/js/2.cd05a796.chunk.js.map": "/static/js/2.cd05a796.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.ed65c3cadafe4d1a4421bf111c0fd46f.js": "/precache-manifest.ed65c3cadafe4d1a4421bf111c0fd46f.js",
"precache-manifest.a47b7618a9685028effd132c1ebe7989.js": "/precache-manifest.a47b7618a9685028effd132c1ebe7989.js",
"service-worker.js": "/service-worker.js",
"static/css/main.b015b8f6.chunk.css.map": "/static/css/main.b015b8f6.chunk.css.map"
}
Expand Down
2 changes: 1 addition & 1 deletion console-frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" crossorigin="use-credentials" href="/manifest.json"/><title>Hydra Agent</title><link href="/static/css/main.b015b8f6.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.cd05a796.chunk.js"></script><script src="/static/js/main.d86d5b45.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" crossorigin="use-credentials" href="/manifest.json"/><title>Hydra Agent</title><link href="/static/css/main.b015b8f6.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.cd05a796.chunk.js"></script><script src="/static/js/main.4752fb84.chunk.js"></script></body></html>
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "017d5e54f0617bd9b1471654163dd88c",
"revision": "57112bdbc86edf3973a4712603b809c8",
"url": "/index.html"
},
{
"revision": "76b12f8a00831fa5c064",
"revision": "e7064fa8b665d67aabd1",
"url": "/static/css/main.b015b8f6.chunk.css"
},
{
"revision": "a60891681800a984f7f5",
"url": "/static/js/2.cd05a796.chunk.js"
},
{
"revision": "76b12f8a00831fa5c064",
"url": "/static/js/main.d86d5b45.chunk.js"
"revision": "e7064fa8b665d67aabd1",
"url": "/static/js/main.4752fb84.chunk.js"
},
{
"revision": "42ac5946195a7306e2a5",
Expand Down
2 changes: 1 addition & 1 deletion console-frontend/build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"/precache-manifest.ed65c3cadafe4d1a4421bf111c0fd46f.js"
"/precache-manifest.a47b7618a9685028effd132c1ebe7989.js"
);

self.addEventListener('message', (event) => {
Expand Down
2 changes: 2 additions & 0 deletions console-frontend/build/static/js/main.4752fb84.chunk.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions console-frontend/build/static/js/main.d86d5b45.chunk.js

This file was deleted.

This file was deleted.

40 changes: 13 additions & 27 deletions console-frontend/src/components/hydra-console/HydraConsole.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ const styles = theme => ({
width: '22%',
},
deleteIconButton: {
marginLeft: '60% !important',
marginBottom: '10px',
backgroundColor: GuiTheme.palette.primary.light,
color: GuiTheme.palette.primary.dark,
'&:hover': {
Expand All @@ -112,14 +114,6 @@ const styles = theme => ({
}
});

function isEmpty(object){
if(Object.keys(object).length === 0)
return true

return false
}


class HydraConsole extends React.Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -158,23 +152,18 @@ class HydraConsole extends React.Component {
}

// Initialize the local storage with the empty values
//localStorage.clear();
const storedProperties = JSON.parse(localStorage.getItem('properties'))
const storedResourceIDs = JSON.parse(localStorage.getItem('resourceIDs'))

if(isEmpty(storedProperties)){
if (localStorage.getItem('properties') === null) {
localStorage.setItem('properties', JSON.stringify(classesProperties))
}else{
classesProperties = storedProperties
classesProperties = JSON.parse(localStorage.getItem('properties'))
}

if(isEmpty(resourcesIDs)){
if (localStorage.getItem('resourceIDs') === null) {
localStorage.setItem('resourceIDs', JSON.stringify(resourcesIDs))
}else{
resourcesIDs = storedResourceIDs
resourcesIDs = JSON.parse(localStorage.getItem('resourceIDs'))
}


this.state = {
hydraClasses: classesMapping,
endpoints: endpoints,
Expand All @@ -190,9 +179,6 @@ class HydraConsole extends React.Component {
componentDidMount() {
}




componentDidUpdate() {
this.restorePropertiesAndResourceIDs()
}
Expand Down Expand Up @@ -463,19 +449,19 @@ class HydraConsole extends React.Component {
this.selectOperation(currProperty)
}}>
</OperationsButtons>
<Button aria-label="delete"
size="medium"
variant="contained"
className={classes.deleteIconButton}
onClick={(e) => this.clearAllInputs(e)}>
CLEAR
</Button>
</Grid>
<Grid
item md={6} xs={12} container
direction="column"
justify="center"
alignItems="center">
<Button aria-label="delete"
size="medium"
variant="contained"
className={classes.deleteIconButton}
onClick={(e) => this.clearAllInputs(e)}>
CLEAR
</Button>
<Grid className={classes.propertiesContainer}
container
direction="row"
Expand Down

0 comments on commit e85c5b4

Please sign in to comment.