@kaspernj/api-maker 1.0.241 → 1.0.242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/inputs/attachment.jsx +1 -1
- package/src/with-can-can.jsx +16 -0
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ export default class ApiMakerInputsAttachment extends BaseComponent {
|
|
|
21
21
|
}
|
|
22
22
|
{this.getUrl() &&
|
|
23
23
|
<div className="input-checkbox" style={{paddingTop: "15px", paddingBottom: "15px"}}>
|
|
24
|
-
<Checkbox inputProps={{id: this.getPurgeInputId(), name: this.getPurgeInputName(), value: 1}}
|
|
24
|
+
<Checkbox inputProps={{id: this.getPurgeInputId(), name: this.getPurgeInputName(), value: 1}} />
|
|
25
25
|
<label className="checkbox-label" htmlFor={this.getPurgeInputId()}>
|
|
26
26
|
{I18n.t("js.shared.delete")}
|
|
27
27
|
</label>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import CanCanLoader from "./can-can-loader"
|
|
2
|
+
|
|
3
|
+
export default (WrappedComponent, abilities) => class WithCanCan extends React.PureComponent {
|
|
4
|
+
state = {
|
|
5
|
+
canCan: undefined
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
render() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<CanCanLoader abilities={abilities} component={this} />
|
|
12
|
+
<WrappedComponent canCan={this.state.canCan} {...this.props} />
|
|
13
|
+
</>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
}
|