Explorer null handling (#1658)
* Cassandra null value handling * prettier run * Added boolean and date * Reverted null handling switch statement and added editing warning * ran prettier * putting new line back in * prettier run * changed warning message * updated snapshot * fixed undefined condition * removed toString from undefined
This commit is contained in:
parent
70c031d04b
commit
3a703b0bd0
|
@ -390,6 +390,9 @@ export const EditTableEntityPanel: FunctionComponent<EditTableEntityPanelProps>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="panelNullWarning" style={{ padding: "20px", color: "red" }}>
|
||||||
|
Warning: Null fields will not be displayed for editing.
|
||||||
|
</div>
|
||||||
</RightPaneForm>
|
</RightPaneForm>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -355,6 +355,17 @@ exports[`Excute Edit Table Entity Pane should render Default properly 1`] = `
|
||||||
</div>
|
</div>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
className="panelNullWarning"
|
||||||
|
style={
|
||||||
|
Object {
|
||||||
|
"color": "red",
|
||||||
|
"padding": "20px",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Warning: Null fields will not be displayed for editing.
|
||||||
|
</div>
|
||||||
<PanelFooterComponent
|
<PanelFooterComponent
|
||||||
buttonLabel="Update"
|
buttonLabel="Update"
|
||||||
isButtonDisabled={false}
|
isButtonDisabled={false}
|
||||||
|
|
|
@ -147,7 +147,7 @@ export class CassandraAPIDataClient extends TableDataClient {
|
||||||
let properties = "(";
|
let properties = "(";
|
||||||
let values = "(";
|
let values = "(";
|
||||||
for (let property in entity) {
|
for (let property in entity) {
|
||||||
if (entity[property]._ === null) {
|
if (entity[property]._ === "" || entity[property]._ === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
properties = properties.concat(`${property}, `);
|
properties = properties.concat(`${property}, `);
|
||||||
|
@ -208,6 +208,9 @@ export class CassandraAPIDataClient extends TableDataClient {
|
||||||
!originalDocument[property] ||
|
!originalDocument[property] ||
|
||||||
newEntity[property]._.toString() !== originalDocument[property]._.toString()
|
newEntity[property]._.toString() !== originalDocument[property]._.toString()
|
||||||
) {
|
) {
|
||||||
|
if (newEntity[property]._.toString() === "" || newEntity[property]._ === undefined) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let propertyQuerySegment = this.isStringType(newEntity[property].$)
|
let propertyQuerySegment = this.isStringType(newEntity[property].$)
|
||||||
? `${property} = '${newEntity[property]._}',`
|
? `${property} = '${newEntity[property]._}',`
|
||||||
: `${property} = ${newEntity[property]._},`;
|
: `${property} = ${newEntity[property]._},`;
|
||||||
|
|
Loading…
Reference in New Issue