From c3f95e46a8091c987eae92613bec1907b7e868c2 Mon Sep 17 00:00:00 2001 From: Mike Allbutt Date: Tue, 25 Aug 2020 01:05:31 -0500 Subject: [PATCH 01/67] Adding missing icons to fields Adding missing icons to fields on contact details, edit and new screens. --- screens/Contact/ContactDetailScreen.js | 3968 ++++++++++++------------ 1 file changed, 2000 insertions(+), 1968 deletions(-) diff --git a/screens/Contact/ContactDetailScreen.js b/screens/Contact/ContactDetailScreen.js index 25c3a193..e0fa8b04 100644 --- a/screens/Contact/ContactDetailScreen.js +++ b/screens/Contact/ContactDetailScreen.js @@ -380,7 +380,7 @@ const initialState = { connectionGroups: [], unmodifiedConnectionGroups: [], assignedToContacts: [], - unmodifedAssignedToContacts: [] + unmodifedAssignedToContacts: [], }; const safeFind = (found, prop) => { @@ -475,13 +475,13 @@ class ContactDetailScreen extends React.Component { fontWeight: 'bold', width: params.onlyView ? Platform.select({ - android: 200, - ios: 180, - }) + android: 200, + ios: 180, + }) : Platform.select({ - android: 180, - ios: 140, - }), + android: 180, + ios: 140, + }), marginLeft: params.onlyView ? undefined : 25, }, }; @@ -663,15 +663,16 @@ class ContactDetailScreen extends React.Component { }); } if (newState.contact.subassigned) { - // Clear collection newState = { ...newState, - subAssignedContacts: [] + subAssignedContacts: [], }; newState.contact.subassigned.values.forEach((subassignedContact) => { - const foundSubassigned = newState.usersContacts.find((user) => user.value === subassignedContact.value); + const foundSubassigned = newState.usersContacts.find( + (user) => user.value === subassignedContact.value, + ); if (!foundSubassigned) { // Add non existent contact subassigned in subassigned list (user does not have access permission to this contacts) newState = { @@ -680,31 +681,31 @@ class ContactDetailScreen extends React.Component { ...newState.subAssignedContacts, { name: subassignedContact.name, - value: subassignedContact.value - } + value: subassignedContact.value, + }, ], unmodifiedSubAssignedContacts: [ ...newState.unmodifiedSubAssignedContacts, { name: subassignedContact.name, - value: subassignedContact.value - } - ] + value: subassignedContact.value, + }, + ], }; } }); - } if (newState.contact.relation) { - // Clear collection newState = { ...newState, - relationContacts: [] + relationContacts: [], }; newState.contact.relation.values.forEach((relationContact) => { - const foundRelation = newState.usersContacts.find((user) => user.value === relationContact.value); + const foundRelation = newState.usersContacts.find( + (user) => user.value === relationContact.value, + ); if (!foundRelation) { // Add non existent contact relation in relation list (user does not have access permission to this contacts) newState = { @@ -713,31 +714,31 @@ class ContactDetailScreen extends React.Component { ...newState.relationContacts, { name: relationContact.name, - value: relationContact.value - } + value: relationContact.value, + }, ], unmodifiedRelationContacts: [ ...newState.unmodifiedRelationContacts, { name: relationContact.name, - value: relationContact.value - } - ] + value: relationContact.value, + }, + ], }; } }); - } if (newState.contact.baptized_by) { - // Clear collection newState = { ...newState, - baptizedByContacts: [] + baptizedByContacts: [], }; newState.contact.baptized_by.values.forEach((baptizedByContact) => { - const foundBaptized = newState.usersContacts.find((user) => user.value === baptizedByContact.value); + const foundBaptized = newState.usersContacts.find( + (user) => user.value === baptizedByContact.value, + ); if (!foundBaptized) { // Add non existent contact relation in relation list (user does not have access permission to this contacts) newState = { @@ -746,31 +747,31 @@ class ContactDetailScreen extends React.Component { ...newState.baptizedByContacts, { name: baptizedByContact.name, - value: baptizedByContact.value - } + value: baptizedByContact.value, + }, ], unmodifiedBaptizedByContacts: [ ...newState.unmodifiedBaptizedByContacts, { name: baptizedByContact.name, - value: baptizedByContact.value - } - ] + value: baptizedByContact.value, + }, + ], }; } }); - } if (newState.contact.baptized) { - // Clear collection newState = { ...newState, - baptizedContacts: [] + baptizedContacts: [], }; newState.contact.baptized.values.forEach((baptizedContact) => { - const foundBaptized = newState.usersContacts.find((user) => user.value === baptizedContact.value); + const foundBaptized = newState.usersContacts.find( + (user) => user.value === baptizedContact.value, + ); if (!foundBaptized) { // Add non existent contact baptized to list (user does not have access permission to this contacts) newState = { @@ -779,31 +780,31 @@ class ContactDetailScreen extends React.Component { ...newState.baptizedContacts, { name: baptizedContact.name, - value: baptizedContact.value - } + value: baptizedContact.value, + }, ], unmodifiedBaptizedContacts: [ ...newState.unmodifiedBaptizedContacts, { name: baptizedContact.name, - value: baptizedContact.value - } - ] + value: baptizedContact.value, + }, + ], }; } }); - } if (newState.contact.coached_by) { - // Clear collection newState = { ...newState, - coachedByContacts: [] + coachedByContacts: [], }; newState.contact.coached_by.values.forEach((coachedByContact) => { - const foundcoachedBy = newState.usersContacts.find((user) => user.value === coachedByContact.value); + const foundcoachedBy = newState.usersContacts.find( + (user) => user.value === coachedByContact.value, + ); if (!foundcoachedBy) { // Add non existent contact coachedBy to list (user does not have access permission to this contacts) newState = { @@ -812,31 +813,31 @@ class ContactDetailScreen extends React.Component { ...newState.coachedByContacts, { name: coachedByContact.name, - value: coachedByContact.value - } + value: coachedByContact.value, + }, ], unmodifiedCoachedByContacts: [ ...newState.unmodifiedCoachedByContacts, { name: coachedByContact.name, - value: coachedByContact.value - } - ] + value: coachedByContact.value, + }, + ], }; } }); - } if (newState.contact.coaching) { - // Clear collection newState = { ...newState, - coachedContacts: [] + coachedContacts: [], }; newState.contact.coaching.values.forEach((coachedContact) => { - const foundCoached = newState.usersContacts.find((user) => user.value === coachedContact.value); + const foundCoached = newState.usersContacts.find( + (user) => user.value === coachedContact.value, + ); if (!foundCoached) { // Add non existent contact coached to list (user does not have access permission to this contacts) newState = { @@ -845,27 +846,25 @@ class ContactDetailScreen extends React.Component { ...newState.coachedContacts, { name: coachedContact.name, - value: coachedContact.value - } + value: coachedContact.value, + }, ], unmodifiedCoachedContacts: [ ...newState.unmodifiedCoachedContacts, { name: coachedContact.name, - value: coachedContact.value - } - ] + value: coachedContact.value, + }, + ], }; } }); - } if (newState.contact.groups) { - // Clear collection newState = { ...newState, - connectionGroups: [] + connectionGroups: [], }; newState.contact.groups.values.forEach((groupConnection) => { @@ -878,51 +877,50 @@ class ContactDetailScreen extends React.Component { ...newState.connectionGroups, { name: groupConnection.name, - value: groupConnection.value - } + value: groupConnection.value, + }, ], unmodifiedConnectionGroups: [ ...newState.unmodifiedConnectionGroups, { name: groupConnection.name, - value: groupConnection.value - } - ] + value: groupConnection.value, + }, + ], }; } }); - } if (newState.contact.assigned_to) { - // Clear collection newState = { ...newState, - assignedToContacts: [] + assignedToContacts: [], }; - let foundAssigned = newState.users.find((user) => user.key === newState.contact.assigned_to.key); - if (!foundAssigned) { - // Add non existent group to list (user does not have access permission to this groups) - newState = { - ...newState, - assignedToContacts: [ - ...newState.assignedToContacts, - { - label: foundAssigned.label, - key: foundAssigned.key - } - ], - unmodifedAssignedToContacts: [ - ...newState.unmodifedAssignedToContacts, - { - label: foundAssigned.label, - key: foundAssigned.key - } - ] - }; - } - + let foundAssigned = newState.users.find( + (user) => user.key === newState.contact.assigned_to.key, + ); + if (!foundAssigned) { + // Add non existent group to list (user does not have access permission to this groups) + newState = { + ...newState, + assignedToContacts: [ + ...newState.assignedToContacts, + { + label: foundAssigned.label, + key: foundAssigned.key, + }, + ], + unmodifedAssignedToContacts: [ + ...newState.unmodifedAssignedToContacts, + { + label: foundAssigned.label, + key: foundAssigned.key, + }, + ], + }; + } } } @@ -1246,7 +1244,7 @@ class ContactDetailScreen extends React.Component { })), loadedLocal: true, sources: [...sourcesList], - unmodifiedSources: [...sourcesList] + unmodifiedSources: [...sourcesList], }; this.setState(newState, () => { @@ -1314,7 +1312,8 @@ class ContactDetailScreen extends React.Component { }; onDisableEdit = () => { - const { unmodifiedContact, + const { + unmodifiedContact, unmodifiedSources, unmodifiedSubAssignedContacts, unmodifiedRelationContacts, @@ -1323,7 +1322,7 @@ class ContactDetailScreen extends React.Component { unmodifiedCoachedByContacts, unmodifiedCoachedContacts, unmodifiedConnectionGroups, - unmodifedAssignedToContacts + unmodifedAssignedToContacts, } = this.state; this.setState((state) => { const indexFix = @@ -1349,7 +1348,7 @@ class ContactDetailScreen extends React.Component { coachedByContacts: [...unmodifiedCoachedByContacts], coachedContacts: [...unmodifiedCoachedContacts], connectionGroups: [...unmodifiedConnectionGroups], - assignedToContacts: [...unmodifedAssignedToContacts] + assignedToContacts: [...unmodifedAssignedToContacts], }; }); this.props.navigation.setParams({ hideTabBar: false, onlyView: true }); @@ -1528,7 +1527,7 @@ class ContactDetailScreen extends React.Component { ID: this.state.contact.ID, }; } - if(contactToSave.assigned_to) { + if (contactToSave.assigned_to) { contactToSave = { ...contactToSave, assigned_to: `user-${contactToSave.assigned_to.key}`, @@ -1823,7 +1822,7 @@ class ContactDetailScreen extends React.Component { - {(this.state.contact.assigned_to) ? this.showAssignedUser() : null} + {this.state.contact.assigned_to ? this.showAssignedUser() : null}