all repos — caroster @ 3152bd87b236233d1b480b87e9b4a2633d92c038

[Octree] Group carpool to your event https://caroster.io

Add id to navigation and EditEvent form Related #15, #11
Hadrien Froger hadrien@octree.ch
Wed, 01 Jul 2020 08:31:17 +0100
commit

3152bd87b236233d1b480b87e9b4a2633d92c038

parent

ae51e12252fdd1de29ad1ab9e32b48b893b7e2e8

M app/package-lock.jsonapp/package-lock.json

@@ -3052,6 +3052,15 @@ "version": "2.0.0",

"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==" }, + "bindings": { + "version": "1.5.0", + "resolved": "https://npm-8ee.hidora.com/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",

@@ -5835,6 +5844,12 @@ "loader-utils": "^1.2.3",

"schema-utils": "^2.5.0" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://npm-8ee.hidora.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, "filesize": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.0.1.tgz",

@@ -7462,7 +7477,11 @@ "fsevents": {

"version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } } } },

@@ -8651,6 +8670,12 @@ "mute-stream": {

"version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, + "nan": { + "version": "2.14.1", + "resolved": "https://npm-8ee.hidora.com/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "optional": true }, "nanomatch": { "version": "1.2.13",

@@ -13303,7 +13328,11 @@ "fsevents": {

"version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0",

@@ -13616,7 +13645,11 @@ "fsevents": {

"version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "get-caller-file": { "version": "1.0.3",
M app/src/containers/EventDetails/index.jsapp/src/containers/EventDetails/index.js

@@ -15,7 +15,7 @@ const classes = useStyles();

const { event, isEditing, setEditingEvent, editingEvent } = useEvent(); if (!event) return null; - + const idPrefix = isEditing ? "EditEvent" : "Event"; return ( <div> <div className={classes.section}>

@@ -32,12 +32,14 @@ className={classes.textField}

fullWidth format="DD.MM.YYYY" disablePast - id="UpdateEventDate" + id={`${idPrefix}Date`} name="date" TextFieldComponent={(p) => <TextField light {...p} />} /> ) : ( - <Typography variant="body1">{event.date}</Typography> + <Typography variant="body1" id={`${idPrefix}Date`}> + {event.date} + </Typography> )} </div> <div className={classes.section}>

@@ -51,20 +53,22 @@ value={editingEvent.address ?? event.address}

onChange={(e) => setEditingEvent({ ...editingEvent, address: e.target.value }) } - id="UpdateEventAddress" + id={`${idPrefix}Address`} name="address" /> ) : ( - <Typography variant="body1">{event.address}</Typography> + <Typography variant="body1" id={`${idPrefix}Address`}> + {event.address} + </Typography> )} </div> <div className={classes.actions}> - <Button onClick={toggleDetails} variant="contained"> + <Button onClick={toggleDetails} variant="contained" id={`CarFindBtn`}> {t("event.actions.find_car")} </Button> </div> {event.position && ( - <div className={classes.map}> + <div className={classes.map} id={`${idPrefix}AddressMap`}> <Map position={event.position} /> </div> )}
M app/src/containers/EventMenu/index.jsapp/src/containers/EventMenu/index.js

@@ -26,6 +26,7 @@ action.onClick();

setAnchorEl(null); }} key={idx} + id={action.id || `MenuItem${idx}`} > {action.label} </MenuItem>
M app/src/pages/Event.jsapp/src/pages/Event.js

@@ -48,7 +48,11 @@ if (!event) return <div>{t("generic.loading")}</div>;

return ( <Layout> - <AppBar position="static" className={classes.appbar}> + <AppBar + position="static" + className={classes.appbar} + id={isEditing ? "EditEvent" : detailsOpen ? "Details" : "Menu"} + > <Toolbar> {isEditing ? ( <TextField

@@ -57,29 +61,38 @@ value={editingEvent.name ?? event.name}

onChange={(e) => setEditingEvent({ ...editingEvent, name: e.target.value }) } - id="NewEventName" + id="EditEventName" name="name" /> ) : ( - <Typography variant="h6" className={classes.name}> + <Typography + variant="h6" + className={classes.name} + id="MenuHeaderTitle" + > {event.name} </Typography> )} {!detailsOpen && ( <IconButton edge="end" + id="MenuMoreInfo" onClick={(e) => setAnchorEl(e.currentTarget)} > <Icon className={classes.barIcon}>more_vert</Icon> </IconButton> )} {detailsOpen && !isEditing && ( - <IconButton edge="end" onClick={(e) => setIsEditing(true)}> + <IconButton + edge="end" + id="DetailsEditBtn" + onClick={(e) => setIsEditing(true)} + > <Icon className={classes.barIcon}>edit</Icon> </IconButton> )} {detailsOpen && isEditing && ( - <IconButton edge="end" onClick={onEventSave}> + <IconButton edge="end" id="EditEventSubmit" onClick={onEventSave}> <Icon className={classes.barIcon}>done</Icon> </IconButton> )}

@@ -92,9 +105,18 @@ label: detailsOpen

? t("event.actions.hide_details") : t("event.actions.show_details"), onClick: toggleDetails, + id: "DetailsTab", }, - { label: t("event.actions.add_car"), onClick: () => {} }, - { label: t("event.actions.invite"), onClick: () => {} }, + { + label: t("event.actions.add_car"), + onClick: () => {}, + id: "NewCarTab", + }, + { + label: t("event.actions.invite"), + onClick: () => {}, + id: "InviteTab", + }, ]} /> </Toolbar>