@andersonalmeidax0/webcomponents 0.1.10 → 0.1.12
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/RestAPIAdapter.js +32 -31
- package/XButton.jsx +15 -7
- package/package.json +1 -1
- package/releasenotes.txt +5 -0
package/RestAPIAdapter.js
CHANGED
|
@@ -42,35 +42,35 @@ import {PlatAPIError,PlatAPIReturnCodeError,PlatAPIAuthError,PlatAPIDBNotFound,P
|
|
|
42
42
|
X-Colocar o MetalMarlek em outro server AWS ... com docker... com outra conta de mongodb "andermusicdevelopment" free.. com CI/CD
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
|
-
function getStorage(key) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* ************************************************** */
|
|
55
|
-
/* ************************************************** */
|
|
56
|
-
function getStorageWithExpiry(key) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
45
|
+
// function getStorage(key) {
|
|
46
|
+
// const itemStr = sessionStorage.getItem(key)
|
|
47
|
+
// if (!itemStr) {
|
|
48
|
+
// return null;
|
|
49
|
+
// }
|
|
50
|
+
// const item = JSON.parse(itemStr)
|
|
51
|
+
// return item;
|
|
52
|
+
// }
|
|
53
|
+
|
|
54
|
+
// /* ************************************************** */
|
|
55
|
+
// /* ************************************************** */
|
|
56
|
+
// function getStorageWithExpiry(key) {
|
|
57
|
+
// const itemStr = sessionStorage.getItem(key)
|
|
58
|
+
// // if the item doesn't exist, return null
|
|
59
|
+
// if (!itemStr) {
|
|
60
|
+
// return null;
|
|
61
|
+
// }
|
|
62
|
+
// const item = JSON.parse(itemStr)
|
|
63
|
+
// const now = new Date()
|
|
64
|
+
// // compare the expiry time of the item with the current time
|
|
65
|
+
// if (now.getTime() > item.expiry) {
|
|
66
|
+
// // If the item is expired, delete the item from storage
|
|
67
|
+
// // and return null
|
|
68
|
+
// //alert('Session: expired'+key);
|
|
69
|
+
// sessionStorage.removeItem(key)
|
|
70
|
+
// return null
|
|
71
|
+
// }
|
|
72
|
+
// return item.value
|
|
73
|
+
// }
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
/** **********************************************
|
|
@@ -129,7 +129,8 @@ function getStorageWithExpiry(key) {
|
|
|
129
129
|
*********************** */
|
|
130
130
|
async callAPI(q,vo,context,filter) {
|
|
131
131
|
var r = null;
|
|
132
|
-
var ptoken=this.token
|
|
132
|
+
var ptoken=this.token;
|
|
133
|
+
//?this.token:(getStorageWithExpiry('sid'));
|
|
133
134
|
//if(ptoken==null)
|
|
134
135
|
// throw new PlatAPIAuthError( `An error has occured: ${response.status}`);
|
|
135
136
|
|
|
@@ -172,7 +173,7 @@ function getStorageWithExpiry(key) {
|
|
|
172
173
|
return await this.callAPI('findByFK',fkArr,context)
|
|
173
174
|
};
|
|
174
175
|
async update(vo,context) {
|
|
175
|
-
alert(JSON.stringify(vo));
|
|
176
|
+
//alert(JSON.stringify(vo));
|
|
176
177
|
return await this.callAPI('update',vo,context)
|
|
177
178
|
};
|
|
178
179
|
async removeByPK(vo,context) {
|
package/XButton.jsx
CHANGED
|
@@ -28,13 +28,21 @@ class XButton extends React.Component {
|
|
|
28
28
|
|
|
29
29
|
render() {
|
|
30
30
|
var t=this.props.attachFile?'file':'button';
|
|
31
|
-
if(this.props.attachFile)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
if(this.props.attachFile){
|
|
32
|
+
if(this.props.textlabel==null)
|
|
33
|
+
return (
|
|
34
|
+
<label onChange={this.evtFile} xclassName='tile bg--lightblue fg--white btn--raised ' xstyle={{lineHeight:20,xwidth:20,display:'inline-block'}} htmlFor="formId">
|
|
35
|
+
<input name="" type="file" id="formId" hidden />
|
|
36
|
+
<i className={'fa fa-paperclip'} />
|
|
37
|
+
</label>
|
|
38
|
+
);
|
|
39
|
+
else
|
|
40
|
+
return (
|
|
41
|
+
<label onChange={this.evtFile} xclassName='tile bg--lightblue fg--white btn--raised ' xstyle={{lineHeight:20,xwidth:20,display:'inline-block'}} htmlFor="formId">
|
|
42
|
+
<input name={this.props.textlabel} type="file" id="formId" />
|
|
43
|
+
</label>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
38
46
|
|
|
39
47
|
if(this.props.icon){
|
|
40
48
|
if(this.props.textlabel==null)
|
package/package.json
CHANGED