Make the event and contact itemUid the consistent.

It was different between them and compared to viewing a journal's item.
This was inconsistent and is now fixed.
master
Tom Hacohen 7 years ago
parent 35b3ce7f95
commit 40af8a49d7

@ -51,7 +51,7 @@ export const routeResolver = new RouteResolver({
pim: { pim: {
contacts: { contacts: {
_id: { _id: {
_base: ':contactUid', _base: ':itemUid',
edit: 'edit', edit: 'edit',
log: 'log', log: 'log',
}, },
@ -59,7 +59,7 @@ export const routeResolver = new RouteResolver({
}, },
events: { events: {
_id: { _id: {
_base: ':eventUid', _base: ':itemUid',
edit: 'edit', edit: 'edit',
log: 'log', log: 'log',
}, },

@ -47,14 +47,14 @@ class PimMain extends React.PureComponent {
const uid = event.uid; const uid = event.uid;
this.props.history!.push( this.props.history!.push(
routeResolver.getRoute('pim.events._id', { eventUid: uid })); routeResolver.getRoute('pim.events._id', { itemUid: uid }));
} }
contactClicked(contact: ContactType) { contactClicked(contact: ContactType) {
const uid = contact.uid; const uid = contact.uid;
this.props.history!.push( this.props.history!.push(
routeResolver.getRoute('pim.contacts._id', { contactUid: uid })); routeResolver.getRoute('pim.contacts._id', { itemUid: uid }));
} }
floatingButtonClicked() { floatingButtonClicked() {

@ -168,8 +168,8 @@ class Pim extends React.PureComponent {
render={({match}) => ( render={({match}) => (
<Container style={{maxWidth: 400}}> <Container style={{maxWidth: 400}}>
<ContactEdit <ContactEdit
initialCollection={(addressBookItems[match.params.contactUid] as any).journalUid} initialCollection={(addressBookItems[match.params.itemUid] as any).journalUid}
contact={addressBookItems[match.params.contactUid]} contact={addressBookItems[match.params.itemUid]}
collections={collectionsAddressBook} collections={collectionsAddressBook}
onSave={this.onContactSave} onSave={this.onContactSave}
/> />
@ -184,7 +184,7 @@ class Pim extends React.PureComponent {
<ItemChangeLog <ItemChangeLog
syncInfo={this.props.syncInfo} syncInfo={this.props.syncInfo}
items={addressBookItems} items={addressBookItems}
uid={match.params.contactUid} uid={match.params.itemUid}
/> />
</Container> </Container>
)} )}
@ -202,7 +202,7 @@ class Pim extends React.PureComponent {
onClick={() => onClick={() =>
history.push(routeResolver.getRoute( history.push(routeResolver.getRoute(
'pim.contacts._id.log', 'pim.contacts._id.log',
{contactUid: match.params.contactUid})) {itemUid: match.params.itemUid}))
} }
/> />
@ -214,11 +214,11 @@ class Pim extends React.PureComponent {
onClick={() => onClick={() =>
history.push(routeResolver.getRoute( history.push(routeResolver.getRoute(
'pim.contacts._id.edit', 'pim.contacts._id.edit',
{contactUid: match.params.contactUid})) {itemUid: match.params.itemUid}))
} }
/> />
</div> </div>
<Contact item={addressBookItems[match.params.contactUid]} /> <Contact item={addressBookItems[match.params.itemUid]} />
</Container> </Container>
)} )}
/> />
@ -237,8 +237,8 @@ class Pim extends React.PureComponent {
render={({match}) => ( render={({match}) => (
<Container style={{maxWidth: 400}}> <Container style={{maxWidth: 400}}>
<EventEdit <EventEdit
initialCollection={(calendarItems[match.params.eventUid] as any).journalUid} initialCollection={(calendarItems[match.params.itemUid] as any).journalUid}
event={calendarItems[match.params.eventUid]} event={calendarItems[match.params.itemUid]}
collections={collectionsCalendar} collections={collectionsCalendar}
onSave={this.onEventSave} onSave={this.onEventSave}
/> />
@ -253,7 +253,7 @@ class Pim extends React.PureComponent {
<ItemChangeLog <ItemChangeLog
syncInfo={this.props.syncInfo} syncInfo={this.props.syncInfo}
items={calendarItems} items={calendarItems}
uid={match.params.eventUid} uid={match.params.itemUid}
/> />
</Container> </Container>
)} )}
@ -271,7 +271,7 @@ class Pim extends React.PureComponent {
onClick={() => onClick={() =>
history.push(routeResolver.getRoute( history.push(routeResolver.getRoute(
'pim.events._id.log', 'pim.events._id.log',
{eventUid: match.params.eventUid})) {itemUid: match.params.itemUid}))
} }
/> />
@ -283,11 +283,11 @@ class Pim extends React.PureComponent {
onClick={() => onClick={() =>
history.push(routeResolver.getRoute( history.push(routeResolver.getRoute(
'pim.events._id.edit', 'pim.events._id.edit',
{eventUid: match.params.eventUid})) {itemUid: match.params.itemUid}))
} }
/> />
</div> </div>
<Event item={calendarItems[match.params.eventUid]} /> <Event item={calendarItems[match.params.itemUid]} />
</Container> </Container>
)} )}
/> />

Loading…
Cancel
Save