aiidalab / aiidalab-widgets-base

Reusable widgets for AiiDAlab applications
MIT License
7 stars 17 forks source link

code quick setup can have computer label in its dropdown as placeholder before computer is set #408

Closed unkcpz closed 1 year ago

unkcpz commented 1 year ago

fixes #405

The ComputerDropdownWidget is used in AiidaCodeSetup to set up the computer. It is fine if the computer is set pre-head and the dropdown widget can have the value of UUID. However, in "quick setup" of the code, we read from database and fill the computer widget and code setup widget. When it comes to the CopmuterDropdownWidget, the UUID is expected but the UUID is not ready.

We fix the issue by adding a check in when read the code_setup from database, if the computer is already set, the uuid is set for the value of ComputerDropdownWidget. Otherwise, we set the value of dropdown widget None to suppress the exception and in the quick setup process, it will first set up the computer, and after the computer is set, the ComputerDropdownWidget will refresh and the code_setup phase will run again to set the computer.

unkcpz commented 1 year ago

@yakutovicha @superstar54, can you give this branch a test? In order to make it work and you can test with a single branch, I also address #406 in this PR. I'll separate it as a separate PR once your confirm this is work.

unkcpz commented 1 year ago

@superstar54 I separate the implementation out. Here it is only to address the #405.

yakutovicha commented 1 year ago

@yakutovicha @superstar54, can you give this branch a test?

trying.