summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-15 14:36:37 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:06:03 +0200
commit326b74fc39f63f47c71359276601ea93f7345dc6 (patch)
tree692684391eef98b019c27ff48c6eefba504c4b88
parent653290da64e3d85f422d1f00407b74011999a5fa (diff)
Shrink buttons of experiment and simulation rows
-rw-r--r--src/components/experiments/ExperimentRowComponent.js4
-rw-r--r--src/components/simulations/SimulationActionButtons.js19
-rw-r--r--src/store/denormalizer.js30
3 files changed, 17 insertions, 36 deletions
diff --git a/src/components/experiments/ExperimentRowComponent.js b/src/components/experiments/ExperimentRowComponent.js
index b7468ac7..4fb8cbc1 100644
--- a/src/components/experiments/ExperimentRowComponent.js
+++ b/src/components/experiments/ExperimentRowComponent.js
@@ -12,13 +12,13 @@ const ExperimentRowComponent = ({experiment, simulationId, onDelete}) => (
<td className="text-right">
<Link
to={"/simulations/" + simulationId + "/experiments/" + experiment.id}
- className="btn btn-outline-primary mr-1"
+ className="btn btn-outline-primary btn-sm mr-1"
title="Open this experiment"
>
<span className="fa fa-play"/>
</Link>
<div
- className="btn btn-outline-danger"
+ className="btn btn-outline-danger btn-sm"
title="Delete this experiment"
onClick={() => onDelete(experiment.id)}
>
diff --git a/src/components/simulations/SimulationActionButtons.js b/src/components/simulations/SimulationActionButtons.js
index 448944c8..c9a8a151 100644
--- a/src/components/simulations/SimulationActionButtons.js
+++ b/src/components/simulations/SimulationActionButtons.js
@@ -4,14 +4,25 @@ import {Link} from "react-router-dom";
const SimulationActionButtons = ({simulationId, onViewUsers, onDelete}) => (
<td className="text-right">
- <Link to={"/simulations/" + simulationId} className="btn btn-outline-primary mr-1" title="Open this simulation">
+ <Link
+ to={"/simulations/" + simulationId}
+ className="btn btn-outline-primary btn-sm mr-1"
+ title="Open this simulation"
+ >
<span className="fa fa-play"/>
</Link>
- <div className="btn btn-outline-success mr-1" title="View and edit collaborators"
- onClick={() => onViewUsers(simulationId)}>
+ <div
+ className="btn btn-outline-success btn-sm mr-1"
+ title="View and edit collaborators"
+ onClick={() => onViewUsers(simulationId)}
+ >
<span className="fa fa-users"/>
</div>
- <div className="btn btn-outline-danger" title="Delete this simulation" onClick={() => onDelete(simulationId)}>
+ <div
+ className="btn btn-outline-danger btn-sm"
+ title="Delete this simulation"
+ onClick={() => onDelete(simulationId)}
+ >
<span className="fa fa-trash"/>
</div>
</td>
diff --git a/src/store/denormalizer.js b/src/store/denormalizer.js
deleted file mode 100644
index e6583ae7..00000000
--- a/src/store/denormalizer.js
+++ /dev/null
@@ -1,30 +0,0 @@
-const EXCLUDED_IDENTIFIERS = [
- "objectId",
- "googleId",
-];
-
-export function denormalize(state, objectType, id) {
- return denormalizeWithRecursionCheck(state, objectType, id, undefined);
-}
-
-function denormalizeWithRecursionCheck(state, objectType, id, previousType) {
- const object = Object.assign({}, state.objects[objectType][id]);
-
- for (let prop in object) {
- if (prop.indexOf(previousType) !== -1) {
- continue;
- }
-
- if (prop.endsWith("Id") && EXCLUDED_IDENTIFIERS.indexOf(prop) === -1) {
- const propType = prop.replace("Id", "");
- object[propType] = denormalizeWithRecursionCheck(state, propType, object[prop], objectType);
- }
-
- if (prop.endsWith("Ids")) {
- const propType = prop.replace("Ids", "");
- object[propType + "s"] = object[prop].map(id => denormalizeWithRecursionCheck(state, propType, id, objectType));
- }
- }
-
- return object;
-}