Page MenuHomePhabricator

Support bulk editing object policies and other fields with complex UI controls
Open, WishlistPublic

Assigned To
None
Authored By
shadowhand
Mar 25 2014, 6:19 PM
Referenced Files
F134614: Screenshot_2014-03-25_13.18.15.png
Jan 19 2018, 11:03 PM
Tokens
"Mountain of Wealth" token, awarded by Kwisatz."Burninate" token, awarded by timor."Party Time" token, awarded by spawnlt."Like" token, awarded by tomekj2ee."Like" token, awarded by michaeloa.

Description

The bulk editor currently does not support adjusting object policies, so you can't use it to (for example) change the visibility of a large number of tasks.

After T10973, the bulk editor side of this is fairly easy. The UI side -- where we need to render a policy selector control dynamically in pure Javascript -- is not.

In the meantime, a possible workaround is that all modern *.edit API methods do support policy editing, so you may be able to use the API, rather than the bulk editor, to make sweeping policy changes.

The bulk editor doesn't support setting custom date field values. This is also a control problem, but this can be supported with a simple variation of the control (just a text field) until the fancy version (with the calendar picker) gets built.


Originally

The action menu in the bulk editor has no option for "Change Policy" / "Change Visibility" / etc

Screenshot_2014-03-25_13.18.15.png (191×179 px, 18 KB)

Event Timeline

shadowhand raised the priority of this task from to Needs Triage.
shadowhand updated the task description. (Show Details)
shadowhand added a project: Maniphest.
shadowhand added a subscriber: shadowhand.
epriestley added a subscriber: epriestley.

We should add "Change view policy" and "Change edit policy" actions here. I think these are straightforward.

I found the tricky part.... :) See D8677

Aside from being a bit of a corner / long tail case, implementing this is tricky business - see D8677. As such, putting to low priority and will circle back eventually.

In D8677, @epriestley mentioned a 5 line script to bulk adjust policies - any chance of this being made available and/or made part of the command line tools? I'm planning on making my phab install a bit more public, but would like to make most of the old tasks/revisions only visible within the core team.

You should be able to do something like this:

<?php

require_once 'scripts/__init_script__.php';

foreach (id(new LiskMigrationIterator(new ManiphestTask()) as $task) {
  $id = $task->getID();
  echo "Updating task {$id}...\n";

  $task->setViewPolicy(/* Policy Goes Here */);

  // uncomment this when satisfied with the script behavior, to persist changes
  // $task->save();
}

Drop that in phabricator/ and run it with php -f script.php.

To figure out what the policy value should be, set some task to the desired policy, then examine the row in the database: SELECT viewPolicy FROM phabricator_maniphest.maniphest_task WHERE id = 123456

<?php

require_once 'scripts/__init_script__.php';

foreach (id(new LiskMigrationIterator(new ManiphestTask())) as $task) {
  $id = $task->getID();
  echo "Updating task {$id}...\n";

  $task->setViewPolicy(/* Policy Goes Here */);

  // uncomment this when satisfied with the script behavior, to persist changes
  // $task->save();
}

Slight syntax correction, for the record.

btrahan added a subscriber: btrahan.
epriestley renamed this task from Maniphest batch editor does not allow bulk modification of visibility to Support bulk editing object policies.Jan 19 2018, 11:03 PM
epriestley lowered the priority of this task from Low to Wishlist.
epriestley updated the task description. (Show Details)
epriestley edited projects, added ApplicationEditor; removed Maniphest.
epriestley renamed this task from Support bulk editing object policies to Support bulk editing object policies and other fields with complex UI controls.Apr 30 2021, 3:35 PM
epriestley updated the task description. (Show Details)