Fix table edit entity bug and add collection panel bug for connection string users (#757)

* Fix table edit entity bug and add collection panel bug for connection string users

* Remove parseInt for int64
This commit is contained in:
victor-meng 2021-05-06 16:51:22 -07:00 committed by GitHub
parent 503f044a70
commit 5606ef3266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -525,7 +525,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
}} }}
> >
<Stack className="panelGroupSpacing" id="collapsibleSectionContent"> <Stack className="panelGroupSpacing" id="collapsibleSectionContent">
{userContext.databaseAccount.properties.capabilities.find((c) => c.name === "EnableMongo") && ( {userContext.databaseAccount.properties?.capabilities?.find((c) => c.name === "EnableMongo") && (
<Stack className="panelGroupSpacing"> <Stack className="panelGroupSpacing">
<Stack horizontal> <Stack horizontal>
<span className="mandatoryStar">*&nbsp;</span> <span className="mandatoryStar">*&nbsp;</span>
@ -851,7 +851,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
return true; return true;
} }
return properties.capabilities.some( return properties.capabilities?.some(
(capability) => capability.name === Constants.CapabilityNames.EnableStorageAnalytics (capability) => capability.name === Constants.CapabilityNames.EnableStorageAnalytics
); );
} }

View File

@ -183,12 +183,14 @@ export function convertEntityToNewDocument(entity: Entities.ITableEntityForTable
parsedValue = DateTimeUtilities.convertJSDateToTicksWithPadding(propertyValue); parsedValue = DateTimeUtilities.convertJSDateToTicksWithPadding(propertyValue);
break; break;
case Constants.TableType.Boolean: case Constants.TableType.Boolean:
parsedValue = propertyValue.toLowerCase() === "true"; parsedValue = propertyValue.toString().toLowerCase() === "true";
break; break;
case Constants.TableType.Int32: case Constants.TableType.Int32:
case Constants.TableType.Int64:
parsedValue = parseInt(propertyValue, 10); parsedValue = parseInt(propertyValue, 10);
break; break;
case Constants.TableType.Int64:
parsedValue = propertyValue.toString();
break;
case Constants.TableType.Double: case Constants.TableType.Double:
parsedValue = parseFloat(propertyValue); parsedValue = parseFloat(propertyValue);
break; break;