Open
Bug 1540094
Opened 6 years ago
Updated 3 years ago
[remote-dbg-next] SidebarRuntimeItem could take a runtime as prop
Categories
(DevTools :: about:debugging, enhancement, P3)
DevTools
about:debugging
Tracking
(Not tracked)
NEW
People
(Reporter: jdescottes, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: remote-debugging-technical-debt)
The SidebarRuntimeItem can only render runtimes.
Right now we are not passing a runtime directly as a prop and the parent component has to implement the logic to translate a runtime object to the props expected by SidebarRuntimeItem:
const keyId = `${runtime.type}-${runtime.id}`;
const runtimeHasDetails = !!runtime.runtimeDetails;
const isSelected = selectedPage === PAGE_TYPES.RUNTIME &&
runtime.id === selectedRuntimeId;
let name = runtime.name;
if (runtime.type === RUNTIMES.USB && runtimeHasDetails) {
// Update the name to be same to the runtime page.
name = runtime.runtimeDetails.info.name;
}
return SidebarRuntimeItem({
deviceName: runtime.extra.deviceName,
dispatch,
icon,
key: keyId,
isConnected: runtimeHasDetails,
isSelected,
isUnknown: runtime.isUnknown,
name,
runtimeId: runtime.id,
});
All this logic could be done in the specialized SidebarRuntimeItem component and we could simply call it as:
const keyId = `${runtime.type}-${runtime.id}`;
return SidebarRuntimeItem({
dispatch,
key: keyId,
isSelected,
runtime,
});
Updated•6 years ago
|
Priority: -- → P3
| Reporter | ||
Comment 1•6 years ago
|
||
Will do some cleanup around runtimes for Bug 1542286, otherwise it gets really hard to follow.
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Priority: P3 → P1
| Reporter | ||
Updated•3 years ago
|
Priority: P1 → P3
| Reporter | ||
Updated•3 years ago
|
Assignee: jdescottes → nobody
Status: ASSIGNED → NEW
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•