Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete date/time format conversion fix, update primary field css #105

Merged
merged 6 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.

## [Unreleased]
### Added
- CSS for making the primary keys look disabled/readonly for update mode PR #105

### Fixed
- Fix bug of delete with datetime in primarykey crashing PR #105

## [0.1.0-beta.1] - 2021-02-26
### Added
- Support for double data type (#72) PR #86
Expand Down Expand Up @@ -47,5 +54,6 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
- Multi database server connections supported by opening new tabs.
- Support of DJ NEURO - [Managed Database Hosting](https://djneuro.io/services/) users.

[Unreleased]: https://github.com/datajoint/datajoint-labbook/compare/0.1.0-beta.1...HEAD
[0.1.0-beta.1]: https://github.com/datajoint/datajoint-labbook/compare/0.1.0-alpha.2...0.1.0-beta.1
[0.1.0-alpha.2]: https://github.com/datajoint/datajoint-labbook/releases/tag/0.1.0-alpha.2
[0.1.0-alpha.2]: https://github.com/datajoint/datajoint-labbook/releases/tag/0.1.0-alpha.2
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class TableAttribute {
var splitResult = [undefined, undefined]
var defaultValueSplitResult: any = ['', '']

if (currentValue !== "undefined undefined") {
if (currentValue !== "undefined undefined" && currentValue !== undefined) {
splitResult = currentValue.split(' ');
}

Expand Down
4 changes: 2 additions & 2 deletions src/Components/MainTableView/DeleteTuple/DeleteTuple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ class DeleteTuple extends React.Component<{
for (let primaryTableAttribute of this.props.tableAttributesInfo.primaryAttributes) {
if (primaryTableAttribute.attributeType === TableAttributeType.DATE) {
// Convert date to DJ date format
tupleToDelete[primaryTableAttribute.attributeName] = TableAttribute.parseDateToDJFormat(tupleToDelete[primaryTableAttribute.attributeName])
tupleToDelete[primaryTableAttribute.attributeName] = TableAttribute.parseDateToDJFormat(this.props.selectedTableEntry[primaryTableAttribute.attributeName])
}
else if (primaryTableAttribute.attributeType === TableAttributeType.DATETIME || primaryTableAttribute.attributeType === TableAttributeType.TIMESTAMP) {
// Convert to DJ friendly datetime format
tupleToDelete[primaryTableAttribute.attributeName] = TableAttribute.parseDateTimeToDJFormat(tupleToDelete[primaryTableAttribute.attributeName])
tupleToDelete[primaryTableAttribute.attributeName] = TableAttribute.parseDateTimeToDJFormat(this.props.selectedTableEntry[primaryTableAttribute.attributeName])
}
else {
tupleToDelete[primaryTableAttribute.attributeName] = this.props.selectedTableEntry[primaryTableAttribute.attributeName]
Expand Down
5 changes: 5 additions & 0 deletions src/Components/MainTableView/UpdateTuple/UpdateTuple.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ form {
color: rgb(5, 114, 5);
}

.fieldUnit.primary input {
color: gray;
cursor: not-allowed;
}

.confirmActionButton.update {
border: 2px solid rgb(189, 138, 28);
color: rgb(189, 138, 28);
Expand Down
2 changes: 1 addition & 1 deletion src/Components/MainTableView/UpdateTuple/UpdateTuple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class UpdateTuple extends React.Component<{
// Deal with primary attirbutes
this.props.tableAttributesInfo?.primaryAttributes.map((primaryTableAttribute) => {
return(
<div className='fieldUnit' key={primaryTableAttribute.attributeName}>
<div className='fieldUnit primary' key={primaryTableAttribute.attributeName}>
{PrimaryTableAttribute.getAttributeLabelBlock(primaryTableAttribute)}
{PrimaryTableAttribute.getAttributeInputBlock(primaryTableAttribute, this.state.tupleBuffer[primaryTableAttribute.attributeName], this.handleChange)}
</div>
Expand Down