Skip to content

'Division' field name and picklist items missing#1093

Merged
benanhalt merged 5 commits intoproductionfrom
issue-735
Dec 9, 2021
Merged

'Division' field name and picklist items missing#1093
benanhalt merged 5 commits intoproductionfrom
issue-735

Conversation

@maxpatiiuk
Copy link
Copy Markdown
Member

Fixes #735

Copy link
Copy Markdown
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accessionlist
This is the 2021_11_25_20_18 database on the test panel. The accession form still is missing the division name. Tested with Specify7 branch issue-735.

Copy link
Copy Markdown
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad news. With this branch, you cannot use the Data Entry feature. It does not respond
Tested with Edge, Chrome, and Safari.
badbad
I tested this with freshfish and 2021_11_25_20.

On the bright side, the picklist items and Division field name are present.
accession

value: division.get('id'),
title: division.get('name')
}));
this.divisionsPromise = undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do this! One of the main features of promises is that invoking then on an already resolved promise will invoke the continuation immediately so you don't have to keep track of the state manually!

Copy link
Copy Markdown
Member Author

@maxpatiiuk maxpatiiuk Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, why didn't I know about this sooner!
I always though that this code is invalid:

const a = Promise.resolve();
a.then(console.log);
a.then(console.log);  // Error?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return $('<option>').attr('value', item.value).text(item.title)[0];
});
this.$el.empty().append(options).prop('disabled', options.length < 1);
this.$el.val(this.resource.get('fieldname'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'fieldname'? How is that supposed to work?

@benanhalt
Copy link
Copy Markdown
Contributor

@grantfitzsimmons, would you please test this with a database that has more than one division? Make sure that the division can be set, saved, reloaded with the correct value appearing, and then changed to a new value, saved and reloaded.

Copy link
Copy Markdown
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data entry forms no longer work on this branch!

After testing this with multiple divisions, the division can be set, saved, reloaded multiple times and preserve its original value. This issue appears to be solved.

maxpatiiuk and others added 5 commits December 9, 2021 12:09
Seems like cell may have `labelfor` or it might have an `id`.

Need to check box to detect if the label belongs to a division picklist
@benanhalt
Copy link
Copy Markdown
Contributor

The data entry forms not working is a separate issue that has been fixed on another branch.

@benanhalt benanhalt merged commit 914bc8e into production Dec 9, 2021
@benanhalt benanhalt deleted the issue-735 branch December 9, 2021 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Division' field name and picklist items missing

3 participants