Skip to content

New saved place UI #1388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 27, 2025
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c17ec43
add specific classes to trip panel
amy-corson-ibigroup May 7, 2025
08810be
update styling for Saved Places
amy-corson-ibigroup May 7, 2025
cd4f1fe
match the original styling more closely
amy-corson-ibigroup May 7, 2025
4930b66
clean up place css
amy-corson-ibigroup May 7, 2025
6cbced4
Delete place from edit page
amy-corson-ibigroup May 7, 2025
5ae213d
nvm dont mess with css
amy-corson-ibigroup May 7, 2025
d4bfc75
Update lib/components/user/places/favorite-place-list.js
amy-corson-ibigroup May 15, 2025
dc8ec09
Update lib/components/user/places/favorite-place-screen.js
amy-corson-ibigroup May 15, 2025
8c62b9b
fix i18n conditional rendering
amy-corson-ibigroup May 15, 2025
346f288
Merge branch 'new-saved-place-ui' of https://github.com/opentripplann…
amy-corson-ibigroup May 15, 2025
434e7a6
fix i18n strings
amy-corson-ibigroup May 22, 2025
150696f
Remove mobile specific button layout on save place screen
amy-corson-ibigroup May 23, 2025
97e214b
Merge branch 'dev' into new-saved-place-ui
amy-corson-ibigroup May 23, 2025
b9d7f76
remove unnecessary mobile components
amy-corson-ibigroup May 23, 2025
c32db8d
Merge branch 'new-saved-place-ui' of https://github.com/opentripplann…
amy-corson-ibigroup May 23, 2025
dc2dcec
Conditionally render language strings in a way that passes test
amy-corson-ibigroup May 27, 2025
9ce06e4
Merge branch 'dev' into new-saved-place-ui
amy-corson-ibigroup May 27, 2025
012b4ea
Clean up
amy-corson-ibigroup May 27, 2025
2947ba0
Merge branch 'new-saved-place-ui' of https://github.com/opentripplann…
amy-corson-ibigroup May 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion i18n/en-US.yml
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ actions:
itineraryExistenceCheckFailed: Error checking whether your selected trip is possible.
mustAcceptTermsToSavePlace: Please accept the Terms of Use (under My Account) to save locations.
mustBeLoggedInToSavePlace: Please log in to save locations.
placeDeleted: Your place has been deleted.
placeRemembered: The settings for this place have been saved.
preferencesSaved: Your preferences have been saved.
smsInvalidCode: The code you entered is invalid. Please try again.
@@ -472,7 +473,6 @@ components:
enterAlert: >
Enter origin/destination in the form (or set via map click) and click the
resulting marker to set as {placeType} location.
viewStop: View Stop
PlaceEditor:
addressPrompt: "Address:"
genericLocationPlaceholder: Search for location
1 change: 0 additions & 1 deletion i18n/es.yml
Original file line number Diff line number Diff line change
@@ -484,7 +484,6 @@ components:
Introduzca el origen/destino en el formulario (o establezca mediante un
clic en el mapa) y haga clic en el marcador resultante para establecerlo
como lugar de {placeType}.
viewStop: Ver parada
PlaceEditor:
addressPrompt: "Dirección:"
genericLocationPlaceholder: Buscar ubicación
2 changes: 1 addition & 1 deletion i18n/fr.yml
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ actions:
Veuillez accepter les conditions d'utilisation (dans Mon compte) pour
enregistrer des lieux.
mustBeLoggedInToSavePlace: Veuillez vous connecter pour enregistrer des lieux.
placeDeleted: Votre lieu a été supprimé
placeRemembered: Les informations pour ce lieu ont été enregistrées.
preferencesSaved: Vos préférences ont été enregistrées.
smsInvalidCode: Le code saisi est incorrect. Veuillez réessayer.
@@ -489,7 +490,6 @@ components:
Entrez votre point de départ/destination dans le formulaire (ou cliquez
sur la carte), puis cliquez sur le marqueur qui apparaît afin de définir
votre {placeType}.
viewStop: Voir cet arrêt
PlaceEditor:
addressPrompt: "Adresse :"
genericLocationPlaceholder: Adresse du lieu
1 change: 0 additions & 1 deletion i18n/ko.yml
Original file line number Diff line number Diff line change
@@ -426,7 +426,6 @@ components:
deleteThisPlace: 이 장소 삭제
enterAlert: |
양식에 출발지/목적지를 입력하고(또는 지도를 클릭하여 설정), 생성된 마커를 클릭하여 {placeType} 위치로 설정하세요.
viewStop: 정류장 보기
PlaceEditor:
addressPrompt: "주소:"
genericLocationPlaceholder: 위치 검색
1 change: 0 additions & 1 deletion i18n/ru.yml
Original file line number Diff line number Diff line change
@@ -482,7 +482,6 @@ components:
Укажите место назначения и отправления в форме (или выберите их на карте).
Затем нажмите на маркер, чтобы задать его как местоположение
«{placeType}».
viewStop: Просмотреть остановку
PlaceEditor:
addressPrompt: "Aдрес:"
genericLocationPlaceholder: Поиск местоположения
1 change: 0 additions & 1 deletion i18n/ta.yml
Original file line number Diff line number Diff line change
@@ -482,7 +482,6 @@ components:
படிவத்தில் தோற்றம்/இலக்கை உள்ளிடவும் (அல்லது வரைபடக் சொடுக்கு வழியாக
அமைக்கவும்) மற்றும் இதன் விளைவாக வரும் மார்க்கரை {placeType} இருப்பிடமாக
அமைக்க சொடுக்கு செய்க.
viewStop: நிறுத்து காண்க
PlaceEditor:
addressPrompt: "முகவரி:"
genericLocationPlaceholder: இருப்பிடத்தைத் தேடுங்கள்
1 change: 0 additions & 1 deletion i18n/tl.yml
Original file line number Diff line number Diff line change
@@ -498,7 +498,6 @@ components:
Ilagay ang pinagmulan/patutunguhan sa form (o itakda ito sa pamamagitan ng
pag-click sa mapa) at i-click ang resultang marker para itakda ito bilang
lokasyon ng {placeType}.
viewStop: Tingnan ang Hintuan
PlaceEditor:
addressPrompt: "Address:"
genericLocationPlaceholder: Maghanap ng lokasyon
1 change: 0 additions & 1 deletion i18n/vi.yml
Original file line number Diff line number Diff line change
@@ -473,7 +473,6 @@ components:
Nhập điểm xuất phát/điểm đến vào biểu mẫu này (hoặc cài đặt qua việc nhấp
vào bản đồ) và nhấp vào điểm đánh dấu kết quả để cài đặt vị trí
{placeType}.
viewStop: Xem điểm dừng
PlaceEditor:
addressPrompt: "Địa chỉ:"
genericLocationPlaceholder: Tìm kiếm vị trí
1 change: 0 additions & 1 deletion i18n/zh_Hans.yml
Original file line number Diff line number Diff line change
@@ -419,7 +419,6 @@ components:
deleteThisPlace: 删除这个地点
enterAlert: |
在表格中输入出发地/目的地(或通过地图点击设置)并点击产生的标记设置为 {placeType} 地点.
viewStop: 查看车站
PlaceEditor:
addressPrompt: "地址:"
genericLocationPlaceholder: 搜索地点
9 changes: 4 additions & 5 deletions i18n/zh_Hant.yml
Original file line number Diff line number Diff line change
@@ -292,12 +292,12 @@ components:
bikesAvailable: "{bikesAvailable}輛自行車可用"
companyBicycle: "{company} 自行車"
companyScooter: "{company} 滑板車"
distanceAway: "{localizedDistanceString} 距離"
error: 載入鄰近設施時發生錯誤。
header: 檢視附近
headsign: "{destination}"
spacesAvailable: "{spacesAvailable} 有未佔用的空間"
distanceAway: '{localizedDistanceString} 距離'
searchNearby: 搜尋附近...
spacesAvailable: "{spacesAvailable} 有未佔用的空間"
NewAccountWizard:
createNewAccount: 建立新帳戶
finish: 帳戶設定完成!
@@ -359,7 +359,6 @@ components:
deleteThisPlace: 刪除此地點
enterAlert: |
請在表單內輸入起點/目的地 (或按一下地圖來設定),然後按一下產生的標記以設定為{placeType}位置。
viewStop: 檢視車站
PlaceEditor:
addressPrompt: 地址:
genericLocationPlaceholder: 搜尋位置
@@ -519,6 +518,8 @@ components:
oneHour: 1小時
realtimeAlertFlagged: 我的旅程上有一個即時警示標記
timeBefore: "{time} 之前"
TripPreviewLayout:
previewTrip: 預覽行程
TripStatus:
alerts: "{alerts}個警示!"
deleteTrip: 刪除行程
@@ -633,8 +634,6 @@ components:
switcher: 切換工具
WelcomeScreen:
prompt: 您想要去哪裡?
TripPreviewLayout:
previewTrip: 預覽行程
config:
accessModes:
car_hail: 叫車服務
2 changes: 1 addition & 1 deletion lib/actions/user.js
Original file line number Diff line number Diff line change
@@ -790,7 +790,7 @@ export function deleteLoggedInUserPlace(placeIndex, intl) {
const { loggedInUser } = getState().user
loggedInUser.savedLocations.splice(placeIndex, 1)

dispatch(createOrUpdateUser(loggedInUser, intl))
return dispatch(createOrUpdateUser(loggedInUser, intl))
}
}

8 changes: 6 additions & 2 deletions lib/components/map/connected-endpoints-overlay.tsx
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import {
import { getActiveSearch, getShowUserSettings } from '../../util/state'
import { setLocation } from '../../actions/map'
import { setViewedStop } from '../../actions/ui'
import { toastOnPlaceSaved } from '../util/toasts'
import { toastOnPlaceChanged } from '../util/toasts'

type Props = ComponentProps<typeof EndpointsOverlay> & {
forgetPlace: (place: string, intl: IntlShape) => void
@@ -40,7 +40,11 @@ const ConnectedEndpointsOverlay = ({
async (placeTypeLocation) => {
const result = await rememberPlace(placeTypeLocation, intl)
if (result === UserActionResult.SUCCESS) {
toastOnPlaceSaved(convertToPlace(placeTypeLocation.location), intl)
toastOnPlaceChanged(
convertToPlace(placeTypeLocation.location),
intl,
'Remembered'
)
}
},
[rememberPlace, intl]
2 changes: 1 addition & 1 deletion lib/components/mobile/mobile.css
Original file line number Diff line number Diff line change
@@ -250,7 +250,7 @@
}

@media (max-width: 768px){
.panel-default {
.saved-trip-panel .panel-default {
width: 90%;
}
}
2 changes: 1 addition & 1 deletion lib/components/user/delete-form.tsx
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ interface DeleteFormProps {
tripId: string
}

const DeleteFormButton = styled(Button)`
export const DeleteFormButton = styled(Button)`
background-color: white;
border-color: ${RED_ON_WHITE};
color: ${RED_ON_WHITE};
2 changes: 1 addition & 1 deletion lib/components/user/monitored-trip/saved-trip-list.tsx
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ class TripListItem extends Component<ItemProps, ItemState> {
})
const { LegIcon } = this.context
return (
<Panel>
<Panel className="saved-trip-panel">
<TripPanelHeading>
<TripPanelTitle>
<Panel.Title>
16 changes: 6 additions & 10 deletions lib/components/user/places/favorite-place-list.js
Original file line number Diff line number Diff line change
@@ -12,9 +12,10 @@ import {
getPlaceMainText
} from '../../../util/user'
import { isBlank } from '../../../util/ui'
import { Plus } from '@styled-icons/fa-solid/Plus'
import { UnpaddedList } from '../../form/styled'

import { StyledFavoritePlace as FavoritePlace } from './styled'
import { StyledFavoritePlace as FavoritePlace, NewPlaceButton } from './styled'

/**
* Renders an editable list user's favorite locations, and lets the user add a new one.
@@ -54,15 +55,10 @@ const FavoritePlaceList = ({
))}
</UnpaddedList>

<FavoritePlace
icon="plus"
mainText={
<FormattedMessage id="components.FavoritePlaceList.addAnotherPlace" />
}
path={`${basePath}/new`}
tag="div"
title=""
/>
<NewPlaceButton className="btn btn-primary" to={`${basePath}/new`}>
<Plus size={10} />
<FormattedMessage id="components.FavoritePlaceList.addAnotherPlace" />
</NewPlaceButton>
</div>
)
}
47 changes: 31 additions & 16 deletions lib/components/user/places/favorite-place-screen.js
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import { injectIntl, FormattedMessage } from 'react-intl'
import { connect } from 'react-redux'
import styled from 'styled-components'
import * as yup from 'yup'
import { Trash } from '@styled-icons/fa-solid/Trash'

import AccountPage from '../account-page'
import * as userActions from '../../../actions/user'
@@ -25,16 +26,13 @@ import { isHomeOrWork, PLACE_TYPES } from '../../../util/user'
import withLoggedInUserSupport from '../with-logged-in-user-support'
import { InlineLoading } from '../../narrative/loading'
import PageTitle from '../../util/page-title'
import { toastOnPlaceSaved } from '../../util/toasts'
import { toastOnPlaceChanged } from '../../util/toasts'
import { DeleteFormButton } from '../delete-form'
import { IconWithText } from '../../util/styledIcon'

import PlaceEditor from './place-editor'

const { isMobile } = coreUtils.ui

// Styled components
const SaveButton = styled(Button)`
float: right;
`
const BLANK_PLACE = {
...PLACE_TYPES.custom,
address: '',
@@ -44,6 +42,9 @@ const BLANK_PLACE = {
// Make space between place details and form buttons.
const Container = styled.div`
margin-bottom: 100px;
@media (max-width: 768px) {
margin-bottom: 50px;
}
`

// The form fields to validate.
@@ -73,13 +74,23 @@ class FavoritePlaceScreen extends Component {
const { intl, placeIndex, saveUserPlace } = this.props
const result = await saveUserPlace(placeToSave, placeIndex, intl)
if (result === userActions.UserActionResult.SUCCESS) {
toastOnPlaceSaved(placeToSave, intl)
toastOnPlaceChanged(placeToSave, intl, 'Remembered')
}

// Return to previous location when done.
navigateBack()
}

_handleDelete = async placeToSave => {
const { deleteLoggedInUserPlace, intl, placeIndex } = this.props
const result = await deleteLoggedInUserPlace(placeIndex, intl)
if (result === userActions.UserActionResult.SUCCESS) {
toastOnPlaceChanged(placeToSave, intl, 'Deleted')
}
// Return to previous location when done.
navigateBack()
}

/**
* Based on the URL, returns an existing place or a new place for editing,
* or null if the requested place is not found.
@@ -130,7 +141,6 @@ class FavoritePlaceScreen extends Component {
place.name = place.type
}

const isMobileView = isMobile()

let heading
if (!place) {
@@ -150,7 +160,6 @@ class FavoritePlaceScreen extends Component {

return (
<AccountPage subnav={!isCreating}>
{isMobileView && <BackLink />}
<PageTitle title={[heading, !isCreating ? intl.formatMessage({
id: 'components.SubNav.myAccount'
}) : '']} />
@@ -169,11 +178,6 @@ class FavoritePlaceScreen extends Component {
return (
<Form noValidate>
<div>
{isMobileView && place && (
<SaveButton bsStyle='primary' disabled={pendingSave} type='submit'>
{pendingSave ? <InlineLoading />:<FormattedMessage id='common.forms.save' />}
</SaveButton>
)}
<PageHeading as={isCreating ? 'h1' : 'h2'}>{heading}</PageHeading>
</div>
<Container>
@@ -186,16 +190,26 @@ class FavoritePlaceScreen extends Component {
)}
</Container>

{!isMobileView && <FormNavigationButtons
<FormNavigationButtons
backButton={{
onClick: navigateBack,
text: <FormattedMessage id='common.forms.back' />
}}
extraButton={!isNewPlace && {content: (
<DeleteFormButton onClick={() => this._handleDelete(place)}>
{pendingSave ? (
<InlineLoading />
) : (
<IconWithText Icon={Trash}>
<FormattedMessage id="components.Place.deleteThisPlace" />
</IconWithText>)}
</DeleteFormButton>)
}}
okayButton={place && {
text: pendingSave ? <InlineLoading /> : <FormattedMessage id='common.forms.save' />,
type: 'submit'
}}
/>}
/>
</Form>
)
}
@@ -220,6 +234,7 @@ const mapStateToProps = (state, ownProps) => {
}

const mapDispatchToProps = {
deleteLoggedInUserPlace: userActions.deleteLoggedInUserPlace,
saveUserPlace: userActions.saveUserPlace
}

82 changes: 30 additions & 52 deletions lib/components/user/places/place.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button } from 'react-bootstrap'
import { Search } from '@styled-icons/fa-solid/Search'
import { TrashAlt } from '@styled-icons/fa-solid/TrashAlt'
import { Button, Panel } from 'react-bootstrap'
import { Edit } from '@styled-icons/fa-solid/Edit'
import { useIntl } from 'react-intl'
import React, { HTMLAttributes, ReactNode, useContext } from 'react'
import styled, { css } from 'styled-components'
@@ -34,34 +33,25 @@ interface Props extends HTMLAttributes<HTMLLIElement> {
/** The title for the main button */
title?: string
}
/*
interface ConfigContext extends Context {
SvgIcon: ComponentType<{ iconName?: string }>
}
*/
const Container = styled.li`
align-items: stretch;
display: flex;
list-style: none;
`

// Definitions below are for customizable subcomponents referenced in
// styled.js to define multiple flavors of the Place component,
// without creating circular references between that file and this file.

const placeButtonCss = css`
background: none;
flex: 1 0 0;
overflow: hidden;
const placeCss = css`
text-align: left;
text-overflow: ellipsis;
width: 100%;
`

export const PlaceButton = styled(Button)`
${placeButtonCss}
${placeCss}
`

export const PlaceLink = styled(Link)`
${placeButtonCss}
export const PlaceContainer = styled(Panel.Body)`
${placeCss}
`

export const PlaceDetail = styled.span``
@@ -72,7 +62,10 @@ export const PlaceName = styled.span``

export const PlaceText = styled.span``

export const IconWrapper = styled(StyledIconWrapper)``
export const IconWrapper = styled(StyledIconWrapper)`
justify-self: center;
grid-column: 1;
`

export const ActionButton = styled(Button)`
background: none;
@@ -81,6 +74,15 @@ export const ActionButton = styled(Button)`

export const ActionButtonPlaceholder = styled.span``

const SavedPlacePanel = styled(Panel)`
margin-bottom: 10px;
.panel-body:before,
.panel-body:after {
display: none !important;
}
`

/**
* Renders a stylable clickable button for editing/selecting a user's favorite place,
* and buttons for viewing and deleting the place if corresponding handlers are provided.
@@ -93,25 +95,16 @@ const Place = ({
largeIcon,
mainText,
onClick,
onDelete,
onView,
path,
tag = 'li',
title = `${mainText}${detailText && ` (${detailText})`}`
}: Props): JSX.Element => {
const intl = useIntl()
// @ts-expect-error TODO: Add types to ComponentContext
const { SvgIcon } = useContext(ComponentContext)
const viewStopLabel = intl.formatMessage({ id: 'components.Place.viewStop' })
const deletePlaceLabel = intl.formatMessage({
id: 'components.Place.deleteThisPlace'
})
const iconSize = largeIcon ? '2x' : undefined

const placeContent = (
<>
{largeIcon && (
<IconWrapper size="2x">
<IconWrapper size="1.5x">
<SvgIcon iconName={icon} />
</IconWrapper>
)}
@@ -141,29 +134,14 @@ const Place = ({
{onClick ? (
<PlaceButton onClick={onClick}>{placeContent}</PlaceButton>
) : (
<PlaceLink className="btn btn-default" to={path}>
{placeContent}
</PlaceLink>
)}

{/* Action buttons. If none, render a placeholder. */}
{!onView && !onDelete && <ActionButtonPlaceholder />}
{onView && (
// This button is only used for viewing stops.
<ActionButton onClick={onView} title={viewStopLabel}>
<IconWrapper size={iconSize}>
<Search />
</IconWrapper>
<InvisibleA11yLabel>{viewStopLabel}</InvisibleA11yLabel>
</ActionButton>
)}
{onDelete && (
<ActionButton onClick={onDelete} title={deletePlaceLabel}>
<IconWrapper size={iconSize}>
<TrashAlt />
</IconWrapper>
<InvisibleA11yLabel>{deletePlaceLabel}</InvisibleA11yLabel>
</ActionButton>
<SavedPlacePanel style={{ marginBottom: '10px' }}>
<PlaceContainer>
{placeContent}
<Link aria-label={actionText} title={actionText} to={path}>
<Edit height={18} />
</Link>
</PlaceContainer>
</SavedPlacePanel>
)}
</Container>
)
53 changes: 26 additions & 27 deletions lib/components/user/places/styled.ts
Original file line number Diff line number Diff line change
@@ -1,82 +1,81 @@
import Link from '../../util/link'
import styled from 'styled-components'

import { GREY_ON_WHITE } from '../../util/colors'

import Place, {
ActionButton,
ActionButtonPlaceholder,
IconWrapper,
PlaceButton,
PlaceContainer,
PlaceContent,
PlaceDetail,
PlaceLink,
PlaceName
} from './place'

// Styles and exports for favorite place components
// used in the My account page.

const FAVORITE_PLACE_HEIGHT_PX = '60px'

export const StyledFavoritePlace = styled(Place).attrs({
largeIcon: true
})`
align-items: stretch;
display: flex;
height: ${FAVORITE_PLACE_HEIGHT_PX};
margin-bottom: 10px;
${PlaceLink} {
${PlaceContainer} {
align-items: center;
display: flex;
flex: 1 0 0;
text-align: left;
display: grid;
font-size: 14px;
gap: 15px;
grid-template-columns: 30px auto 30px;
padding: 10px;
}
${PlaceContent} {
display: flex;
flex: 1 0 0;
flex-direction: column;
margin-left: 10px;
/* overflow is needed here for the nested overflow to take effect. */
overflow: hidden;
}
${PlaceDetail} {
color: ${GREY_ON_WHITE};
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
${PlaceName},
${PlaceDetail} {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
${IconWrapper} {
color: ${GREY_ON_WHITE};
flex-shrink: 0;
}
${ActionButton}, ${ActionButtonPlaceholder} {
margin-left: 4px;
width: ${FAVORITE_PLACE_HEIGHT_PX};
}
`

// Styles and exports for the place component
// used in the main panel.

export const StyledMainPanelPlace = styled(Place)`
${PlaceButton} {
background: none;
border: none;
&:hover {
background-color: #e6e6e6;
}
}
${PlaceName} {
margin-left: 0.25em;
}
${PlaceDetail} {
display: block;
height: 100%;
}
${ActionButton} {
border: none;
width: 40px;
}
`

export const NewPlaceButton = styled(Link)`
align-items: center;
display: flex;
margin-top: 15px;
width: fit-content;
gap: 10px;
`
15 changes: 10 additions & 5 deletions lib/components/util/toasts.tsx
Original file line number Diff line number Diff line change
@@ -31,14 +31,19 @@ export function toastSuccess(
/**
* Helper that will display a toast notification when a place is saved.
*/
export function toastOnPlaceSaved(
export function toastOnPlaceChanged(
place: UserSavedLocation,
intl: IntlShape
intl: IntlShape,
change: 'Remembered' | 'Deleted'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: Can we change this to an enum? Magic strings are annoying

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm actually going to change the way we handle toasts in imminent follow up PR 🙃

): void {
toastSuccess(
getPlaceMainText(place, intl),
intl.formatMessage({
id: 'actions.user.placeRemembered'
})
change === 'Remembered'
? intl.formatMessage({
id: 'actions.user.placeRemembered'
})
: intl.formatMessage({
id: 'actions.user.placeDeleted'
})
)
}

Unchanged files with check annotations Beta

import { Field, Form, Formik } from 'formik'
import React, {Component} from 'react'

Check failure on line 2 in lib/components/admin/editable-section.js

GitHub Actions / test-build-release

Replace `Component` with `·Component·`
import {
Button,
import { createAction } from 'redux-actions'
if (typeof (fetch) === 'undefined') require('isomorphic-fetch')

Check failure on line 2 in lib/actions/zipcar.js

GitHub Actions / test-build-release

Replace `(fetch)` with `fetch`
export const receivedZipcarLocationsError = createAction('ZIPCAR_LOCATIONS_ERROR')

Check failure on line 4 in lib/actions/zipcar.js

GitHub Actions / test-build-release

Replace `'ZIPCAR_LOCATIONS_ERROR'` with `⏎··'ZIPCAR_LOCATIONS_ERROR'⏎`
export const receivedZipcarLocationsResponse = createAction('ZIPCAR_LOCATIONS_RESPONSE')

Check failure on line 5 in lib/actions/zipcar.js

GitHub Actions / test-build-release

Replace `'ZIPCAR_LOCATIONS_RESPONSE'` with `⏎··'ZIPCAR_LOCATIONS_RESPONSE'⏎`
export const requestZipcarLocationsResponse = createAction('ZIPCAR_LOCATIONS_REQUEST')

Check failure on line 6 in lib/actions/zipcar.js

GitHub Actions / test-build-release

Replace `'ZIPCAR_LOCATIONS_REQUEST'` with `⏎··'ZIPCAR_LOCATIONS_REQUEST'⏎`
export function zipcarLocationsQuery (url) {

Check failure on line 8 in lib/actions/zipcar.js

GitHub Actions / test-build-release

Delete `·`
return async function (dispatch, getState) {
dispatch(requestZipcarLocationsResponse())
let json
import { replace, push } from 'connected-react-router'

Check failure on line 1 in lib/actions/auth.js

GitHub Actions / test-build-release

Member 'push' of the import declaration should be sorted alphabetically
import { setPathBeforeSignIn } from '../actions/user'
* @param {Error} err
* @param {AccessTokenRequestOptions} options
*/
export function showAccessTokenError (err, options) {

Check failure on line 11 in lib/actions/auth.js

GitHub Actions / test-build-release

Delete `·`
return function (dispatch, getState) {
// TODO: improve this.
console.error('Failed to retrieve access token: ', err)
* when signing-in fails for some reason.
* @param {Error} err
*/
export function showLoginError (err) {

Check failure on line 23 in lib/actions/auth.js

GitHub Actions / test-build-release

Delete `·`
return function (dispatch, getState) {
// TODO: improve this.
if (err) dispatch(push('/oops'))
* @param {Object} appState The state stored when calling useAuth0().loginWithRedirect
* or when instantiating a component that uses withAuhenticationRequired.
*/
export function processSignIn (appState) {

Check failure on line 36 in lib/actions/auth.js

GitHub Actions / test-build-release

Delete `·`
return function (dispatch, getState) {
if (appState && appState.returnTo) {
// Remove URL parameters that were added by auth0-react