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

feat: Hide columns on list tasks #164

Closed
wants to merge 11 commits into from
Closed

Conversation

Dane-2pi
Copy link
Contributor

Checklist

  • I'm using the correct PHP Version (7.4 for current, 7.2 for legacy).
  • I've added comments to any new methods I've created or where else relevant.
  • I've replaced magic method usage on DbService classes with the getInstance() static method.
  • I've written any documentation for new features or where else relevant in the docs repo.

Description

Add feature to hide select columns in the listtasks partial

Changelog

  • add hide_columns param
  • add support in the template

refs: 2198
issues:

Other Information

Docs pull request:

@Dane-2pi Dane-2pi changed the title Feat: Hide columns on list tasks feat: Hide columns on list tasks Feb 15, 2022
@Dane-2pi Dane-2pi changed the base branch from master to develop February 15, 2022 00:59
@Dane-2pi Dane-2pi closed this Feb 15, 2022
Add feature to hide columns from view in listtasks partial
update to fit code standards

refs: 2198
issues:
$w->ctx("redirect", $params['redirect']);

$w->ctx("hide_filter", array_key_exists('hide_filter', $params) ? $params['hide_filter'] : false);

$w->ctx("hide_columns", array_key_exists('hide_columns', $params)? $params['hide_columns'] : false);
Copy link
Member

Choose a reason for hiding this comment

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

I would just have the one parameter "columns_to_hide" because it's existing or absence can trigger the relevant code further down.

Copy link
Contributor

Choose a reason for hiding this comment

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

There was a reason we wanted 2 variables though. We manipulate the array of columns to hide and so I figured it would be cleaner to separate concerns.

Copy link
Member

Choose a reason for hiding this comment

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

That's OK, you can send a new parameter into the ctx but it doesn't have to be a second parameter to the partial. Easy to write:
$w->ctx("hide_columns", array_key_exists("columns_to_hide", $params));
We shouldn't expose internal workings to the external interface.

$table_header = array("Title", "Created By", "Assigned To", "Group", "Type", "Priority", "Status", "Due");
$table_data = array();
if ($hide_columns)
Copy link
Member

Choose a reason for hiding this comment

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

As per my comment above, this parameter is unnecessary because we can just check the existence of "columns_to_hide" to achieve the same effect.

Copy link
Contributor

@adam-buckley adam-buckley left a comment

Choose a reason for hiding this comment

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

Please format the code as per our phpcs rules

$taskgroup = null;
if (!empty($params['task_group_id'])) {
if (!empty($params['task_group_id']))
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are all the brackets of the if statements on new lines? This doesn't match our code standard... maybe the code sniffer is configured wrong?

@Dane-2pi
Copy link
Contributor Author

@adam-buckley , is this good to be merged and closed out? Looks like we were both happy with it some time ago

@Dane-2pi
Copy link
Contributor Author

has been merged in some time ago. closing

@Dane-2pi Dane-2pi closed this Dec 13, 2023
@Dane-2pi Dane-2pi deleted the feature/SortProjectTasks branch February 6, 2024 05:39
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.

3 participants