Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into reactive-chart-line
Browse files Browse the repository at this point in the history
  • Loading branch information
ofk authored Oct 23, 2018
2 parents 8224807 + 9f40cf9 commit b778464
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 71 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/AxisRangeConfigurator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import * as uiPropTypes from '../store/uiPropTypes';


class AxisRangeConfigurator extends React.Component {
constructor() {
super();
constructor(props) {
super(props);

this.handleRangeTypeChange = this.handleRangeTypeChange.bind(this);
this.handleNumberChange = this.handleNumberChange.bind(this);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/LineConfigurator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const LOG_KEY_NONE = '';


class LineConfigurator extends React.Component {
constructor() {
super();
constructor(props) {
super(props);

this.handleResultChange = this.handleResultChange.bind(this);
this.handleLogKeyChange = this.handleLogKeyChange.bind(this);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/LinesConfigurator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import LineConfigurator from './LineConfigurator';


class LinesConfigurator extends React.Component {
constructor() {
super();
constructor(props) {
super(props);

this.handleModalToggle = this.handleModalToggle.bind(this);
this.handleModalOpen = this.handleModalOpen.bind(this);
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/LogVisualizerLegend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const renderItems = (
})
);

const LogVisualizerTooltip = (props) => {
const LogVisualizerLegend = (props) => {
const {
project, results, resultsStatus, lines, maxHeight, isResultNameAlignRight, onResultSelect
} = props;
Expand All @@ -63,7 +63,7 @@ const LogVisualizerTooltip = (props) => {
);
};

LogVisualizerTooltip.propTypes = {
LogVisualizerLegend.propTypes = {
project: uiPropTypes.project.isRequired,
results: uiPropTypes.results.isRequired,
resultsStatus: uiPropTypes.resultsStatus.isRequired,
Expand All @@ -73,12 +73,12 @@ LogVisualizerTooltip.propTypes = {
onResultSelect: PropTypes.func.isRequired
};

LogVisualizerTooltip.defaultProps = {
LogVisualizerLegend.defaultProps = {
xAxisKey: '',
isResultNameAlignRight: false,
label: undefined,
payload: []
};

export default LogVisualizerTooltip;
export default LogVisualizerLegend;

4 changes: 2 additions & 2 deletions frontend/src/components/PollingStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {


class PollingStatus extends React.Component {
constructor() {
super();
constructor(props) {
super(props);

this.toggleTooltip = this.toggleTooltip.bind(this);

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const store = configureStore();
const history = syncHistoryWithStore(browserHistory, store);

class Root extends React.Component {
constructor() {
super();
constructor(props) {
super(props);
this.state = {
rehydrated: false
};
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/result/CommandFormBase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const initialState = {
};

class CommandFormBase extends React.Component {
constructor() {
super();
constructor(props) {
super(props);

this.openConfirmationModal = this.openConfirmationModal.bind(this);
this.closeConfirmationModal = this.closeConfirmationModal.bind(this);
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/result/CommandScheduleForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
import { SCHEDULE_NOW, SCHEDULE_CUSTOM } from '../../constants';


class SnapshotTakeForm extends React.Component {
constructor() {
super();
class CommandScheduleForm extends React.Component {
constructor(props) {
super(props);

this.handleScheduleTypeChange = this.handleScheduleTypeChange.bind(this);
this.handleScheduleValueChange = this.handleScheduleValueChange.bind(this);
Expand Down Expand Up @@ -85,7 +85,7 @@ class SnapshotTakeForm extends React.Component {
}
}

SnapshotTakeForm.propTypes = {
CommandScheduleForm.propTypes = {
scheduleType: PropTypes.oneOf([SCHEDULE_NOW, SCHEDULE_CUSTOM]).isRequired,
schedule: PropTypes.shape({
value: PropTypes.number,
Expand All @@ -95,8 +95,8 @@ SnapshotTakeForm.propTypes = {
onScheduleChange: PropTypes.func.isRequired
};

SnapshotTakeForm.defaultProps = {
CommandScheduleForm.defaultProps = {
};

export default SnapshotTakeForm;
export default CommandScheduleForm;

120 changes: 71 additions & 49 deletions frontend/src/store/uiPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,58 @@ export const projects = PropTypes.objectOf(project);

export const resultId = PropTypes.number;

export const logs = PropTypes.arrayOf(PropTypes.shape({
resultId,
id: PropTypes.number,
logItems: PropTypes.arrayOf(PropTypes.shape({
logId: PropTypes.number,
key: PropTypes.string.isRequired,
value: PropTypes.any.isRequired
})).isRequired
}));

export const args = PropTypes.arrayOf(PropTypes.shape({
resultId,
key: PropTypes.string,
value: PropTypes.any
key: PropTypes.string.isRequired,
value: PropTypes.any.isRequired
}));

export const commands = PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number,
name: PropTypes.string.isRequired,
request: PropTypes.shape({
created_at: PropTypes.string.isRequired,
schedule: PropTypes.shape({
key: PropTypes.string.isRequired,
value: PropTypes.number.isRequired
}),
body: PropTypes.object
}).isRequired,
response: PropTypes.shape({
status: PropTypes.string.isRequired,
epoch: PropTypes.number.isRequired,
iteration: PropTypes.number.isRequired,
elapsed_time: PropTypes.number,
executed_at: PropTypes.string,
body: PropTypes.object
})
}));

export const snapshots = PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number,
iteration: PropTypes.number.isRequired,
name: PropTypes.string.isRequired
}));

export const result = PropTypes.shape({
id: resultId,
pathName: PropTypes.string,
name: PropTypes.string,
isUnregistered: PropTypes.bool,
logs,
args,
logs: PropTypes.arrayOf(PropTypes.any)
commands,
snapshots
});

export const results = PropTypes.objectOf(result);
Expand All @@ -36,90 +76,72 @@ export const line = PropTypes.shape({
resultId,
logKey: PropTypes.string,
config: PropTypes.shape({
color: PropTypes.string,
isVisible: PropTypes.bool
color: PropTypes.string.isRequired,
isVisible: PropTypes.bool.isRequired
})
});

export const lines = PropTypes.objectOf(line);

export const globalConfig = PropTypes.shape({
chartSize: PropTypes.shape({
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
aspect: PropTypes.number.isRequired
}),
global: PropTypes.shape({
pollingRate: PropTypes.number
}),
pollingRate: PropTypes.number,
logsLimit: PropTypes.number,
isResultNameAlignRight: PropTypes.bool
});

export const resultConfig = PropTypes.shape({
hidden: PropTypes.bool
hidden: PropTypes.bool.isRequired
});

export const resultsConfig = PropTypes.objectOf(resultConfig);

export const logKeyConfig = PropTypes.shape({
selected: PropTypes.bool
selected: PropTypes.bool.isRequired
});

const logKeysConfig = PropTypes.objectOf(logKeyConfig);

export const axisName = PropTypes.string;

const projectConfigAxis = PropTypes.shape({
axisName,
logKeysConfig
export const axisConfig = PropTypes.shape({
axisName: axisName.isRequired,
logKeysConfig,
scale: PropTypes.string,
scaleRange: PropTypes.objectOf(PropTypes.shape({
range: PropTypes.arrayOf(PropTypes.number).isRequired,
rangeTypes: PropTypes.arrayOf(PropTypes.string).isRequired
}))
});

export const projectConfig = PropTypes.shape({
axes: PropTypes.shape({
xAxis: projectConfigAxis,
yLeftAxis: projectConfigAxis,
yRightAxis: projectConfigAxis
}),
global: PropTypes.objectOf(PropTypes.any),
xAxis: axisConfig,
yLeftAxis: axisConfig,
yRightAxis: axisConfig
}).isRequired,
tableState: PropTypes.shape({
expanded: PropTypes.any
expanded: PropTypes.oneOfType([
PropTypes.bool, PropTypes.object
]),
hiddenLogKeys: PropTypes.arrayOf(PropTypes.string),
hiddenArgKeys: PropTypes.arrayOf(PropTypes.string)
}).isRequired,
resultsConfig,
lines,
hiddenLogKeys: PropTypes.array,
hiddenArgKeys: PropTypes.array
});

export const axisConfig = PropTypes.shape({
axisName: axisName.isRequired,
scale: PropTypes.string,
scaleRange: PropTypes.objectOf(PropTypes.shape({
rangeTypes: PropTypes.arrayOf(PropTypes.string),
range: PropTypes.arrayOf(PropTypes.number)
})),
logKeys: logKeysConfig
lines: lines.isRequired
});

export const stats = PropTypes.shape({
axes: PropTypes.objectOf(PropTypes.any),
argKeys: PropTypes.arrayOf(PropTypes.string),
logKeys: PropTypes.arrayOf(PropTypes.string),
xAxisKeys: PropTypes.arrayOf(PropTypes.string)
axes: PropTypes.objectOf(PropTypes.object),
argKeys: PropTypes.arrayOf(PropTypes.string).isRequired,
logKeys: PropTypes.arrayOf(PropTypes.string).isRequired,
xAxisKeys: PropTypes.arrayOf(PropTypes.string).isRequired
});

export const commands = PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number,
name: PropTypes.string,
body: PropTypes.string
}));

export const snapshots = PropTypes.arrayOf(PropTypes.shape({
iteration: PropTypes.number,
name: PropTypes.string
}));

export const resultStatus = PropTypes.shape({
selected: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
});
Expand Down

0 comments on commit b778464

Please sign in to comment.