Skip to content

Commit 1fa464c

Browse files
author
JelteMX
committed
Update
1 parent 24f4686 commit 1fa464c

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

docs/globals.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> entity<wbr>IsFile<wbr>Docum
697697
<li class="tsd-description">
698698
<aside class="tsd-sources">
699699
<ul>
700-
<li>Defined in <a href="https://github.com/JelteMX/mendix-react-widget-utils/blob/master/src/entities.ts#L30">entities.ts:30</a></li>
700+
<li>Defined in <a href="https://github.com/JelteMX/mendix-react-widget-utils/blob/master/src/entities.ts#L36">entities.ts:36</a></li>
701701
</ul>
702702
</aside>
703703
<div class="tsd-comment tsd-typography">
@@ -735,7 +735,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> entity<wbr>IsImage</h3>
735735
<li class="tsd-description">
736736
<aside class="tsd-sources">
737737
<ul>
738-
<li>Defined in <a href="https://github.com/JelteMX/mendix-react-widget-utils/blob/master/src/entities.ts#L19">entities.ts:19</a></li>
738+
<li>Defined in <a href="https://github.com/JelteMX/mendix-react-widget-utils/blob/master/src/entities.ts#L25">entities.ts:25</a></li>
739739
</ul>
740740
</aside>
741741
<div class="tsd-comment tsd-typography">
@@ -767,7 +767,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</
767767
<a name="entityispersistable" class="tsd-anchor"></a>
768768
<h3><span class="tsd-flag ts-flagConst">Const</span> entity<wbr>IsPersistable</h3>
769769
<ul class="tsd-signatures tsd-kind-function">
770-
<li class="tsd-signature tsd-kind-icon">entity<wbr>IsPersistable<span class="tsd-signature-symbol">(</span>entity<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
770+
<li class="tsd-signature tsd-kind-icon">entity<wbr>IsPersistable<span class="tsd-signature-symbol">(</span>entity<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></li>
771771
</ul>
772772
<ul class="tsd-descriptions">
773773
<li class="tsd-description">
@@ -778,7 +778,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> entity<wbr>IsPersistable</h
778778
</aside>
779779
<div class="tsd-comment tsd-typography">
780780
<div class="lead">
781-
<p>Is Entity persistent or not</p>
781+
<p>Is Entity persistent or not. Note that this is deprecated in Mendix 9</p>
782782
</div>
783783
<dl class="tsd-comment-tags">
784784
<dt>name</dt>
@@ -797,7 +797,7 @@ <h5>entity: <span class="tsd-signature-type">string</span></h5>
797797
</div>
798798
</li>
799799
</ul>
800-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
800+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h4>
801801
</li>
802802
</ul>
803803
</section>
@@ -1468,7 +1468,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</s
14681468
<a name="objectispersistable" class="tsd-anchor"></a>
14691469
<h3><span class="tsd-flag ts-flagConst">Const</span> object<wbr>IsPersistable</h3>
14701470
<ul class="tsd-signatures tsd-kind-function">
1471-
<li class="tsd-signature tsd-kind-icon">object<wbr>IsPersistable<span class="tsd-signature-symbol">(</span>obj<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MxObject</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
1471+
<li class="tsd-signature tsd-kind-icon">object<wbr>IsPersistable<span class="tsd-signature-symbol">(</span>obj<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MxObject</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></li>
14721472
</ul>
14731473
<ul class="tsd-descriptions">
14741474
<li class="tsd-description">
@@ -1498,7 +1498,7 @@ <h5>obj: <span class="tsd-signature-type">MxObject</span></h5>
14981498
</div>
14991499
</li>
15001500
</ul>
1501-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
1501+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h4>
15021502
</li>
15031503
</ul>
15041504
</section>

package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jeltemx/mendix-react-widget-utils",
3-
"version": "0.8.0",
3+
"version": "0.9.0",
44
"description": "Mendix Widget utils to make widget development a little easier",
55
"license": "MIT",
66
"repository": {
@@ -44,7 +44,8 @@
4444
"watch:test": "jest --watch"
4545
},
4646
"dependencies": {
47-
"uuid": "^7.0.3"
47+
"uuid": "^7.0.3",
48+
"versioning": "^1.1.2"
4849
},
4950
"peerDependencies": {
5051
"react": "^16.8.6",

src/entities.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
/**
2-
* Is Entity persistent or not
2+
* Is Entity persistent or not. Note that this is deprecated in Mendix 9
33
*
44
* @name entityIsPersistable
55
* @category Entity
66
* @param entity Entity name
77
*/
8-
export const entityIsPersistable = (entity: string): boolean => {
9-
return window.mx.meta.getEntity(entity).isPersistable();
8+
export const entityIsPersistable = (entity: string): boolean | null => {
9+
let returnValue = null;
10+
try {
11+
returnValue = window.mx.meta.getEntity(entity).isPersistable();
12+
} catch (error) {
13+
returnValue = null;
14+
}
15+
return returnValue;
1016
};
1117

1218
/**

src/objects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export const getObjectContextFromId = (guid: string, entityName: string): mendix
211211
* @category Objects
212212
* @param obj Mendix object
213213
*/
214-
export const objectIsPersistable = (obj: mendix.lib.MxObject): boolean => {
214+
export const objectIsPersistable = (obj: mendix.lib.MxObject): boolean | null => {
215215
const entity = obj.getEntity();
216216
return entityIsPersistable(entity);
217217
};

0 commit comments

Comments
 (0)