Projects and priority inputs can be prefilled similar to how title
and description fields work.
Prefilling of projects already worked but used PHIDs instead of
more user friendly name so I changed that too.
Differential D7394
Enable prefilling of projects and priority fields in Maniphest task creation erik.fercak on Oct 25 2013, 9:47 AM. Authored by Tags None Referenced Files
Subscribers
Details
Projects and priority inputs can be prefilled similar to how title Prefilling of projects already worked but used PHIDs instead of Visit example
Diff Detail
Event TimelineComment Actions This looks good. See inline note. Pseudocode for the full-strength solution: $tokens = explode(...); $slug_map = id(new PhabricatorProjectQuery())->...->execute(); $name_map = id(new PhabricatorProjectQuery())->...->execute(); $phid_map = id(new PhabricatorProjectQuery())->...->execute(); $all_map = mpull($slug_map, null, 'getPhrictionSlug') + mpull($name_map, null, 'getName') + mpull($phid_map, null, 'getPHID'); foreach ($tokens as $token) { if (isset($all_map[$token])) { // use $all_map[$token]->getPHID() } else { // discard token } }
Comment Actions One minor inline, I'll just clean that up in the pull. Thanks!
Comment Actions Phriction slugs are stored in DB with trailing slash so you must use "qa/" instead of "qa". Comment Actions Yeah -- I think we'll clean up that "/" thing when T4021 happens, I imagine we'll just replace the idea of "PhrictionSlug" with "Slug" and drop the "/". I think it's cleaner to leave it like this for now and clean it up globally later than introduce a bunch of rtrim() / "/" gymnastics that might get overlooked. Allowing users to be addressed by PHID seems reasonable if you want to do a followup. Comment Actions Closed by commit rP1fb2f39fc0f6 (authored by @erik.fercak, committed by @epriestley). |