mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 09:15:22 +03:00
Use gui-order to sort the cameras sidebar list and udpate tests.
This commit is contained in:
parent
67e6193fac
commit
567faf9977
@ -20,7 +20,7 @@ export default function Sidebar() {
|
|||||||
matches ? (
|
matches ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<Separator />
|
<Separator />
|
||||||
{cameras.map(([camera]) => (
|
{cameras.sort(([aCam, aConf], [bCam, bConf]) => aConf.gui.order === bConf.gui.order ? 0 : (aConf.gui.order > bConf.gui.order ? 1 : -1)).map(([camera]) => (
|
||||||
<Destination href={`/cameras/${camera}`} text={camera} />
|
<Destination href={`/cameras/${camera}`} text={camera} />
|
||||||
))}
|
))}
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|||||||
@ -9,8 +9,8 @@ describe('Sidebar', () => {
|
|||||||
jest.spyOn(Api, 'useConfig').mockImplementation(() => ({
|
jest.spyOn(Api, 'useConfig').mockImplementation(() => ({
|
||||||
data: {
|
data: {
|
||||||
cameras: {
|
cameras: {
|
||||||
front: { name: 'front', objects: { track: ['taco', 'cat', 'dog'] }, record: { enabled: true } },
|
front: { name: 'front', objects: { track: ['taco', 'cat', 'dog'] }, record: { enabled: true }, gui: { order: 0 } },
|
||||||
side: { name: 'side', objects: { track: ['taco', 'cat', 'dog'] }, record: { enabled: false } },
|
side: { name: 'side', objects: { track: ['taco', 'cat', 'dog'] }, record: { enabled: false }, gui: { order: 0 } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user