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

[NFC] Convert some fields on admin display preferences to use metdata #12906

Merged
merged 5 commits into from
Oct 10, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Oct 8, 2018

Overview

This has no functional impact - cleanup only.

As part of making settings forms more metadata-driven this is a further conversion

Affected field is bottom one in pic
screenshot 2018-10-08 21 30 52

screenshot 2018-10-08 22 51 58

Before

Field is hard-coded

After

Field uses metadata

Technical Details

In general we want settings to be presented based on metadata & to transfer all those information assets into the xml - this is a step on that.

Comments

@mattwire

@civibot
Copy link

civibot bot commented Oct 8, 2018

(Standard links)

@civibot civibot bot added the master label Oct 8, 2018
@eileenmcnaughton eileenmcnaughton changed the title [NFC] Convert 'Viewing Smart Groups' on admin display preferences to use metdata [NFC] Convert some fields on admin display preferences to use metdata Oct 8, 2018
@JohnFF
Copy link
Contributor

JohnFF commented Oct 9, 2018

Reviewed and tested Admin Settings /civicrm/admin/setting/preferences/display?reset=1
@eileenmcnaughton - am I correct in thinking that the HTML before and after should be identical?

</tr>
<tr class="crm-preferences-display-form-block-description">
<td>&nbsp;</td>
<td class="description">{ts}When enabled, any filter settings a user selects on the contact's Activity tab will be remembered as they visit other contacts.{/ts}
<td class="description">{$settings_fields.preserve_activity_tab_filter.description}
Copy link
Contributor

@JohnFF JohnFF Oct 9, 2018

Choose a reason for hiding this comment

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

I think the close td should be on the line above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

if (isset($props['pseudoconstant'])) {
$options = civicrm_api3('Setting', 'getoptions', [
'field' => $setting,
]);
])['values'];
Copy link
Contributor

Choose a reason for hiding this comment

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

I see the preference for using $options instead of $options['values'] below, but functioncall()['arrayindex'] is messy. $options = $options['values'] would be preferable in my view.

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 a big fan of that syntax though :-(

@@ -155,11 +155,11 @@

<tr class="crm-preferences-display-form-block-preserve_activity_tab_filter">
<td class="label"></td>
<td>{$form.preserve_activity_tab_filter.html} {$form.preserve_activity_tab_filter.label}</td>
<td>{$form.preserve_activity_tab_filter.html} </td>
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove space before close td

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

'is_domain' => 1,
'is_contact' => 0,
'description' => 'When enabled, any filter settings a user selects on the contact\'s Activity tab will be remembered as they visit other contacts',
'help_text' => NULL,
'description' => ts('When enabled, any filter settings a user selects on the contact\'s Activity tab will be remembered as they visit other contacts'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Please can we have a full stop at the end of the description?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

'default' => '0',
'add' => '4.7',
'title' => 'Preserve activity filters as a user preference',
'title' => ts('Preserve activity filters as a user preference'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Title markup entries should probably end with a full stop like most of the description entries do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as discussed - leaving full stops off the titles

@JohnFF
Copy link
Contributor

JohnFF commented Oct 10, 2018

Re-tested happy to merge :)

@eileenmcnaughton
Copy link
Contributor Author

unrelated fails

@eileenmcnaughton eileenmcnaughton merged commit 3363f56 into civicrm:master Oct 10, 2018
@eileenmcnaughton eileenmcnaughton deleted the setting branch October 10, 2018 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants