Adding ability to search tasks based on a column of a work board.
Details
Diff Detail
- Repository
- rP Phabricator
- Branch
- search-tasks-on-column
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 1222 Build 1222: [Placeholder Plan] Wait for 30 Seconds
Event Timeline
Preview:
Couple questions:
- How do I get hint text to show up in my fields like the other type-aheads? e.g. "Type a column or project name..."
- Phabricator Queries are magic that is beyond my wizardry. See inline comments.
- Also, I can't get the things I enter into my new fields to be preserved when I reload the page.
src/applications/maniphest/query/ManiphestTaskQuery.php | ||
---|---|---|
551 | This doesn't work, and I have no idea how to ask for if an edge exists in the phabricator_maniphest.edge table with a type of 43 and references this task. | |
554–558 | And this is just copy paste fail. |
How do I get hint text to show up in my fields like the other type-aheads? e.g. "Type a column or project name..."
These are "/projectsorusers/" style endpoints, see inline.
src/applications/maniphest/query/ManiphestTaskQuery.php | ||
---|---|---|
686 | Add a JOIN to the edge table here, e.g. JOIN edge column ON edge.src = task.phid AND edge.type = 43 | |
src/applications/maniphest/query/ManiphestTaskSearchEngine.php | ||
265–266 | I think things aren't sticking because these are Phids but should be PHIDs. | |
src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php | ||
77–81 | e.g., this is "type a user, project or package name". |
- Fixing join, fixing columns not sticking due to "Phids" "PHIDs" typo, adding "Type a column or project name"
- Moving the "(on board Something)" into displayname, rather than the typeahead.
Got the join working, though had some fun where "column" can't be used, I think because it has special meaning in SQL. Also you were right about the Phid/PHID error.
I have "Any column" searching working, but am still working on "all columns". I think that I need to do something similar to how the project query does an intersection and counts the projectCount. Does that sound right?
src/applications/project/storage/PhabricatorProjectColumn.php | ||
---|---|---|
54–63 | I modified the PhabricatorProjectColumn->getDisplayName() to show "ColumnName (on board Board)" so that it showed up correctly in the tokenizer. Otherwise, it's impossible to tell which board the 20 "Backlog"s are coming from. However, now that shows up everywhere else and is horribly ugly. I'm not sure how to make it show up that way only in the tokenizer. Ugliness: Without this change, this is what you get when searching: | |
src/view/form/control/AphrontFormTokenizerControl.php | ||
95 | I added a type hint, because it looked strange to have this one be empty when most the other fields had one. Should I change that? {F168174} Without the type hint: {F168178} Additionally, because I've made it so the type hinting works on the column OR the project name, I think it's beneficial to inform the user that they can type either. |
I think that I need to do something similar to how the project query does an intersection and counts the projectCount. Does that sound right?
I think this is the cleanest way to implement it, yes. I suppose you can also JOIN the table a bunch of times, one for each project, but I would guess that would end up more gross and/or less performant.
src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php | ||
---|---|---|
412 | There's no great way to fix the name thing in general. You can hard-code whatever you want here, which will fix the typeahead dropdown menu. However, it won't affect tokens that are pre-filled into the input on page load, since those will use the names of their handles. There's no reasonable way to avoid this right now. You could go find that code (AphrontTokenizerTemplateView) and do something hacky there, maybe (in render(), where renderToken() is called). |