Skip to content
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

Issue 1498 - Adding entity fields #1526

Merged
merged 20 commits into from
Oct 14, 2024
Merged

Issue 1498 - Adding entity fields #1526

merged 20 commits into from
Oct 14, 2024

Conversation

gkovats
Copy link
Collaborator

@gkovats gkovats commented Sep 23, 2024

Adds Entity form fields to Settings page:

  • 5 fields: entity, entity_email, entity_url, entity_phone, entity_location
  • limits all to 100 characters: wanted to limit because this will add weight to every meeting in every feed.
    • Note: the added weight is worth bringing up to Meeting Guide, they'll likely notice
  • added defaults for entity, entity_url, entity_email, so we start with values from WordPress

Adds Entity fields to export / import

  • sanitizer caps strings off at 100 characters
  • export supplies the local entity values for meetings without a data_source, otherwise grabs any entity values from post_meta / meeting fields

Adds Entity fields to TSML Legacy

  • Added in "Updated" box. I took a crack at it, seemed like it belonged their, but I know we want to be efficient with screen real estate, and it should follow the pattern that TSML UI and Meeting Guide will use. Consider this a draft.

image

@@ -332,7 +346,59 @@ function tsml_settings_page()
</form>
</div>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Check the order of these on the settings screen. I ended up putting this in spot 2, left column, and moved the Feeds settings to top of the middle column. But I don't stare at this screen much, so it's a guess.

- clear meeting cache on entity change
- change default entity value check
- updated line for returning meeting compare fields
- show default values in form so
user is aware what will be in exports
- reprocess POT
This reverts commit 45a4fbd.
@gkovats gkovats marked this pull request as ready for review September 23, 2024 14:19
Copy link
Contributor

@joshreisner joshreisner left a comment

Choose a reason for hiding this comment

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

look great, thanks for jumping on this so quickly! just a few comments

includes/functions.php Outdated Show resolved Hide resolved
includes/admin_settings.php Show resolved Hide resolved
<?php the_modified_date() ?>
</p>
<?php
if (!empty($meeting->{'data_source'})) {
Copy link
Contributor

@joshreisner joshreisner Sep 23, 2024

Choose a reason for hiding this comment

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

i think we need some intro text here potentially like "This meeting listing is provided by:"

let's not show the email address - this is more for administrative purposes

the feedback email form should either be hidden and we add something here, or it should send to the entity's feedback_email addresses if present

minor: could we use the $meeting->data_source pattern for this and the other vars?

minor: i would like to steer away from using <br> tags - could this be Ps or a UL?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding "This meeting listing is provided by:" only concern it will show up everywhere if we display for local and imported meetings, and it just adds that one more line to what your eye is scanning for
image

Look correct to you? Should it be smaller?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

or it should send to the entity's feedback_email addresses if present

Honestly this raises questions I want to talk about, cause it'll be a mess typing it out. Don't feel equipped with enough history on this tool to answer them myself.

Copy link
Contributor

Choose a reason for hiding this comment

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

hm, yeah, i'm not so sure. perhaps less is more?

my reason for wanting to add it is that we want to make it clear what this section is - some users might get confused and think it is meeting information.

the purpose of this section is to be like this section in the app:
Screenshot 2024-09-24 at 3 11 42 PM

if we could replicate the headline style for the other sections for the entity name, and make the url and phone buttons like in this pic:

Screenshot 2024-09-24 at 3 14 05 PM

we might try the This meeting listing is provided by: above the headline in a <small>?

Copy link
Contributor

Choose a reason for hiding this comment

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

here's what it currently looks like in this PR for TSML UI:

image

not that it needs to match per se but just for context


<form method="post" class="stack compact" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
<?php wp_nonce_field($tsml_nonce, 'tsml_nonce', false) ?>
<h3>
Copy link
Contributor

Choose a reason for hiding this comment

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

could these h3s be labels instead? the smaller type should look good as well

i would keep it Entity Name but change:

Entity Contact Email -> Administrative Contact Email
Entity Contact Phone -> Public Phone Number
Entity Location -> Your Service Area
Entity Website -> Website Address

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"Your" felt redundant on looking at it, like it could be in all labels. This OK, or you think the "your" belongs?
image

Copy link
Contributor

Choose a reason for hiding this comment

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

that's good! maybe make them labels though, if they're not already

'entity_phone',
'entity_location',
'entity_url',
];
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to add feedback email here? the idea is that they should pass through from the imported service entity

@joshreisner
Copy link
Contributor

one minor thing: i'm seeing PHP warnings on some of the entity form fields when running locally:

Screenshot 2024-10-12 at 8 59 23 AM

@joshreisner
Copy link
Contributor

also i think feedback_emails should use array_values - see example at https://demo.code4recovery.org/wp-admin/admin-ajax.php?action=meetings

Screenshot 2024-10-12 at 9 07 16 AM

@joshreisner
Copy link
Contributor

joshreisner commented Oct 12, 2024

one last piece of feedback, and feel free to push back and/or say we should make this a subsequent PR, is i think if feedback emails are present on a meeting in legacy, we should expose the feedback form and send to those emails.

ie here:

if (!empty($tsml_feedback_addresses)) { ?>

we might say

if (!empty($tsml_feedback_addresses) || !empty($meeting->feedback_emails)) { ?>

… but looks like you already did the work to make is actually send, so i could be missing something? maybe it's not importing because of the array_values issue above?

- when casting to array, also use array_valus to avoid
   associative keys
- ensure settings page has all possible entity fields
   present for display
- update logic for displaying change request form
@gkovats
Copy link
Collaborator Author

gkovats commented Oct 13, 2024

@joshreisner FYI

  • added array_values() to places where I'm casting to array to avoid keys
  • fixed the admin settings form to ensure those array fields are present before displaying
  • updated form button to use already existing button style class btn btn-default btn-block and removed my new style
  • fixed the logic for displaying the change request form - it was entirely an oversight on my part

maybe need a prettier config in this project?
@joshreisner
Copy link
Contributor

looks awesome! only detail i noticed is the link icon is a little big - looks like it just needs width and height props

if you don't mind i'll just go ahead and merge this add them in the follow-on PR where i set the new version

Screenshot 2024-10-13 at 7 41 02 PM

@joshreisner joshreisner merged commit 4c37aad into main Oct 14, 2024
@joshreisner joshreisner deleted the issue-1498-entity-fields branch October 14, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Support for Service Entity Fields in TSML
2 participants