Skip to content

Commit

Permalink
recompile
Browse files Browse the repository at this point in the history
  • Loading branch information
Akramhar committed Oct 26, 2022
1 parent f248c36 commit f34c54e
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 60 deletions.
19 changes: 10 additions & 9 deletions es/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ var _constants = require("./constants");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
Expand Down Expand Up @@ -2770,31 +2768,34 @@ var MicroMetaAppReact = /*#__PURE__*/function (_React$PureComponent) {
});

if (!this.state.isCreatingNewMicroscope) {
var _React$createElement;

var footerSettingsSchemas = [imageSchema, pixelsSchema];
var footerSettingsInput = [setting, setting.Pixels]; //{overlayImporter}

return /*#__PURE__*/_react.default.createElement(MicroMetaAppReactContainer, {
width: width,
height: height,
forwardedRef: this.overlaysContainerRef
}, /*#__PURE__*/_react.default.createElement(_header.default, (_React$createElement = {
}, /*#__PURE__*/_react.default.createElement(_header.default, {
dimensions: headerFooterDims,
imagesPathPNG: imagesPathPNG,
imagesPathSVG: imagesPathSVG,
isDebug: this.props.isDebug,
isSchemaValidated: this.state.isSettingValidated,
onFormConfirm: this.onSettingDataSave,
onClickChangeValidation: this.createAdaptedSchemas,
inputData: footerSettingsInput,
element: "image settings",
formTitle: setting.Name,
activeTier: this.state.activeTier,
validationTier: this.state.validationTier,
componentSchemas: componentsSchema,
schema: footerSettingsSchemas
}, _defineProperty(_React$createElement, "inputData", footerSettingsInput), _defineProperty(_React$createElement, "elementByType", elementByType), _defineProperty(_React$createElement, "is4DNPortal", this.state.is4DNPortal), _defineProperty(_React$createElement, "overlaysContainer", this.overlaysContainerRef.current), _defineProperty(_React$createElement, "appVersion", _package.version), _defineProperty(_React$createElement, "modelVersion", this.state.modelVersion), _React$createElement)), /*#__PURE__*/_react.default.createElement(_settingsMainView.default, {
schema: footerSettingsSchemas,
inputData: footerSettingsInput,
elementByType: elementByType,
is4DNPortal: this.state.is4DNPortal,
overlaysContainer: this.overlaysContainerRef.current,
appVersion: _package.version,
modelVersion: this.state.modelVersion
}), /*#__PURE__*/_react.default.createElement(_settingsMainView.default, {
microscope: microscope,
microscopeComponents: elementData,
activeTier: this.state.activeTier,
Expand Down Expand Up @@ -2892,13 +2893,13 @@ var MicroMetaAppReact = /*#__PURE__*/function (_React$PureComponent) {
isSchemaValidated: this.state.isMicroscopeValidated,
onFormConfirm: this.onMicroscopeDataSave,
onClickChangeValidation: this.createAdaptedSchemas,
inputData: footerMicroscopeInput,
element: "microscope",
formTitle: microscope.Name,
activeTier: this.state.activeTier,
validationTier: this.state.validationTier,
componentSchemas: componentsSchema,
schema: footerMicroscopeSchemas,
inputData: footerMicroscopeInput,
elementByType: elementByType,
is4DNPortal: this.state.is4DNPortal,
overlaysContainer: this.overlaysContainerRef.current,
Expand Down
57 changes: 33 additions & 24 deletions es/components/canvasElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ var CanvasElement = /*#__PURE__*/function (_React$PureComponent) {

_this = _super.call(this, props);
_this.state = {
editing: false
editing: false,
editForm: null
};
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
_this.handleConfirm = _this.handleConfirm.bind(_assertThisInitialized(_this));
Expand All @@ -69,16 +70,35 @@ var CanvasElement = /*#__PURE__*/function (_React$PureComponent) {
value: function handleClick() {
if (!this.props.isViewOnly) {
this.props.setEditingOnCanvas(true);

var editForm = /*#__PURE__*/_react.default.createElement(_multiTabFormWithHeaderV.default, {
title: "Edit " + this.props.formTitle,
schema: this.props.schema,
inputData: this.props.inputData,
id: this.props.id,
onConfirm: this.handleConfirm,
onCancel: this.handleCancel,
overlaysContainer: this.props.overlaysContainer,
currentChildrenComponentIdentifier: this.props.currentChildrenComponentIdentifier,
minChildrenComponentIdentifier: this.props.minChildrenComponentIdentifier,
maxChildrenComponentIdentifier: this.props.maxChildrenComponentIdentifier,
elementByType: this.props.elementByType,
editable: true,
isDebug: this.props.isDebug
});

this.setState({
editing: true
editing: true,
editForm: editForm
});
}
}
}, {
key: "handleConfirm",
value: function handleConfirm(id, data, linkedFields) {
this.setState({
editing: false
editing: false,
editForm: null
});
this.props.setEditingOnCanvas(false);
this.props.handleConfirm(id, data, linkedFields);
Expand All @@ -88,7 +108,8 @@ var CanvasElement = /*#__PURE__*/function (_React$PureComponent) {
value: function handleCancel() {
this.props.setEditingOnCanvas(false);
this.setState({
editing: false
editing: false,
editForm: null
});
}
}, {
Expand Down Expand Up @@ -131,24 +152,6 @@ var CanvasElement = /*#__PURE__*/function (_React$PureComponent) {
}, {
key: "render",
value: function render() {
if (this.state.editing) {
return /*#__PURE__*/_react.default.createElement(_multiTabFormWithHeaderV.default, {
title: "Edit " + this.props.formTitle,
schema: this.props.schema,
inputData: this.props.inputData,
id: this.props.id,
onConfirm: this.handleConfirm,
onCancel: this.handleCancel,
overlaysContainer: this.props.overlaysContainer,
currentChildrenComponentIdentifier: this.props.currentChildrenComponentIdentifier,
minChildrenComponentIdentifier: this.props.minChildrenComponentIdentifier,
maxChildrenComponentIdentifier: this.props.maxChildrenComponentIdentifier,
elementByType: this.props.elementByType,
editable: true,
isDebug: this.props.isDebug
});
}

var style = {
textAlign: "center",
height: "100%",
Expand Down Expand Up @@ -187,7 +190,13 @@ var CanvasElement = /*#__PURE__*/function (_React$PureComponent) {
var minHeight = this.props.minHeight;
var maxWidth = this.props.maxWidth;
var maxHeight = this.props.maxHeight;
return /*#__PURE__*/_react.default.createElement(_reactResizable.ResizableBox, {
var editForm = null;

if (this.state.editing) {
editForm = this.state.editForm;
}

return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactResizable.ResizableBox, {
width: width,
height: height,
minConstraints: [minWidth, minHeight],
Expand All @@ -207,7 +216,7 @@ var CanvasElement = /*#__PURE__*/function (_React$PureComponent) {
image: this.props.image,
name: this.props.schema.title,
style: styleImage
})));
}))), editForm);
}
}]);

Expand Down
2 changes: 0 additions & 2 deletions es/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ var _Dropdown = _interopRequireDefault(require("react-bootstrap/Dropdown"));

var _ButtonGroup = _interopRequireDefault(require("react-bootstrap/ButtonGroup"));

var _multiTabFormWithHeaderV = _interopRequireDefault(require("./multiTabFormWithHeaderV3"));

var _dropdownMenu = _interopRequireDefault(require("./dropdownMenu"));

var _popoverTooltip = _interopRequireDefault(require("./popoverTooltip"));
Expand Down
56 changes: 31 additions & 25 deletions es/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ var Header = /*#__PURE__*/function (_React$PureComponent) {
_this = _super.call(this, props);
_this.state = {
viewAbout: false,
editing: false
editing: false,
editForm: null
};
_this.onClickEdit = _this.onClickEdit.bind(_assertThisInitialized(_this));
_this.onFormConfirm = _this.onFormConfirm.bind(_assertThisInitialized(_this));
Expand Down Expand Up @@ -96,23 +97,40 @@ var Header = /*#__PURE__*/function (_React$PureComponent) {
}, {
key: "onClickEdit",
value: function onClickEdit() {
var editForm = /*#__PURE__*/_react.default.createElement(_multiTabFormWithHeaderV.default, {
title: "Edit " + this.props.formTitle //schemas={this.props.componentSchemas}
,
schema: this.props.schema,
inputData: this.props.inputData //id={this.props.id}
,
onConfirm: this.onFormConfirm,
onCancel: this.onFormCancel,
overlaysContainer: this.props.overlaysContainer,
editable: true,
elementByType: this.props.elementByType,
isDebug: this.props.isDebug
});

this.setState({
editing: true
editing: true,
editForm: editForm
});
}
}, {
key: "onFormConfirm",
value: function onFormConfirm(id, data) {
this.setState({
editing: false
editing: false,
editForm: null
});
this.props.onFormConfirm(id, data);
}
}, {
key: "onFormCancel",
value: function onFormCancel() {
this.setState({
editing: false
editing: false,
editForm: null
});
}
}, {
Expand Down Expand Up @@ -310,6 +328,10 @@ var Header = /*#__PURE__*/function (_React$PureComponent) {
index++;
}

if (this.props.isDebug) {
console.log("RERENDER");
}

if (this.state.viewAbout) {
var wrapperContainer = {
display: "flex",
Expand Down Expand Up @@ -372,8 +394,7 @@ var Header = /*#__PURE__*/function (_React$PureComponent) {
}, /*#__PURE__*/_react.default.createElement("img", {
src: logoPath,
alt: this.props.logoImg,
style: _styleImage,
onLoad: this.onImgLoad
style: _styleImage
})), /*#__PURE__*/_react.default.createElement("div", {
style: styleButtonContainer
}, buttons), /*#__PURE__*/_react.default.createElement(_modalWindow.default, {
Expand All @@ -389,8 +410,7 @@ var Header = /*#__PURE__*/function (_React$PureComponent) {
}, /*#__PURE__*/_react.default.createElement("img", {
src: bigLogoPath,
alt: this.props.bigLogoImg,
style: _styleImage,
onLoad: this.onImgLoad
style: _styleImage
}))), /*#__PURE__*/_react.default.createElement("div", {
style: container1
}, /*#__PURE__*/_react.default.createElement("p", null, "Micro Meta App is an open, easy-to-use, and powerful software platform that provides an intuitive visual guide to capturing and managing Microscopy Metadata on the basis of the", " ", /*#__PURE__*/_react.default.createElement("a", {
Expand All @@ -414,23 +434,10 @@ var Header = /*#__PURE__*/function (_React$PureComponent) {
}, /*#__PURE__*/_react.default.createElement("img", {
src: logoPath,
alt: this.props.logoImg,
style: styleImage,
onLoad: this.onImgLoad
style: styleImage
})), /*#__PURE__*/_react.default.createElement("div", {
style: styleButtonContainer
}, buttons), /*#__PURE__*/_react.default.createElement(_multiTabFormWithHeaderV.default, {
title: "Edit " + this.props.formTitle //schemas={this.props.componentSchemas}
,
schema: this.props.schema,
inputData: this.props.inputData //id={this.props.id}
,
onConfirm: this.onFormConfirm,
onCancel: this.onFormCancel,
overlaysContainer: this.props.overlaysContainer,
editable: true,
elementByType: this.props.elementByType,
isDebug: this.props.isDebug
}));
}, buttons), this.state.editForm);
}

return /*#__PURE__*/_react.default.createElement("div", {
Expand All @@ -440,8 +447,7 @@ var Header = /*#__PURE__*/function (_React$PureComponent) {
}, /*#__PURE__*/_react.default.createElement("img", {
src: logoPath,
alt: this.props.logoImg,
style: styleImage,
onLoad: this.onImgLoad
style: styleImage
})), /*#__PURE__*/_react.default.createElement("div", {
style: styleButtonContainer
}, buttons));
Expand Down

0 comments on commit f34c54e

Please sign in to comment.