Adoptions from ivis-core

This commit is contained in:
Tomas Bures 2019-01-12 21:33:00 +01:00
parent 18eb54037c
commit d14942da93
6 changed files with 41 additions and 15 deletions

View file

@ -4507,11 +4507,13 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true "bundled": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -4528,7 +4530,8 @@
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
@ -4657,6 +4660,7 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }

View file

@ -146,7 +146,8 @@ export class ButtonDropdown extends Component {
export class ActionLink extends Component { export class ActionLink extends Component {
static propTypes = { static propTypes = {
onClickAsync: PropTypes.func, onClickAsync: PropTypes.func,
className: PropTypes.string className: PropTypes.string,
href: PropTypes.string
} }
@withAsyncErrorHandler @withAsyncErrorHandler
@ -163,7 +164,7 @@ export class ActionLink extends Component {
const props = this.props; const props = this.props;
return ( return (
<a href="" className={props.className} onClick={::this.onClick}>{props.children}</a> <a href={props.href || ''} className={props.className} onClick={::this.onClick}>{props.children}</a>
); );
} }
} }

View file

@ -28,16 +28,21 @@ export function withComponentMixins(mixins, delegateFuns) {
return TargetClass => { return TargetClass => {
const ctors = []; const ctors = [];
const mixinDelegateFuns = [];
function TargetClassWithCtors(props, context) { if (delegateFuns) {
mixinDelegateFuns.push(...delegateFuns);
}
function TargetClassWithCtors(props) {
if (!new.target) { if (!new.target) {
throw new TypeError(); throw new TypeError();
} }
const self = Reflect.construct(TargetClass, [props, context], new.target); const self = Reflect.construct(TargetClass, [props], new.target);
for (const ctor of ctors) { for (const ctor of ctors) {
ctor(self); ctor(self, props);
} }
return self; return self;
@ -76,6 +81,10 @@ export function withComponentMixins(mixins, delegateFuns) {
if (res.ctor) { if (res.ctor) {
ctors.push(res.ctor); ctors.push(res.ctor);
} }
if (res.delegateFuns) {
mixinDelegateFuns.push(...res.delegateFuns);
}
} }
class ComponentMixinsOuter extends React.Component { class ComponentMixinsOuter extends React.Component {
@ -107,13 +116,11 @@ export function withComponentMixins(mixins, delegateFuns) {
} }
} }
if (delegateFuns) { for (const fun of mixinDelegateFuns) {
for (const fun of delegateFuns) {
ComponentMixinsOuter.prototype[fun] = function (...args) { ComponentMixinsOuter.prototype[fun] = function (...args) {
return this._decoratorInnerInstance[fun](...args); return this._decoratorInnerInstance[fun](...args);
} }
} }
}
return ComponentMixinsOuter; return ComponentMixinsOuter;
}; };

View file

@ -82,7 +82,6 @@
background-color: white; background-color: white;
} }
:global h3.legend { :global h3.legend {
font-size: 21px; font-size: 21px;
margin-bottom: 20px; margin-bottom: 20px;
@ -101,6 +100,21 @@
} }
} }
.colorPickerSwatchWrapper {
padding: 7px;
background: #fff;
border: 1px solid #AAB2BD;
border-radius: 4px;
display: inline-block;
cursor: pointer;
.colorPickerSwatchColor {
width: 60px;
height: 18px;
borderRadius: 2px;
}
}
.colorPickerWrapper { .colorPickerWrapper {
text-align: right; text-align: right;
} }

View file

@ -87,7 +87,8 @@ export class UntrustedContentHost extends Component {
} }
sendMessage(type, data) { sendMessage(type, data) {
if (this.contentNodeIsLoaded) { // This is to avoid errors: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://localhost:8081') does not match the recipient window's origin ('http://localhost:3000')" if (this.contentNodeIsLoaded && this.contentNode) { // This is to avoid errors: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://localhost:8081') does not match the recipient window's origin ('http://localhost:3000')"
// When the child window is closed during processing of the message, the this.contentNode becomes null and we can't deliver the response
this.contentNode.contentWindow.postMessage({type, data}, getSandboxUrl()); this.contentNode.contentWindow.postMessage({type, data}, getSandboxUrl());
} }
} }

View file

@ -141,7 +141,6 @@ dbcheck(err => { // Check if database needs upgrading before starting the server
) )
) )
); );
*/
}); });