Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Select the first machine and bare metal container by default. #424

Merged
merged 1 commit into from Jul 8, 2014

Conversation

huwshimi
Copy link
Member

@huwshimi huwshimi commented Jul 7, 2014

This branch selects the first machine by default when the machine view panel is opened. Additionally, when you select a machine the bare metal container is now selected by default.

QA:

  • drag two charms to the canvas
  • click deploy and confirm
  • open the machine view panel
  • the first machine should be selected and the bare metal container should be selected
  • click on the unselected machine
  • the containers for the second machine should be shown with the bare metal container selected

@jujugui
Copy link
Contributor

jujugui commented Jul 7, 2014

Test PASSed.
Refer to this link for build results: http://ci.jujugui.org:8080/job/juju-gui/1362/

*/
_selectFirstMachine: function() {
var machineTokens = this.get('machineTokens');
var firstId = Object.keys(machineTokens)[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

While unlikely, the order of records in an object is not guaranteed. Is there a more resilient way of fetching this information? Like from the machine model list ex) modelList.item(0)

Copy link
Member Author

Choose a reason for hiding this comment

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

The tokens are appended in the order of the object keys not the order of items in the modelList, hence using the same to pick the top item. I'm not sure if there's a more robust way of doing this. It seems to reproduce reliably.

@hatched
Copy link
Contributor

hatched commented Jul 7, 2014

👍 With the above comment addressed. Thanks!

@jujugui
Copy link
Contributor

jujugui commented Jul 8, 2014

Test PASSed.
Refer to this link for build results: http://ci.jujugui.org:8080/job/juju-gui/1370/

@huwshimi
Copy link
Member Author

huwshimi commented Jul 8, 2014

Thansk @hatched this now picks the item from the dom so that it always gets the first item. :shipit:

@jujugui
Copy link
Contributor

jujugui commented Jul 8, 2014

Status: merge request accepted. Url: http://ci.jujugui.org:8080/job/juju-gui-merge

jujugui added a commit that referenced this pull request Jul 8, 2014
Select the first machine and bare metal container by default.

This branch selects the first machine by default when the machine view panel is opened. Additionally, when you select a machine the bare metal container is now selected by default.

QA:
- drag two charms to the canvas
- click deploy and confirm
- open the machine view panel
- the first machine should be selected and the bare metal container should be selected
- click on the unselected machine
- the containers for the second machine should be shown with the bare metal container selected
@jujugui jujugui merged commit 1f90eac into juju:develop Jul 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants