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

(dev/core/50) Add Separate Sub-tabs for Contributions and Recurring Contributions #11956

Merged

Conversation

MiyaNoctem
Copy link
Contributor

@MiyaNoctem MiyaNoctem commented Apr 6, 2018

Overview

Currently, when viewing contributions on a contact's summary view, there are two tables being shown: one for contributions, the second for recurring contributions. The problem is when a contact has a lot of contributions, recurring contributions kind of get lost within the page, having to scroll down quite a bit to get to the required information. We'd like to have two sub-tabs within the contributions tab, so that we can choose either contributions or recurring contributions as needed. Furthermore, we'd also like to separate active from inactive recurring contributions within the recurring contributions tab, to have easier access to the information that is most likely to be needed.

Before

When viewing contributions on a contact's summary view, two tables being shown: one for contributions, the second for recurring contributions.

basw-84-before

After

Changed Contributions Tab template so it uses two sub-tabs within it to show on the first tab, only the contributions table, and on the second tab, just the recurring contributions table.

On the Recurring contributions tab, two tables are shown: active recurring contributions vs inactive recurring contributions.

Implemented backend logic to load into the page two separate arrays with recurring contributions, the first one with active contributions, the second one with inactive contributions.

basw-84-after-2


Issue reported on gitlab issue tracker:
https://lab.civicrm.org/dev/core/issues/50

…utions

Changed Contributions Tab template so it uses two sub-tabs within it to show
on the first tab, only the contributions table, and on the second tab, just
the recurring contributions table.

On the Recurring contributions tab, two tables are shown: active recurring
contributions vs inactive recurring contributions.

Implemented backend logic to load into the page two separate arrays with
recurring contributions, the first one with active contributions, the second
one with inactive contributions.
*
* @var array
*/
private $inactiveStatuses = array('Cancelled', 'Chargeback', 'Refunded', 'Completed');
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be better in the ContributionRecur BAO - there may already be something that does this, otherwise would need to create a helper function.

</div>
<div id="recurring-subtab" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
{if $recur}
<div class="crm-block crm-contact-contribute-recur">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get additional class selectors on the two div classes here please so they can be uniquely identified for theming/jquery customisation Eg.
<div class="crm-block crm-contact-contribute-recur crm-contact-contribute-recur-active">
<div class="crm-block crm-contact-contribute-recur crm-contact-contribute-recur-inactive">

@eileenmcnaughton
Copy link
Contributor

@colemanw do you have an opinion on this? I have a feeling Dgg rejected the same proposed change from Parvez a while ago but I can't think why. Do we need to check support for this change (e.g email dev list & invite people to comment)?

@eileenmcnaughton
Copy link
Contributor

If we do separate it out it would seem weird to do it in the same tpl since other tabs have their own tpl / php classes. The only issue I can think of that might have been Dgg's reason was that the tab should disappear if civicontribute is not enabled (but that seems very fixable)

@MiyaNoctem MiyaNoctem changed the title CRM-50: Add Separate Sub-tabs for Contributions and Recurring Contributions (dev/core/50) Add Separate Sub-tabs for Contributions and Recurring Contributions Apr 9, 2018
@MiyaNoctem
Copy link
Contributor Author

Jenkins re test this please

@colemanw
Copy link
Member

I think this depends a lot on use-case. Some orgs really care about the difference, others do not. I'm a little worried that users will be surprised by this change and say the recurring contributions have "gone missing" since they are now hidden on initial load.
Adding counter numbers in the tabs would help with that.

But IMO the ideal UX would probably use a concept more like "filters" than tabs to show just one table but have some buttons at the top to filter out the non-recurring or recurring contributions from display on-the-fly.

@MiyaNoctem
Copy link
Contributor Author

Jenkins re test this please

And added class selectors to each div containing active and inactive recurring
contributions.
@@ -32,6 +32,13 @@
*/
class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_ContributionRecur {

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

@MiyaNoctem can you do git config core.filemode=false to stop committing file permission changes?

(This commit looks like it would be fairly easy to merge by itself it it were in a separate pr - although maybe not the tpl part if it doesn't apply over core by itself)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

File permissions have been fixed.

@MiyaNoctem
Copy link
Contributor Author

Implemented @mattwire's suggestions, but unsure on how to proceed now.

@eileenmcnaughton, @colemanw, @guanhuan?

@eileenmcnaughton
Copy link
Contributor

So the underlying issue is 'does this make sense as a core change' - since it has been 'raised' in a code context we've all jumped into the code without answering that question first.

However, we don't have a clear cut process for dealing with how to determine if it was a core change. The move to gitlab & bedding in there has somewhat added to the interim uncertainty.

I know this is a source of considerable frustration both for Compucorp & @jusfreeman and also for people trying to figure out how to review these. We should probably figure out the best forum for a discussion on this - probably gitlab with some resulting document.

I guess the underlying questions for making code improvements are

  1. Do we have consensus that this is an improvement?
  2. Could this changed be detrimental to some user flows or expectations
  3. Could it be done in an extension
  4. Should it be done in an extension

In terms of questions 1 & 2 I guess there is an initial triage process whereby someone looks to see if they are clear cut. If not then we need to see if the answer to 3 & 4 is 'no' or 'probably not' & if that seems to be the case then we need a process for canvassing our community. (the triager will not always get it right so an initial 'probably not' is not a guarantee that someone else won't come along & say 'whoa' but that's a side issue).

Currently that process is logging an issue in gitlab and emailing the dev list. (Generally I would then close the PR until the 'should we proceed' question is resolved & re-open if it is agreed to be 'yes').

A big gap in this process is what to do if no-one really responds to the proposal & depending on the extent of the change it may be appropriate to deem lack of negative response within a certain timeframe to equal a positive response (assuming the code is also able to be implemented in a way that it has a positive affect on code quality / test coverage or at least not a negative one) or some changes might require a stronger positive response to go in core.

I think it's worth considering this one as an extension & if you don't think that makes sense then I think the dev list should be canvassed. I would probably err tend to think this one might fit the no negative given adequate time - e.g 3 weeks) would be enough if people are unresponsive - but the email would also have to have succinctly summarised the impact.

Pinging @totten @colemanw @mlutfy @seamuslee001 @seanmadsen @JoeMurray @lcdservices @petednz @agh1

@guanhuan
Copy link
Contributor

guanhuan commented May 2, 2018

@eileenmcnaughton Great note!

A big gap in this process is what to do if no-one really responds to the proposal & depending on the extent of the change it may be appropriate to deem lack of negative response within a certain timeframe to equal a positive response (assuming the code is also able to be implemented in a way that it has a positive affect on code quality / test coverage or at least not a negative one) or some changes might require a stronger positive response to go in core.

There was a previous suggestion in the release management process which can potentially help with this issue. That is to form different groups based on people's expertise per CiviCRM component such as event, membership, finance, infrastructure etc. Each group can then regularly check the proposals that are labelled with relevant component.

I think it is probably worth it to send these to the dev list or merger room even for a concrete process discussion.

@guanhuan
Copy link
Contributor

guanhuan commented May 2, 2018

Regarding this PR itself. It is only a partial of the improvement. We are also working on a follow up improvement associated with this to show the contributions that are related to a recurring contribution in view/ edit recurring contribution screens. #11920

@lcdservices
Copy link
Contributor

I don't have an issue with the change. A few comments though:

  • @colemanw re: your concern/comment regarding filters -- that's not really applicable. they're not moving the contributions to a different tab -- they're moving the recurring contribution "profiles" -- the details about the recurring setup, not the contributions themselves. so no one would think actual contributions were missing since they still load by default in the first tab.
  • I agree with the premise -- details about recurring contribs get lost at the bottom of the list
  • I like the idea of adding subtabs and think that could be something people want to extend further in the future. for example -- I have several clients using the extension that lists related contact contribs at the bottom of the contact's contrib tab. that too get's lost in long lists and would be better handled in a tab. this is just to say that the UI model has other possible opportunities
  • from a purely UI standpoint -- could we use a different tab UI for the embedded tabs? the grey tab bar within a grey tab bar doesn't look that great. I feel like the embedded tabs should have a slightly simpler style.

note -- I didn't review code. this is just a comment on the proposed functionality. but I have no objections to it.

@eileenmcnaughton
Copy link
Contributor

@guanhuan "to form different groups based on people's expertise per CiviCRM component such as event, membership, finance, infrastructure etc" - it's a good idea - although the gap is that some functionality is just obscure - e.g @jusfreeman has an interest in improving event copy functionality - no-one else seems to have an opinion at all on that area of code, until it's committed & they want to know who moved their cheese :-)

We also get a gap between people who say they are interested & who actually engage - but still the current process of me trying to think of who might be prepared to thoughtfully engage on a particular code area without ALWAYS pinging the same people in case I burn them out, is a bit fraught too

@eileenmcnaughton
Copy link
Contributor

@guanhuan regarding "I think it is probably worth it to send these to the dev list or merger room even for a concrete process discussion." - yep can discuss somewhere like that - at some point some longer version of the above should be in document & shared via dev-list and / or blog

@mattwire
Copy link
Contributor

mattwire commented May 2, 2018

Personally I think this is a nice change. I've always thought that it would be nice if the contributions tab could be rewritten to use datatables, enable sorting on the recurring contributions and implement a view similar to the "Manage Groups" where you can expand/collapse contributions grouped by recurring contribution which I realise is somewhat more than this PR.
However, I don't think it would necessarily be difficult to implement this change in an extension, with a view to eventually replacing the core "Contributions" tab. See https://github.com/mattwire/de.systopia.fastactivity for an example which replaces the activities tab.
Implementing via an extension would offer more scope for changes to be made, and less (initial) effort to get the changes into core.
If we start implementing reusable (smarty/ajax) blocks then it becomes quite easy to implement new UI via an extension, which loads in those blocks from core, and replaces other parts with custom versions from an extension.

@eileenmcnaughton
Copy link
Contributor

Note that @jusfreeman has opened this for process discussion https://lab.civicrm.org/dev/core/issues/97

@guanhuan based on above (& pending @colemanw confirmation) I would say there is support for this & I would be inclined to say it should be a case where you email dev list & say that it will be merged (pending final reviewer confirmation) if people do not express objections on this PR - ie. (@colemanw correct me if I'm wrong) - this feels like it is at the level where some endorsements - which we have - plus lack of a strong negative case would be enough - provided a suitable email goes out & people have at least 10 days to re-act to it. - I do need @colemanw to concur on my take here though as he has raised some concerns

@KarinG
Copy link
Contributor

KarinG commented May 10, 2018

Could you please clarify that you are not moving the Recurring Contributions - but the Recurring Series into a new tab, correct? And that any and all Contributions (regardless of whether they were one-time; attached to a series; or a one time with token (card on file from a recurring series) -> remain in the Contributions tab - and are all visible on first load?

With many PRs - we typically bounce around the dev list for opinions and endorsements - about what we all feel is best. I'd like to propose that we start doing a better job of asking clients who heavily use the functionality we're discussing. We have one client who manages close to 6,000 recurring contributions per month; If this is an improvement - they should be excited (and I think they will be); but if not - lets hear their concerns.

Not only would we get fantastic feedback [there are some high-end professional people working for some of the larger non-profits] - I'm convinced that engaging our larger clients better is going to help us with credibility and therefore sustainability; Let me know if you'd like me to ask for a large client opinion on this one.

@tamarmeir
Copy link

Hi folks,

I've given a few thumbs up to responses here - I absolutely agree with @KarinG with regards to clarifying what will be shown on which tab - as a non-technical "expert" user, I've always found the term "Recurring Contribution" confusing - it's difficult to tell if one is talking about an installment of a recurring series or about the recurring series itself. Auth.net and PayPal have views that show recurring subscriptions/ARB details separately from transactions and it is very clear that the purpose of these views is to manage the subscriptions. If it is clear that the "Recurring Contributions" tab displays metadata about recurring subscriptions for management purposes (as Karin indicates), I think this feature would be very useful.

I also agree with @KarinG with regards to getting client opinion first before adding to core, but IMO, I think layout changes should always be optional (i.e. in the form of an extension, albeit included with core) - much like Google gives you the option to switch between classic and new views when implementing major changes to Gmail.

Alternatively, to help determine if a new view should be made permanent, perhaps usage stats can be gathered from Civi instances either by subliminally collecting the data (or by polling the users outright if that is too big brother). E.g., after a version update, an Admin-level user visits the Contributions tab of a given contact where an invitational message to "Try the new view" will be displayed with Yes/No option selection required to dismiss the message:

  • if the user clicks "Yes", present a confirmation message that explains that the view change will be applicable to all users so communication with colleagues is strongly recommended before proceeding
  • if the user clicks "Proceed", present a message indicating to disable the extension to revert to classic view
  • if the user clicks "Cancel" (or "No" from the initial invitation screen), present a message to enable the extension to try the new view at a later time
  1. Civi instances that enabled the extension

  2. Civi instances that later disabled the extension

  3. Civi instances that didn't try the extension

Thanks for the time and thought everyone has put into this feature and @eileenmcnaughton, you can always count on me, but you'll have to ping me directly to get my attention (e.g. @nganivet sent me an email to review and weigh in on this).

My two cents...

@jusfreeman
Copy link
Contributor

@KarinG Great comment have reposted to https://lab.civicrm.org/dev/core/issues/97#note_4604

@eileenmcnaughton
Copy link
Contributor

eileenmcnaughton commented May 10, 2018

Thanks @tamarmeir - I guess with regards to 'layout changes should always be optional' - there is really a threshold issue. For example I recently merged a change that will add a block to the bottom of the 'View Recurring Contribution' form that shows the contributions associated with that recurring contribution. This is entirely additional information and it is highly consistent with what we have done elsewhere in terms of showing blocks - e.g associated contributions on membership view screen etc. To my mind that is an uncontroversial change but it IS a layout change.

The question is whether THIS change crosses the threshold of one that should be optional, given that there are tradeoffs of making it optional. If we decide this should be an optional change realistically that means 'do it in an extension' - although you suggest that it should be included in core there is extra resource involved in that which I don't believe will emerge for this particular improvement (ie. once it is an extension there will be little motivation on anyone's part to make it ship with core), so IF this is a change that people agree is an improvement without notable detriment that we want to be maintaining it makes sense to merge it. If it seems more like 'something that will be of limited interest even for those who use recurring contributions, or possibly detrimental' and / or it adds an unreasonable maintenance burden on the core team or a performance hit (I don't think it does but worth testing) it makes sense to say it should be an extension.

This PR is probably right on that threshold, as I think does address a usability issue that many have experienced and have tried to change in the past and that is currently not very well done in core, which is why I struggled to make a call on it & why we have tried to involve others.

@KarinG of course you should ask your customer - when we are trying to evaluate a change partners should definitely contact anyone that they think has a worthwhile input on it.

@JoeMurray
Copy link
Contributor

+1 to partners involving clients.
+1 to having tab just for the recurrence info.
+1 to more closely associating in UI the series of contributions with their recurring payment (hopefully using the open/close triangle icon).

@eileenmcnaughton
Copy link
Contributor

I think we should percolate discussion on this for another 7-10 days & then do an emoji poll on the PR

3 options would be a vote for, a vote against & I'm strongly opposed to this & wish to veto it

The point of the 3rd option is not for general principles but it would mean 'I really think this is a negative change from my org's pov & I can explain why'. An example of this from my point of view would be there is a change that was introduced a while back (before the 4.7 series) that is mostly unnoticeable to sites who don't care about the feature - unless they have a big database & high volume. If that came up now I would want the 'this really hurts us' vote to have more weight than a bunch of 'soft +1s'

@eileenmcnaughton
Copy link
Contributor

Just noting that I deployed this on our staging site and showed it to our Donor services Manager to get his thoughts. The performance of the change was fine (which is important for us as we have more than 1 million contributions that have been received as part of a recurring series).

The feedback was a soft minus 1 - ie. he actually preferred the scroll down over the extra click but felt it would not adversely affect Donor Services.

@eileenmcnaughton
Copy link
Contributor

As mentioned previously I think it's time for an emoji poll with the following emojis

  • thumbs up (I vote that this is an improvement that should be merged, pending code review)
  • thumbs down (I vote that this is an improvement that should not be merged and which may or may not be later available to the community via an extension)
  • sad face (I would like to veto this on the basis it will do actual and specific harm - this shouldn't be used lightly & should be accompanied by an explanation since none of the discussion to date has identified any specific harm.)

Most of the people who have provided input have commented above & should see this but @jaapjansma I think you only looped in by email.

I'll leave it for a week & then see where the votes lie - since this one is right on the border per my comments above I think this is a good enough process.

@eileenmcnaughton
Copy link
Contributor

I'm going to merge this based on where the votes fell.

I would like to see a follow up to add a count to the subtab so people don't need to click there to figure it out.

As noted previously I think this one was really right on the border of whether it should be accepted for core or not - per all the discussion - @MiyaNoctem @guanhuan can we move to a process of agreeing things in gitlab before there is a PR in future. That will involve us finalising @jusfreeman's proposal

@eileenmcnaughton eileenmcnaughton merged commit d998c61 into civicrm:master Jun 8, 2018
@guanhuan
Copy link
Contributor

@eileenmcnaughton thanks for following through this one. We will advise the team to follow the new proposed process and we will move to creating the counter on the subtab shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.