1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00
Commit graph

10627 commits

Author SHA1 Message Date
epriestley
ed43b31cb1 Prevent "Spaces" field from being set to inconsistent values
Summary:
At least for now, the "Space" field is just a subfield of the "Visible To" field, so:

  - it doesn't get any separate settings; and
  - it always uses the "Visible To" settings.

Test Plan:
  - Created a form with a hidden view policy field.
  - Created stuff with no "you must pick a space" errors.
  - Created stuff with a normal form.
  - Prefilled "Space" on a noraml form.
  - Verified that trying to prefill "Space" on a form with "Visible To" hidden does nothing.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14812
2015-12-17 11:22:32 -08:00
epriestley
bd7981c750 Improve the clarity of transactions that affect policies and spaces during object creation
Summary:
Ref T10004. Fixes T9527. Currently, we render two kinds of bad policy/space transactions during object creation.

First, we render a transaction showing a change from the default policy/space to the selected policy/space:

> alice shifted this object from space S1 Default to space S2 Secret.

This is a //good transaction// (it's showing that the default was changed, which could be important for policy stuff!) but it's confusing because it makes it sound like the object briefly existed in space S1, when it did not.

Instead, render this:

> alice created this object in space S2 Secret.

This retains the value (show that the object was created in an unusual space) without the confusion.

Second, when you create a "New Bug Report", we render a transaction like this:

> alice changed the visibility of this task from "All Users" to "Community".

This is distracting and not useful, becasue it's a locked default of the form. This was essentially fixed by D14810. The new behavior is to show this, //only// if the value was changed from the form value:

> alice created this object with visibility "Administrators".

This should reduce confusion, reduce fluff in the default cases, and do a better job of calling out important changes (basically, unusual spaces/policies).

Test Plan:
  - Created an edit form with a default space and policies.
  - Used that form to create task with:
    - same values as form;
    - different values from form.

When I changed the form value, I got transactions. When I left it the same, I didn't.

The transactions rendered in the non-confusing "created with ..." variant.

Editing the values created normal transactions with "changed policy from X to Y".

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9527, T10004

Differential Revision: https://secure.phabricator.com/D14811
2015-12-17 10:45:53 -08:00
epriestley
6146aefcd4 Show fewer useless transactions when creating objects, especially with EditEngine forms
Summary:
Fixes T7661. Ref T9527.

When you create a task, especially with an EditEngine form, you currently get more noise than is useful. For example:

> alice created this task.
> alice changed the edit policy from "All Users" to "Community (Project)".
> alice added projects: Feature Request, Differential.
> alice added a subscriber: alice.

Transaction (1) is a little useful, since it saves us from a weird empty state and shows the object creation time.

Transaction (2) is totally useless (and even misleading) because that's the default policy for the form.

Transaction (3) isn't //completely// useless but isn't very interesting, and probably not worth the real-estate.

Transaction (4) is totally useless.

(These transactions are uniquely useless when creating objects -- when editing them later, they're fine.)

This adds two new rules to hide transactions:

  - Hide transactions from object creation if the old value is empty (e.g., set title, set projects, set subscribers).
  - Hide transactions from object creation if the old value is the same as the form default value (e.g., set policy to default, set priorities to default, set status to default).

NOTE: These rules also hide the "created this object" transaction, since it's really one of those transaction types in all cases. I want to keep that around in the long term, but just have it be a separate `TYPE_CREATE` action -- currently, it is this weird, inconsistent action where we pick some required field (like title) and special-case the rendering if the old value is `null`. So fixing that is a bit more involved. For now, I'm just dropping these transactions completely, but intend to restore them later.

Test Plan:
  - Created objects.
  - Usually saw no extra create transactions.
  - Saw extra create transactions when making an important change away from form defaults (e.g., overriding form policy).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7661, T9527

Differential Revision: https://secure.phabricator.com/D14810
2015-12-17 10:45:01 -08:00
epriestley
8a0dfa94d4 Make configured and EditEngine defaults work correctly for custom fields
Summary:
Ref T10004. Fixes T5158. There was a long-standing issue with defaults not working properly, but EditEngine has made it more obvious because it's a lot easier to set defaults now.

The issue is basically that the defaults are getting set as the field's real value early on, so when we go to generate the transaction "old value" later, we build a transaction that uses the //new// value as both the "new value" and "old value". Then the engine says "you didn't change anything, so I'm going to ignore this" and drops it.

To fix this, return `null` as the "old value" by default, and add a call to overwrite that after we load a legitimate old value.

This fix is a touch iffy, but I have some grand plans to clean up the CustomField stuff more broadly later on.

Test Plan:
  - Set config defaults on select/typeahead fields, created and edited tasks.
  - Set form defaults on select/typehaead fields, created and edited tasks.
  - In all cases, transactions and state accurately reflected edits.
  - Set defaults on //hidden// fields, verified forms respected them correctly.
  - This does generate some fluffy transactions, but I'll deal with those in T7661.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T5158, T10004

Differential Revision: https://secure.phabricator.com/D14809
2015-12-17 10:44:41 -08:00
epriestley
38e31375ea Improve UX for customizing EditEngine forms a little bit
Summary:
Ref T10004. Tweaks some of the UX a little to be more intuitive/inviting?

  - Button says "Configure Form" instead of "Actions".
  - Root list is less "developer-ey" and more "explain what this is for-ey".

Test Plan:
{F1028928}

{F1028929}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14808
2015-12-17 08:40:00 -08:00
epriestley
5d76a4b0a2 Improve handling of multiple edit forms when logged out
Summary:
Ref T10004. Currently, when a logged-out user visits an application like Maniphest, we show them a disabled "Create Task" button with no dropdown menu.

This is technically correct in some sense because none of the items in the menu will work, but we can be more helpful and show the items, just in a disabled state:

{F1028903}

When the user clicks these, they'll be pushed through the login flow and (after D14804) end up on the same page they were on when they selected the item. From here, they can proceed normally.

I changed "...to continue." to "...to take this action." to hopefully be a little more clear. In particular, we do not //continue// the action after you log in: you end up back on the same page you started on. For example, if you clicked "Create New Bug" from the list view, you end up back on the list view and need to click "Create New Bug" again. If you clicked "Edit Task" from some task detail page, you end up on the task detail page and have to click "Edit Task" again.

I think this behavior is always very good. I think it is often the best possible behavior: for actions like "Edit Blocking Tasks" and "Merge Duplicates In", the alternatives I can see are:

  - Send user back to task page (best?)
  - Send user to standalone page with weird dialog on it and no context (underlying problem behavior all of this is tackling, clearly not good)
  - Send user back to task page, but with dialog open (very complicated, seems kind of confusing/undesirable?)

For actions like "Create New Bug" or "Edit Task", we have slightly better options:

  - Send user back to task page (very good?)
  - Send user to edit/create page (slightly better?)

However, we have no way to tell if a Workflow "makes sense" to complete in a standalone way. That is, we can't automatically determine which workflows are like "Edit Task" and which workflows are like "Merge Duplicates In".

Even within an action, this distinction is not straightforward. For example, "Create Task" can standalone from the Maniphest list view, but should not from a Workboard. "Edit Task" can standalone from the task detail page, but should not from an "Edit" pencil action on a list or a workboard.

Since the simpler behavior is easy, very good in all cases, often the best behavior, and never (I think?) confusing or misleading, I don't plan to puruse the "bring you back to the page, with the dialog open" behavior at any point. I'm theoretically open to discussion here if you REALLY want the dialogs to pop open magically but I think it's probably a lot of work.

Test Plan: As a logged out user, clicked "Create Task". Got a dropdown showing the options available to me if I log in. Clicked one, logged in, ended up in a reasonable place (the task list page where I'd started).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14806
2015-12-17 08:30:54 -08:00
epriestley
2868a69f65 Remove all setObjectURI() from ActionListViews
Summary:
Ref T10004. After D14804, we get this behavior by default and no longer need to set it explicitly.

(If some endpoint did eventually need to set it explicitly, it could just change what it passes to `setHref()`, but I believe we currently have no such endpoints and do not foresee ever having any.)

Test Plan:
  - As a logged out user, clicked various links in Differential, Maniphest, Files, etc., always got redirected to a sensible place after login.
  - Grepped for `setObjectURI()`, `getObjectURI()` (there are a few remaining callsites, but to a different method with the same name in Doorkeeper).

Reviewers: chad

Reviewed By: chad

Subscribers: hach-que

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14805
2015-12-17 08:30:22 -08:00
epriestley
e869e7df0b When logged-out users hit a "Login Required" dialog, try to choose a better "next" URI
Summary:
Ref T10004. After a user logs in, we send them to the "next" URI cookie if there is one, but currently don't always do a very good job of selecting a "next" URI, especially if they tried to do something with a dialog before being asked to log in.

In particular, if a logged-out user clicks an action like "Edit Blocking Tasks" on a Maniphest task, the default behavior is to send them to the standalone page for that dialog after they log in. This can be pretty confusing.

See T2691 and D6416 for earlier efforts here. At that time, we added a mechanism to //manually// override the default behavior, and fixed the most common links. This worked, but I'd like to fix the //default// beahvior so we don't need to remember to `setObjectURI()` correctly all over the place.

ApplicationEditor has also introduced new cases which are more difficult to get right. While we could get them right by using the override and being careful about things, this also motivates fixing the default behavior.

Finally, we have better tools for fixing the default behavior now than we did in 2013.

Instead of using manual overrides, have JS include an "X-Phabricator-Via" header in Ajax requests. This is basically like a referrer header, and will contain the page the user's browser is on.

In essentially every case, this should be a very good place (and often the best place) to send them after login. For all pages currently using `setObjectURI()`, it should produce the same behavior by default.

I'll remove the `setObjectURI()` mechanism in the next diff.

Test Plan: Clicked various workflow actions while logged out, saw "next" get set to a reasonable value, was redirected to a sensible, non-confusing page after login (the page with whatever button I clicked on it).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14804
2015-12-17 08:30:03 -08:00
epriestley
a5d23c9f3e Allow custom fields to be ordered ascending or descending
Summary:
Fixes T6864. This creates a sort of busy menu but I think that's proably fine -- users are opting into activating these fields for search anyway.

In the future, we could refine this as, e.g.:

  - don't show these options in the dropdown;
  - do show them on some new "http prefilling" sort of page;
  - then you access them as an advanced user with `?order=secret-magic`.

But I'm not going to bother for now.

Test Plan: Ordered by an int field, then reversed the order.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6864

Differential Revision: https://secure.phabricator.com/D14800
2015-12-16 12:59:22 -08:00
Chad Little
36bfff3898 Give PhameBlog an EditEngine
Summary: This seems to work, but I couldn't figure out how to pass over a Caption for a text field.

Test Plan: New blog, Edit blog.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14770
2015-12-16 11:56:53 -08:00
epriestley
5e182180a9 Provide a "PHUIFormIconSetControl"
Summary:
Ref T9992. This is a step on the path to getting EditEngine working in Badges, Projects and Calendar.

This doesn't add a new `EditField` for icons yet, just standardizes the old stuff. New stuff is more general and I saved 150 lines of code.

I put the endpoint in Files because the similar "choose a profile picture" endpoint will definitely go there, and this endpoint might eventually feature, like, "draw your own icon~~" or something.

Test Plan:
  - Created events, projects and badges with custom icons.
  - Edited events, projects and badges, changing their icons.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9992

Differential Revision: https://secure.phabricator.com/D14799
2015-12-16 08:46:51 -08:00
epriestley
57cc30d0c4 Continue hammering new *.search / *.edit documentation into shape
Summary: Ref T9964. Create some docuemntation for this stuff, and clean up the *.edit endpoints a bit.

Test Plan: Read documentation.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14798
2015-12-16 08:46:05 -08:00
epriestley
161ebad56d Improve Conduit type handling for *.edit endpoints
Summary:
Ref T9964. Three goals here:

  - Make it easier to supply Conduit documentation.
  - Make automatic documentation for `*.edit` endpoints more complete, particularly for custom fields.
  - Allow type resolution via Conduit types, so you can pass `["alincoln"]` to "subscribers" instead of needing to use PHIDs.

Test Plan:
  - Viewed and used all search and edit endpoints, including custom fields.
  - Used parameter type resolution to set subscribers to user "dog" instead of "PHID-USER-whatever".
  - Viewed HTTP parameter documentation.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14796
2015-12-16 08:45:46 -08:00
epriestley
1d72c97fc9 Fix overzealous subscribing in EditEngine
Summary:
See T9905#148799. The CommentEditField generated empty comment transactions; these are dropped later, but before they are dropped they would trigger implicit CCs.

The implicit CC rule should probably be narrower, but we shouldn't be generating these transactions in the first place.

Test Plan: No longer implicitly CC'd on a task when doing something minor like changing projects.

Reviewers: chad

Reviewed By: chad

Subscribers: avivey

Differential Revision: https://secure.phabricator.com/D14795
2015-12-15 16:17:26 -08:00
epriestley
4b3dcd5500 Add some documentation about how to set paths with owners.edit
Summary:
Ref T9964.

  - New mechanism for rich documentation on unusual/complicated edits.
  - Add some docs to `paths.set` since it's not self-evident what you're supposed to pass in.

Test Plan: {F1027177}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14791
2015-12-15 15:04:16 -08:00
epriestley
b0a5eee238 Support editing statuses and paths in Owners via Conduit API
Summary: Ref T9964. Fixes T9752. Provides API access to enable/disable packages and change their paths.

Test Plan:
  - Changed status via Conduit.
  - Changed paths via Conduit.
  - Tried to change a path use a nonsense/bogus repository PHID, got an error.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9752, T9964

Differential Revision: https://secure.phabricator.com/D14790
2015-12-15 15:04:00 -08:00
epriestley
d7693a93b3 Provide "Change Projects" and "Change Subscribers" (instead of "Add ...") in comment actions
Summary:
Ref T9908. Fixes T6205.

This is largely some refactoring to improve the code. The new structure is:

  - Each EditField has zero or one "submit" (normal edit form) controls.
  - Each EditField has zero or one "comment" (stacked actions) controls.
    - If we want more than one in the future, we'd just add two fields.
  - Each EditField can have multiple EditTypes which provide Conduit transactions.
  - EditTypes are now lower-level and less involved on the Submit/Comment pathways.

Test Plan:
  - Added and removed projects and subscribers.
  - Changed task statuses.
  - In two windows: added some subscribers in one, removed different ones in the other. The changes did not conflict.
  - Applied changes via Conduit.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6205, T9908

Differential Revision: https://secure.phabricator.com/D14789
2015-12-15 15:03:34 -08:00
epriestley
6c4c93a091 Allow login to be disabled for authentication providers
Summary:
Fixes T9997. This was in the database since v0, I just never hooked up the UI since it wasn't previously meaningful.

However, it now makes sense to have a provider like Asana with login disabled and use it only for integrations.

Test Plan: Disabled login on a provider, verified it was no longer available for login/registration but still linkable.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9997

Differential Revision: https://secure.phabricator.com/D14794
2015-12-15 15:03:06 -08:00
epriestley
2d588715bc Always automatically generate Phame slugs
Summary:
Fixes T9995. I think letting users customize slugs is not a hugely compelling as a product feature, and this fixes the issue with slugs that have "/" characters in them and makes the move to EditEngine easier since I don't have to deal with the weird JS thing.

Instead, just generate slugs automatically. No more JS, no more separate field, things automatically update if you rename a blog, and now that URIs have IDs in them the old URI will still work after a rename.

Test Plan:
  - Applied migration.
  - Created new posts.
  - Edited existing posts.
  - Visited various posts.
  - Created a post with a bunch of "/" in the title, things still worked fine.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9995

Differential Revision: https://secure.phabricator.com/D14792
2015-12-15 14:18:56 -08:00
epriestley
a8b402aa14 Allow pastes to be activated/archived via Conduit
Summary: Ref T9964. Add a `setIsConduitOnly()` method so we can mark a field as API-only.

Test Plan:
  - Created and edited pastes via web UI (no status field).
  - Adjusted status via web UI action.
  - Adjusted status via Conduit API.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14788
2015-12-15 06:46:05 -08:00
epriestley
ab748e522a Fix an issue with the Spaces EditField not reading values properly
Summary: Fixes T9988. This logic got inverted by accident at some point.

Test Plan:
  - Edited a task, shifting spaces.
  - Created a task in default space.
  - Created a task in custom space.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9988

Differential Revision: https://secure.phabricator.com/D14787
2015-12-15 06:45:54 -08:00
epriestley
39206fcbc6 Fix a bad method call in EditEngine
Summary: Ref T9983. This method is spelled wrong.

Test Plan: Hit this case, got a dialog instead of a fatal.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9983

Differential Revision: https://secure.phabricator.com/D14786
2015-12-14 17:04:35 -08:00
epriestley
29e2acd525 Have "limit=1" tokenizers replace tokens instead of disabling "Browse"
Summary:
Fixes T9984. When a tokenizer only allows one selection (like "Task Owner:" or "Land Onto Branch:"), keep the browse button active but have it //replace// values.

Also, have "Create Subtask" default to the system default status, so subtasks of closed tasks are not also closed.

Test Plan:
  - Browsed an empty limit=1 tokenizer.
  - Replaced a full limit=1 tokenizer.
  - Browsed an empty no-limit tokenizer.
  - Browsed more tokens into the no-limit tokenizer.
  - Typed some tokens normally.
  - Created a subtask of a closed task.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9984

Differential Revision: https://secure.phabricator.com/D14785
2015-12-14 15:29:42 -08:00
epriestley
c19654db16 Write some basic "dealing with Conduit changes" documentation
Summary:
Ref T9980. No magic here, just write a little bit about how to find outdated callers. Update the technical doc.

Also:

  - Fix an unrelated bug where you couldn't leave comments if an object had missing, required, custom fields.
  - Restore the ConduitConnectionLog table so `bin/storage adjust` doesn't complain.

Test Plan: Read docs.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9980

Differential Revision: https://secure.phabricator.com/D14784
2015-12-14 15:26:24 -08:00
epriestley
81ae9f8fb6 Clean up an issue with meta-editing of edit engines
Summary:
Ref T9908. These meta-edit-engines are used to generate the main editengine UIs, but they're also editable.

Fix an exception when trying to edit the meta editengine.

Test Plan: Edited editengineconfiguration editengine.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14783
2015-12-14 15:26:03 -08:00
epriestley
2805ba6f42 Add by-caller lookup to call logs, plus viewer calls
Summary:
Ref T9980. By default, show the viewer //their// calls.

Make it easy to find their own deprecated calls.

I don't like the word "My" but couldn't come up with anything better that didn't feel like a big loss of clarity.

The permissions on this log are also a little weird: non-admins can see everyone else's calls.

I think we should eventually lock that down, but plan to keep it this way for now:

First, a lot of your calls end up with no caller set right now, because we don't set the caller early enough in the process so a lot differnet types of errors can leave us with no user on the log. Fixing that isn't trivial, and users may reasonably want to access to these "no caller" logs to check for errors or debug stuff.

Second, none of it is really that sensitive?

Third, it's reasonable for users to want to look at bots?

I'd plan to maybe do this eventually:

  - Make the caller get populated more often after auth code is simplified.
  - Only let users look at their calls and maybe bot calls and anonymous calls.
  - Let admins look at everything.

But for now everyone can see everything.

Test Plan: {F1025867}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9980

Differential Revision: https://secure.phabricator.com/D14782
2015-12-14 15:25:49 -08:00
epriestley
6580bbdf39 Make it easy to find deprecated calls in the Conduit call log
Summary: Ref T9980. This makes it much easier to look for calls to deprecated methods.

Test Plan: {F1025851}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9980

Differential Revision: https://secure.phabricator.com/D14781
2015-12-14 15:25:28 -08:00
epriestley
0692115953 Remove all references to the Conduit ConnectionLog
Summary:
Ref T5955, T9980, T9982.

We currently store two types of Conduit logs: //connection// logs and //method// logs.

Originally, Conduit worked like web logins: you'd call `conduit.connect` and then get a session back. This approach still works, but new clients don't use it and it will probably stop working eventually after T5955 is further along.

There was no real reason for things to work like this and no other API in the world does, I think it was just slightly easier to implement back in 2011.

This table was used to group up related calls in a UI long ago, I think, but that got deleted at some point. In any case, it serves no purpose in modern Phabricator.

Test Plan: `grep`

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T5955, T9980, T9982

Differential Revision: https://secure.phabricator.com/D14780
2015-12-14 15:25:11 -08:00
epriestley
4a147dcbfb Move ConduitLogs to ApplicationSearch
Summary:
Ref T9980. Start making this UI more useful and powerful so we can give administrators a better toolset for reacting to API changes.

Fixes T9755. We were logging the caller, just not rendering it properly.

Test Plan: {F1025799}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9755, T9980

Differential Revision: https://secure.phabricator.com/D14779
2015-12-14 14:45:08 -08:00
epriestley
00bd824781 Remove the "deprecated calls in the last 30 days" setup warning
Summary: Ref T9980. I don't think this is actually useful, and plan to give users and administrators more powerful tools instead.

Test Plan: Loaded setup warnings.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9980

Differential Revision: https://secure.phabricator.com/D14778
2015-12-14 14:41:43 -08:00
epriestley
eb8835b15e Provide more API information about Maniphest task statuses and priorities
Summary: Ref T9964. Priorities and statuses have metadata (colors, names, etc) which we can reasonably just return from API callers. This is so ligthweight that I think it doesn't really make sense to put in an attachment. We also use this information in `arc tasks`.

Test Plan: Called API, got sensible looking status and priority data back.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14777
2015-12-14 11:54:48 -08:00
epriestley
0a50219f1b Formalize custom Conduit fields on objects
Summary: Ref T9964. This just adds more structure to application fields, to make it harder to make typos and easier to validate them later.

Test Plan: Viewed APIs, called some APIs, saw good documentation and correct results.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14776
2015-12-14 11:54:13 -08:00
epriestley
10cdc55cf7 Give "owners.search" a "paths" attachment and a default "owners" value
Summary:
Ref T9964.

  - Add a "paths" attachment for fetching paths.
  - Always load owners. We will need this to do policy checks in the future, anyway, and this data is not large, is very useful, and is reasonable to load unconditionally.

Test Plan:
  - Queried packages via API.
  - Edited packages (paths, owners).
  - Created a package.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14775
2015-12-14 11:53:50 -08:00
epriestley
3db175f79d Add a "content" attachment for Pastes for Conduit API
Summary: Ref T9964. Builds on D14772. Allows callers to get the raw content of pastes as an attachment.

Test Plan:
  - Read docs.
  - Executed attachment query.
  - Saw raw paste content.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14774
2015-12-14 11:53:32 -08:00
epriestley
c0e20a11c1 Add a "projects" Search attachment for Conduit APIs
Summary: Ref T9964. Builds on D14772. Allows callers to request project PHIDs for objects.

Test Plan: {F1025468}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14773
2015-12-14 11:53:17 -08:00
epriestley
2160c45619 Implement an "Attachments" behavior for Conduit Search APIs
Summary:
Ref T9964. We have various kinds of secondary data on objects (like subscribers, projects, paste content, Owners paths, file attachments, etc) which is somewhat slow, or somewhat large, or both.

Some approaches to handling this in the API include:

  - Always return all of it (very easy, but slow).
  - Require users to make separate API calls to get each piece of data (very simple, but inefficient and really cumbersome to use).
  - Implement a hierarchical query language like GraphQL (powerful, but very complex).
  - Kind of mix-and-match a half-power query language and some extra calls? (fairly simple, not too terrible?)

We currently mix-and-match internally, with `->needStuff(true)`. This is not a general-purpose, full-power graph query language like GraphQL, and it occasionally does limit us.

For example, there is no way to do this sort of thing:

  $conpherence_thread_query = id(new ConpherenceThreadQuery())
    ->setViewer($viewer)
    // ...
    ->setNeedMessages(true)
    ->setWhenYouLoadTheMessagesTheyNeedProfilePictures(true);

However, we almost never actually need to do this and when we do want to do it we usually don't //really// want to do it, so I don't think this is a major limit to the practical power of the system for the kinds of things we really want to do with it.

Put another way, we have a lot of 1-level hierarchical queries (get pictures or repositories or projects or files or content for these objects) but few-to-no 2+ level queries (get files for these objects, then get all the projects for those files).

So even though 1-level hierarchies are not a beautiful, general-purpose, fully-abstract system, they've worked well so far in practice and I'm comfortable moving forward with them in the API.

If we do need N-level queries in the future, there is no technical reason we can't put GraphQL (or something similar) on top of this eventually, and this would represent a solid step toward that. However, I suspect we'll never need them.

Upshot: I'm pretty happy with "->needX()" for all practical purposes, so this is just adding a way to say "->needX()" to the API.

Specifically, you say:

```
{
  "attachments": {
    "subscribers": true,
  }
}
```

...and get back subscriber data. In the future (or for certain attachments), `true` might become a dictionary of extra parameters, if necessary, and could do so without breaking the API.

Test Plan:
- Ran queries to get attachments.

{F1025449}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14772
2015-12-14 11:53:00 -08:00
epriestley
8ec413b972 Clean up "ids" and "phids" handling in SearchEngines
Summary:
Ref T9964. I added several hacks to get these working. Clean them up and pull this into a proper extension.

The behavior in the web UI is:

  - they work in all applications; but
  - they only show up in the UI if a value is specified.

So if you visit `/view/?ids=1,2` you get the field, but normally it's not present. We could refine this later. I'm going to add documentation about how to prefill these forms regardless, which should make this discoverable by reading the documentation.

There's one teensey weensey hack: in the API, I push these fields to the top of the table. That one feels OK, since it's purely a convenience/display adjustment.

Test Plan: Queried by IDs, reviewed docs.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14769
2015-12-14 04:24:54 -08:00
epriestley
fdd2d802d2 Clean up "*.search" API method documentation pages
Summary:
Ref T9964. Building tables in Remarkup is kind of neat-ish but ends up feeling kind of hacky, and requires weird workarounds if any of the values have `|` in them.

Switch to normal elements instead.

Also move the magic "ids" and "phids" to be more like real fields. I'll clean this up fully in a diff or two, it's just a little tricky because Maniphest has an "ids" field.

Test Plan: {F1024294}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14768
2015-12-14 04:24:39 -08:00
epriestley
99ade500bc Flesh out Conduit parmeter types for maniphest.search
Summary: Ref T9964. I left a couple of these unsupported for now since they're weird in some way.

Test Plan: {F1024031}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14767
2015-12-14 04:24:01 -08:00
epriestley
663dce5029 Flesh out Conduit parameter types for Owners + CustomFields
Summary:
Ref T9964. Fill in more parameter types and descriptions.

(No date support yet since it's a bit more involved.)

Test Plan: {F1024022}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14766
2015-12-14 04:23:44 -08:00
epriestley
0282ce74ab Flesh out Conduit types for Paste search fields
Summary: Ref T9964. This fills in types and descriptions for ApplicationSearch fields in Paste.

Test Plan:
Got this nice table now:

{F1023999}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14765
2015-12-14 04:23:28 -08:00
epriestley
1b325a0a89 Modularize SearchEngine extensions
Summary:
Ref T9964. ApplicationSearch currently has a bunch of hard-coded `if ($object instanceof thing)` stuff.

Pull that out so it can live in extensions.

Test Plan:
 - Searched by spaces, subscribers, projects.

{F1023921}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14764
2015-12-14 04:23:02 -08:00
epriestley
05a798e3ac Add basic typechecking support to Conduit
Summary:
Ref T9964. I want to show users what we're expecting in "constraints", and let constraints like "authors=epriestley" work to make things easier.

I'm generally very happy with the "HTTPParameterType" stuff from EditEngine, so add a parallel set of "ConduitParameterType" classes. These are a little simpler than the HTTP ones, but have a little more validation logic.

Test Plan:
This is really just a proof of concept; some of these fields are now filled in:

{F1023845}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14763
2015-12-14 04:21:39 -08:00
epriestley
d1a1d48001 Give ConduitAPIMethod->getMethodDescription() access to a real Viewer
Summary:
Ref T9964. The new `*.search` and `*.edit` methods generate documentation which depends on the viewer.

For example, the `*.search` methods show a reference table of the keys for all your saved queries.

Give them a real viewer to work with.

During normal execution, just populate this viewer with the request's viewer, so `$request->getViewer()` and `$this->getViewer()` both work and mean the same thing.

Test Plan: {F1023780}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14761
2015-12-14 04:20:11 -08:00
epriestley
f3b57990bf Add "maniphest.search" Conduit API endpoint
Summary: Ref T9964. This is a basic implementation of the new "maniphest.search" endpoint.

Test Plan: Clicked the button in the web UI, got meaningful results back.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14760
2015-12-14 04:08:57 -08:00
epriestley
9499987cfe Add "owners.search" Conduit API endpoint, with CustomField support
Summary:
Ref T9964. Adds a new-style "owners.search" endpoint, and an extension for customfields.

Puts enough indirection in place to give us nice, consistent "custom.key" user-facing keys instead of "std:custom:owners:na0shf9a8dfdsafl" junk.

Test Plan:
  - Searched Owners via API.
  - Searched by ID.
  - Ordered by custom fields.
  - Reviewed API docs.
  - Used normal search with ordering.
  - Viewed custom field values in search results.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

Differential Revision: https://secure.phabricator.com/D14758
2015-12-13 02:11:59 -08:00
Chad Little
32a7674c22 Add Drafts to PhameHome
Summary: Adds a list of your drafts. Fixes T9927y

Test Plan:
Load up home, see my drafts. Fake 0 drafts, see fallback message.

{F1023139}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14756
2015-12-12 13:26:18 -08:00
epriestley
3d14b76f4d Fix double feed stories in Phame
Summary:
Ref T9360. Fixes the double-rendering of post bodies in feed stories.

Downside is that 'publish' (on its own) no longer shows a body, but that seems fine.

Test Plan:
  - Got some double bodies.
  - Applied patch.
  - No more double bodies.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9360

Differential Revision: https://secure.phabricator.com/D14748
2015-12-11 20:12:25 -08:00
epriestley
4b77bbd60c Clarify that the "Add Comment" button might not literally add a comment if you haven't typed a comment
Summary: Ref T9908.

Test Plan: Careful reading.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14746
2015-12-11 17:39:39 -08:00
epriestley
dbdd702702 404 older-style Phame URIs properly
Summary: Ref T9968. Some of the crumb/route handling wasn't quite tight enough and could hit a fatal.

Test Plan: Hit previously-fataling URI, got a 404 instead.

Reviewers: chad

Reviewed By: chad

Subscribers: starruler

Maniphest Tasks: T9968

Differential Revision: https://secure.phabricator.com/D14747
2015-12-11 17:32:52 -08:00
Chad Little
efb6bb3dcf Add "Blogs" section to PhameHome
Summary: Ref T9927. Adds a "Blogs" section to PhameHome. Removes "New Post" Controller. Adds flipped layout for PHUITwoColumnView

Test Plan:
Test PhameHome, Ponder, New Post, etc. Mobile and Desktop states.

{F1022080}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: johnny-bit, Korvin

Maniphest Tasks: T9927

Differential Revision: https://secure.phabricator.com/D14744
2015-12-12 01:23:09 +00:00
epriestley
7b99735946 Throw CommandException instead of Exception after git fetch failure in repository updates
Summary: Fixes T9966. In this unusual, difficult-to-reach case, we throw `Exception` (which has no censoring) instead of `CommandException` (which has censoring). Throw `CommandException` instead.

Test Plan:
  - Hacked up a bunch of stuff in order to hit this: disabled origin validation, origin correction, and pointed repository at a bad domain.
  - Verified message is now censored correctly.

{F1022217}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9966

Differential Revision: https://secure.phabricator.com/D14745
2015-12-11 16:53:29 -08:00
epriestley
4ec6990ca7 Implement a rough initial version of ApplicationSearch-driven Conduit read endpoints
Summary:
Ref T9964. See that task for some context and discussion.

Ref T7715, which has the bigger picture here.

Basically, I want Conduit read endpoints to be full-power, ApplicationSearch-driven endpoints, so that applications can:

  - Write one EditEngine and get web + conduit writes for free.
  - Write one SearchEngine and get web + conduit reads for free.

I previously made some steps toward this, but this puts more of the structure in place.

Test Plan:
Viewed API console endpoint and read 20 pages of docs:

{F1021961}

Made various calls: with query keys, constraints, pagination, and limits.

Viewed new {nav Config > Modules} page.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7715, T9964

Differential Revision: https://secure.phabricator.com/D14743
2015-12-11 15:27:06 -08:00
epriestley
ab7d3caa00 Allow Phurl short aliases to accept trailing / characters
Summary: Fixes T9963.

Test Plan: Visited `/u/x/` and `/u/x`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9963

Differential Revision: https://secure.phabricator.com/D14742
2015-12-11 10:28:19 -08:00
epriestley
20d2652d03 Mark external -> external redirects in Phame to canonicalize URIs as "external"
Summary: Ref T9897. If you visit `/post/123/spoderman/` it will try to redirect you to `/post/123/spiderman/`, but currently only internal views work because these redirects aren't marked as safe/external.

Test Plan: Visited a misspelled/out-of-date URI on an external blog view, got a good redirect.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14741
2015-12-11 08:35:37 -08:00
epriestley
9e78f33847 Also update the resource map
This is not my morning.

Auditors: chad
2015-12-11 08:23:39 -08:00
epriestley
dc79d9ea84 Put back "PhabricatorResourceSite"
Auditors: chad
2015-12-11 08:22:16 -08:00
epriestley
8a906b0e18 Remove skins from Phame
Summary:
Ref T9897. Purge a bunch of stuff:

  - Remove skins.
  - Remove all custom sites for skin resources.
  - Remove "framed", "notlive", "preview", separate "live" controllers (see below).
  - Merge "publish" and "unpublish" controllers into one.

New behavior:

  - Blogs and posts have three views:
    - "View": Internal view URI, which is a normal detail page.
    - "Internal Live": Internal view URI which is a little prettier.
    - "External Live": External view URI for an external domain.

Right now, the differences are pretty minor (basically, different crumbs/chrome). This mostly gives us room to put some milder flavor of skins back later (photography or more "presentation" elements, for example).

This removes 9 million lines of code so I probably missed a couple of things, but I think it's like 95% of the way there.

Test Plan:
Here are some examples of what the "view", "internal" and "external" views look like for blogs (posts are similar):

"View": Unchanged

{F1021634}

"Internal": No chrome or footer. Still write actions (edit, post commments). Has crumbs to get back into Phame.

{F1021635}

"External": No chrome or footer. No write actions. No Phabricator crumbs. No policy/status information.

{F1021638}

I figure we'll probably tweak these a bit to figure out what makes sense (like: maybe no actions on "internal, live"? and "external, live" probably needs a way to set a root "Company >" crumb?) but that they're reasonable-ish as a first cut?

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14740
2015-12-11 08:14:12 -08:00
epriestley
c62e0a10f6 Clarify that ApplicationEditor supports editing itself
Summary: edit forms in yo' edit forms

Test Plan: ~(o.o)~

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14739
2015-12-10 19:19:20 -08:00
epriestley
954cd4b1b6 When arc has sent target branch data up after D14736, use it in the UI and "Land Revision"
Summary:
Ref T9952. Ref T3462. After D14736, if we have information about the target/"onto" branch, use it in the UI:

  - Show "feature (branched from master)" instead of "feature".
  - Default "Land Revision" to hit the correct branch.

Test Plan:
  - Branched from `test` with branch tracking.
  - Diffed.
  - Saw "feature (branched from test)" in UI.
  - Saw "test" fill as default in "Land Revision", despite the repository having a different default branch.

{F1020587}

{F1020588}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T3462, T9952

Differential Revision: https://secure.phabricator.com/D14737
2015-12-10 15:24:38 -08:00
epriestley
f60548d081 Default "Land Revision" dialog to land into the default branch for the repository
Summary:
Ref T9952. Default the branch target in the dialog to be whatever branch is the default branch for the repository.

This will be correct for repositories like ours (which land everything into `master`) and correct most of the time for repositories which have some other "primary" branch (maybe `development`).

It won't be great if there are multiple open lines of development in a repository (for example, some changes go to `newdesignpro` and some changes go to `legacy-1.2`). I'll do work in T3462 next to improve those cases so we can pick a better default.

Test Plan:
  - Saw dialog default to "master".
  - Changed repo default branch, saw it default to "notmaster" instead.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9952

Differential Revision: https://secure.phabricator.com/D14734
2015-12-10 14:21:59 -08:00
epriestley
856bdaf77e Add an "Onto Branch" selector control to "Land Revision" dialog
Summary:
Ref T9952. This adds a typeahead so you can pick a branch to target.

It does not choose a default branch, the user must pick a branch explicitly.

Test Plan:
  - Landed rGITTESTd587fada48fc to `master` (by typing "master").
  - Landed rGITTEST86c339b2ef01 to `notmaster` (by typing "notmaster").

{F1020531}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9952

Differential Revision: https://secure.phabricator.com/D14733
2015-12-10 14:21:38 -08:00
epriestley
8dcdc7534d Add a DiffusionRefDatasource for typeahead'ing branches, tags, bookmarks and refs
Summary: Ref T9952. This will let me put a "Branch: [____]" control on the "Land Revision" dialog so users can choose a branch to target.

Test Plan: Used `/typeahead/class/` to vet basic behavior.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9952

Differential Revision: https://secure.phabricator.com/D14732
2015-12-10 14:21:24 -08:00
epriestley
2a203fbab1 Add proper PHIDs to RefCursors
Summary: Ref T9952. See discussion there. This change is primarily aimed at letting me build a typeahead of branches in a repository so that we can land to arbitrary branches a few diffs from now.

Test Plan:
  - Ran migrations.
  - Verified database populated properly with PHIDs (`SELECT * FROM repository_refcursor;`).
  - Ran `bin/repository update`.
  - Viewed a Git repository in Diffusion.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9952

Differential Revision: https://secure.phabricator.com/D14731
2015-12-10 14:21:08 -08:00
Chad Little
6985643f58 Filter archived Badges from UI
Summary: If you archive a badge, remove it's presence in the main Phabricator UI. These are still accessible from `/badges/` for properity. Ref T9944

Test Plan: Archive a badge, weep uncontrollably.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9944

Differential Revision: https://secure.phabricator.com/D14730
2015-12-10 10:49:42 -08:00
epriestley
7c98cd85fe Implement DestructibleInterface for Owners Packages
Summary:
Fixes T9945. This is straightforward.

The two sub-object types are very lightweight so I just deleted them directly instead of loading + delete()'ing (or implementing DestructibleInterface on them, which would require they have PHIDs).

Also improve a US English localization.

Test Plan:
  - Used `bin/remove destroy PHID-... --trace` to destroy a package.
  - Verified it was gone.
  - Inspected the SQL in the log for general reasonableness.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9945

Differential Revision: https://secure.phabricator.com/D14729
2015-12-10 07:04:06 -08:00
Chad Little
90c4880aaa Add PhabricatorOwnersArchiveController
Summary: Ability to Archive and Activate Packages from the view page. Ref T9414

Test Plan: New Package, Edit Package, Archive Package, Activate Package

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9414

Differential Revision: https://secure.phabricator.com/D14728
2015-12-09 13:56:00 -08:00
Chad Little
dec69e21b3 Add PhabricatorBadgeArchiveController
Summary: Allows archive and activate on badges from action list. Ref T9414

Test Plan: Archive, Activate, New, Edit

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9414

Differential Revision: https://secure.phabricator.com/D14727
2015-12-09 13:29:03 -08:00
Chad Little
192a11bfdc Add PholioMockArchiveController
Summary: Allows closing a mock from the action list. Ref T9414

Test Plan: New Mock, Edit Mock, Close Mock, Open Mock

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9414

Differential Revision: https://secure.phabricator.com/D14726
2015-12-09 13:20:25 -08:00
Chad Little
2e6c69e07e Add DashboardArchiveController
Summary: So Fancy, Much JavaScript. Ref T9414

Test Plan: Archive a Dashboard, Activate a Dashboard, Edit a Dashboard

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9414

Differential Revision: https://secure.phabricator.com/D14725
2015-12-09 12:29:59 -08:00
Chad Little
02cd235b3d Add PasteArchiveController
Summary: Makes this more consistent. Also clean up spacing. Ref T9414

Test Plan: Archive/Activate Paste, Edit Paste

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9414

Differential Revision: https://secure.phabricator.com/D14724
2015-12-09 11:56:14 -08:00
Chad Little
23bb1eeec0 Minor tweaks to PhamePostView
Summary: Better Icon? Text? Ref T9897

Test Plan: see new icon and text

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14723
2015-12-09 11:26:15 -08:00
epriestley
d57cc740ca Clean up some custom field strings in Feed
Summary: Fixes T9919. We were missing feed strings and US English localizations for some of this stuff.

Test Plan:
Before:

{F1018877}

After:

{F1018879}
{F1018880}
{F1018881}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9919

Differential Revision: https://secure.phabricator.com/D14721
2015-12-09 09:04:12 -08:00
epriestley
b4681aa0c8 Remove dead link to Perforce blog about Git Fusion
Summary: Fixes T9941. I think someone from Perforce emailed us about 10 years ago and I added this link in response, but I haven't seen other interest in Perforce since then. Link is now dead.

Test Plan:
  - {nav Diffusion > Create Repository > Import Existing}, no more Perforce link.
  - Grepped for `perforce`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9941

Differential Revision: https://secure.phabricator.com/D14720
2015-12-09 08:51:25 -08:00
epriestley
42ef21f8fa Document how to customize forms in ApplicationEditor
Summary:
Ref T9132. I think the featureset is approximatley stable, so here's some documentation.

I also cleaned up a handful of things in the UI and tried to make them more obvious or more consistent.

Test Plan: Read documentation.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14718
2015-12-09 07:30:23 -08:00
epriestley
fb3c18349e Remove WILLEDITTASK and DIDEDITTASK events
Summary: Fixes T9851. I'll hold this for a while to give users some time to update per T9860.

Test Plan:
Edited a task via:

  - Conduit
  - Comments field
  - Edit form
  - New task form

Reviewers: chad

Reviewed By: chad

Subscribers: Krenair

Maniphest Tasks: T9851

Differential Revision: https://secure.phabricator.com/D14576
2015-12-09 07:03:15 -08:00
epriestley
5d5fd9e241 Explain why older changes are hidden more clearly
Summary:
Fixes T9920. When hiding changes, tell users why so they can learn the comment rule (usually, "Changes from before your most recent comment are hidden."; sometimes they're hidden for pagination reasons).

Also use "Show Older Comments" instead of "Show older comments." for the action since I think it's a little more consistent to use title case for links/actions?

Test Plan:
  - Viewed a task with a lot of comments, saw a "most recent comment" element.
  - Artificially set page size to 3, saw a "lots of changes" hide.
  - Grepped for removed string.
  - Clicked both "show older stuff" links.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9920

Differential Revision: https://secure.phabricator.com/D14719
2015-12-09 06:59:41 -08:00
epriestley
2677380d0c Also fix the Maniphest internal EditEngine route
See D14717.
2015-12-09 02:13:36 -08:00
epriestley
7d0aaf5add Fix the Maniphest edit form route
Didn't get this quite right in D14717.
2015-12-09 02:04:53 -08:00
epriestley
b3fbf883e0 Drop "-pro" suffix and "editpro" URIs for EditEngine in Maniphest
Summary: Ref T9908. Move all the "pro" stuff into the old locations.

Test Plan: Created/edited tasks, looked at URIs, saw non-pro ones. Grepped for `editpro`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14717
2015-12-08 17:56:59 -08:00
epriestley
bce83bf844 Delete old Maniphest edit controller
Summary:
Ref T9908. No more callsites. Also:

  - Phurl a couple of documentation URIs.
  - Get rid of "task:" in the global search since it doesn't really make sense anymore.

Test Plan: `grep`, edited/created tasks.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14716
2015-12-08 17:56:31 -08:00
epriestley
eef2572508 Replace workboard task creation with EditEngine
Summary: Ref T9908. This is the last of the things that need to swap over.

Test Plan:
  - Created tasks from a workboard.
  - Created tasks in different columns.
  - Edited tasks.
  - Used `?parent=..`.
  - Verified that default edit form config now affects comment actions.
  - No more weird comment thing on forms, at least for now.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14715
2015-12-08 17:56:11 -08:00
epriestley
a13ef20a0c Move workboard card edits to EditEngine in Maniphest
Summary: Ref T9908. This drives workboard card edits through the new stuff. Bit of copy-paste but the old one will get deleted soon.

Test Plan:
  - Edited some cards.
  - Changed priority on a priority-sorted board, saw proper re-sort
  - Removed board project, saw card vanish properly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14712
2015-12-08 17:55:55 -08:00
epriestley
21be67e87a Move inline edit from task lists to EditEngine
Summary: Ref T9908. Fixes T8903. This moves the inline edit from task lists (but not from workboards) over to editengine.

Test Plan:
  - Edited a task from a draggable list.
  - Edited a task from an undraggable list.
  - Edited a task, changed projects, saw refresh show correct projects.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8903, T9908

Differential Revision: https://secure.phabricator.com/D14711
2015-12-08 15:29:11 -08:00
Chad Little
d3452967e0 Remove phame.skins config option
Summary: Removes an unneeded config. Ref T9897

Test Plan: New Blog, View Blog live.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14714
2015-12-08 15:17:12 -08:00
Chad Little
dafdd39ba9 Clean up URIs in Phame
Summary: Normalize "getViewURI" and "getLiveURI" for PhameBlog and PhamePost. Use pretty URIs in PhamePost

Test Plan: View Recent, View posts, edit post, new post, move post, view live.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14713
2015-12-08 14:55:28 -08:00
epriestley
d53187e10a Make "Create Subtask" work properly in EditEngine
Summary: Ref T9908. This fixes "Create Subtask" so it works with the new stuff. Mostly straightforward.

Test Plan: Created some subtasks.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14706
2015-12-08 14:29:58 -08:00
Chad Little
e275964f43 Tidy up PhameBlogManage
Summary: Remove unneeded actions, fix archive controller, adds some icons. Ref T9897

Test Plan: Archive a blog, unarchive a blog

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14709
2015-12-08 13:55:15 -08:00
epriestley
ec2ad5ed66 Swap Maniphest to new edit form
Summary: Ref T9908. This form has a reasonable behavior now after the global reordering stuff.

Test Plan: Clicked "Edit Task".

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14708
2015-12-08 13:01:51 -08:00
epriestley
3438664b38 Provide documentation explicitly describing what a "root problem" is
Summary:
A guide to basic skills every software professional should have.

This is so fundamental that I don't think the document is actually helpful, but we can try it I guess.

Test Plan: Reading?

Reviewers: chad

Reviewed By: chad

Subscribers: Shredder121

Differential Revision: https://secure.phabricator.com/D14707
2015-12-08 13:01:32 -08:00
epriestley
52f7446eea Remove "Create Empty Task" workflow callouts and some other clutter
Summary:
Ref T9908. This removes the "Create Another Empty Task", "Create A Similar Task" and "Create Another Subtask of Same Parent Task" workflow callouts on the task detail page, which are actions that show up after creating a task or creating a subtask.

  - I think "Create Empty" isn't relevant now that we have "Create Task" nearby and the quick create menu?
  - I'm not sure if "Create Similar" is worth keeping. If we do want to retain it, I'd maybe like to find a way to do it generically.
  - I'm likewise not sure if "Create another subtask" is worth keeping.

Overall, these actions are weird/unusual and I'm not sure how valuable they are. I'm open to keeping "Similar" and/or "Subtask" but I'd like to verify that they're still valuable and make sure we have a reasonable design for them if we retain them.

For example, if we want to retain "Similar", maybe a better approach is just to add "Create Similar Object" to every action menu (which is now possible for EditEngine applications)? There's at least some interest in "Create Similar Repository" in Diffusion.

Also removes a very very old piece of "attached files" code.

Test Plan: Created and viewed some tasks.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14705
2015-12-08 13:01:09 -08:00
epriestley
59ae0d6fff Allow EditEngine create and edit forms to be reordered
Summary:
Ref T9132. Ref T9908. Puts reordering UI in place:

  - For create forms, this just lets you pick a UI display order other than alphabetical. Seems nice to have.
  - For edit forms, this lets you create a hierarchy of advanced-to-basic forms and give them different visibility policies, if you want.

Test Plan:
{F1017842}

  - Verified that "Edit Thing" now takes me to the highest-ranked edit form.
  - Verified that create menu and quick create menu reflect application order.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132, T9908

Differential Revision: https://secure.phabricator.com/D14704
2015-12-08 13:00:54 -08:00
epriestley
2f8e409876 Allow EditEngine forms to be marked as "edit" forms
Summary:
Ref T9132. Ref T9908. This attempts to move us forward on answering this question:

> Which form gets used when a user clicks "Edit Task"?

One answer is "the same form that was used to create the task". There are several problems with that:

  - The form might not exist anymore.
  - The user might not have permission to see it.
  - Some of the fields might be hidden, essentially preventing them from being edited.
  - We have to store the value somewhere and old tasks won't have a value.
  - Any instructions on the form probably don't apply to edits.

One answer is "force the default, full form". That's not as problematic, but it means we have no ability to create limited access users who see fewer fields.

The answer in this diff is:

  - Forms can be marked as "edit forms".
  - We take the user to the first edit form they have permission to see, from a master list.

This allows you to create several forms like:

  - Advanced Edit Form (say, all fields -- visible to administrators).
  - Basic Edit Form (say, no policies -- visible to trusted users).
  - Noob Edit Form (say, no policies, priorities, or status -- visible to everyone).

Then you can give everyone access to "noob", some people access to "basic", and a few people access to "advanced".

This might only be part of the answer. In particular, you can still //use// any edit form you can see, so we could do these things in the future:

  - Give you an option to switch to a different form if you want.
  - Save the form the task was created with, and use that form by default.

If we do pursue those, we can fall back to this behavior if there's a problem with them (e.g., original form doesn't exist or wasn't recorded).

There's also no "reorder" UI yet, that'll be coming in the next diff.

I'm also going to try to probably make the "create" and "edit" stuff a little more consistent / less weird in a bit.

Test Plan: Marked various forms as edit forms or not edit forms, made edits, hit permissions errors, etc.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132, T9908

Differential Revision: https://secure.phabricator.com/D14702
2015-12-08 13:00:30 -08:00
Chad Little
4973c2357c Filter PhameHome on active blogs only
Summary: Fixes T9928. Not sure if this is best mechanic or add new methods to PhamePostQuery (a join?)

Test Plan: Archive a blog, don't see posts on PhameHome

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9928

Differential Revision: https://secure.phabricator.com/D14701
2015-12-07 19:24:35 -08:00
epriestley
82e67e6bb9 Clean up some EditEngine meta-policies
Summary:
Ref T9908. Simplify some of the policies here:

  - If you can edit an application (currently, always "Administrators"), you can view and edit all of its forms.
  - You must be able to edit an application to create new forms.
  - Improve some error messages.
  - Get about halfway through letting users reorder forms in the "Create" menu if they want to sort by something weird since it'll need schema changes and I can do them all in one go here.

Test Plan:
  - Tried to create and edit forms as an unprivileged user.
  - Created and edited forms as an administrator.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14700
2015-12-07 15:40:31 -08:00
Chad Little
afacdbd814 Use AphrontDialog for New/Move Phame Posts
Summary: Moves New Post and Move Post to be separate Controllers with Dialogs. Ref T9897

Test Plan: Move a post to a new blog, see message and see post. Click New Post, get dialog, pick blog, edit new post.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14698
2015-12-07 14:15:46 -08:00
epriestley
468f785845 Support "template objects" generically in EditEngine
Summary:
Ref T9132. Ref T9908. Fixes T5622. This allows you to copy some fields (projects, subscribers, custom fields, some per-application) from another object when creating a new object by passing the `?template=xyz` parameter.

Extend "copy" support to work with all custom fields.

Test Plan:
  - Created new pastes, packages, tasks using `?template=...`
  - Viewed new template docs page.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T5622, T9132, T9908

Differential Revision: https://secure.phabricator.com/D14699
2015-12-07 13:44:07 -08:00
epriestley
2c9257b394 Drop "Quick Create" header from quick create menu
Summary:
Ref T9908. We can get a double-header with this ("Quick Create", "Create Task") which looks weird.

The behavior of this menu is probably obvious enough on its own from context and the "+" icon.

Test Plan: Opened menu, no more "Quick Create" item.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14696
2015-12-07 13:43:54 -08:00
epriestley
a1ccee8c24 Implicitly subscribe task author when they create a task
Summary:
Ref T9908. This is a behavioral change:

  - Old behavior: "Subscribers" field is default-populated with author.
  - New behavior: this transaction is just created no matter what.

The new behavior is much easier to make work with form defaults, hidden fields, etc. For example, on the "Create Bug" form, I've hidden "Subscribers", but I still want the author to be subscribed.

And if a user sets the default value of "Subscribers:" to "Alice, Bob", they almost certainly mean "Alice, Bob, and the task author".

And I ended up deleting myself by accident way more often than I deleted myself on purpose -- especially with "Create Similar task", I'd sometimes delete all the CCs and delete myself by accident and then have to put myself back.

Finally, technically speaking, restoring the old behavior is kind of hard/messy and this is much easier.

Test Plan:
  - Created a task.
  - Was automatically added as a subscriber.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14694
2015-12-07 11:13:58 -08:00
epriestley
e7fc2a387b Populate the "Quick Create" menu from EditEngine
Summary:
Ref T9908. When there are custom / renamed / policy considerations for applications, respect them in the quick create menu.

This has some performance implications, in that it makes every page slower by two queries (and potentially more, soon), which is quite bad. I have some ideas to mitigate this, but it's not the end of the world to eat these queries for now.

Test Plan: {F1017316}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14693
2015-12-07 11:13:34 -08:00
epriestley
c2d0c33e75 Allow "Assign/Claim" stacked action on closed tasks
Summary: Ref T9908. Now that you can submit multiple actions, you can "Open + Assign/Claim" a closed task, which is a reasonable action.

Test Plan: Assign/claim'd a closed task.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14692
2015-12-07 11:13:19 -08:00
epriestley
5caee3521e Clean up some EditEngine policy issues
Summary:
Ref T9908.

  - You should not need edit permission on a task in order to comment on it.
  - At least for now, ignore any customization in Conduit and Stacked Actions. These UIs always use the full edit form as it's written in the application.

Test Plan:
  - Verified a non-editor can now comment on tasks they can see.
  - Verified a user still can't use an edit form they can't see.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14691
2015-12-07 11:13:04 -08:00
epriestley
20e6a4200d Validate configuration of maniphest.priorities
Summary: Fixes T6132. We currently allow invalid configuration here; validate it.

Test Plan: Tried to save invalid config (negative priorities, string priorities, etc).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6132

Differential Revision: https://secure.phabricator.com/D14689
2015-12-05 17:11:11 -08:00
epriestley
ec71dcd8e9 Add an extra newline after <textarea> to preserve textarea content beginning with newlines
Summary:
Fixes T8707. See that task for discussion. Browser behavior is apparently to ignore a newline immediately following a `<textarea>`, and ostensibly has been since the early 1800s.

This is the same fix Rails used when it encountered this issue in 2011, which gives me some confidence it is correct.

Test Plan:
  - Edited a task with leading newlines in the description.
  - Newlines were preserved correctly across multiple edits.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8707

Differential Revision: https://secure.phabricator.com/D14688
2015-12-05 15:46:05 -08:00
epriestley
75f126c3d0 Fix a loopy comment
Summary: I wrote this earlier in D14680 but have now realized that it's the same sentence twice when read carefully.

Test Plan: read more carefully

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14687
2015-12-05 14:55:20 -08:00
Chad Little
505ae7e261 Update Ponder for Remarkup in Feed
Summary: Update Ponder Questions and Answers to render Remarkup in Feed

Test Plan: New Question, Edit Question, New Answer, Edit Answer, New Comment. See //remarkup// in Feed.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9825

Differential Revision: https://secure.phabricator.com/D14648
2015-12-05 14:46:37 -08:00
Aviv Eyal
51268de15f Fix Versions page
Summary:
- ipull there is wrong
- The `+` wasn't doing what I thought it was doing.
- I already forgot what that detour was doing, so I wrote it down.

Test Plan: Load Versions page, see no error log.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D14686
2015-12-05 22:34:03 +00:00
epriestley
2353121dee Add "Is merge commit?" to commit fields in Herald
Summary: Fixes T5788. We already have this as a pre-commit field, add it as a post-commit field too.

Test Plan: Ran this rule on a merge commit. Also ran it on a non-merge commit. Both got the correct value.

Reviewers: avivey, chad

Reviewed By: avivey, chad

Subscribers: avivey

Maniphest Tasks: T5788

Differential Revision: https://secure.phabricator.com/D14685
2015-12-05 13:07:56 -08:00
epriestley
bc331f0fbf Allow "Assign task" Herald Action in Maniphest to accept "None" to unassign
Summary:
Fixes T9206. This was also blocked on tokenizers being weird.

Also clean up some rendering stuff from the earlier changes.

Test Plan:
  - Added an "unassign" rule by typing "None", per instructions in the placeholder text.
  - Ran the rule.
  - Task got unassigned.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9206

Differential Revision: https://secure.phabricator.com/D14684
2015-12-05 12:39:45 -08:00
epriestley
f22dc9d47a Add a "Change priority to: ..." Herald action
Summary:
Ref T7848. This is a companion to "Change status to: ...".

(I'm pretty sure the only reason I didn't originally write these was the tokenizer bug in D14682, I just forgot about it).

This is basically a copy/paste of the "status" action.

Test Plan:
  - Wrote a rule to change task priorities.
  - Edited a task.
  - Saw rule fire properly.
  - Tokens also stick around correctly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7848

Differential Revision: https://secure.phabricator.com/D14683
2015-12-05 11:20:53 -08:00
epriestley
82be07315c Improve rendering of tokenizer tokens in Herald when editing rules
Summary:
Fixes T7848. @jasonfsmitty discussed an issue in great detail there and in D14359, and I completely missed it. Specifically:

  - If you save a "Change status to: Open" rule in Maniphest, and then edit it again, the token shows "Unknown Object (???)" instead of the correct token.
  - That's because loadHandles() has no idea what to do with the value "open", since it's not a real PHID.

The way we render tokenizer tokens in Herald is quite hacky right now. Fortunately, I wrote a //slightly// better way for EditEngine yesterday or the day before. Use the slightly better way to fix the issue with D14359.

This could still be better than it is, but the badness is mostly hidden now and can be cleaned up later without impacting anything.

Test Plan: Edited a Herald rule with projects and status changes, saw proper tokens.

Reviewers: chad

Reviewed By: chad

Subscribers: jasonfsmitty

Maniphest Tasks: T7848

Differential Revision: https://secure.phabricator.com/D14682
2015-12-05 11:20:07 -08:00
epriestley
92175488e9 Allow Maniphest statuses and priorities to be disabled
Summary: Fixes T9496. If you have some statuses or priorities you don't need, allow users to disable them to stop the bleeding.

Test Plan:
  - Set task to status X and priority Y.
  - Disabled X and Y using config.
  - Verified task still had old status/priority.
  - Verified new task could not be created/edited into those settings.
  - Verified task/priority appeared in typeahead, but were marked as disabled.
  - Viewed email command docs.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9496

Differential Revision: https://secure.phabricator.com/D14681
2015-12-05 11:01:41 -08:00
Jason Smith
a77bf877d4 Herald support for changing task status
Summary:
Ref T7848. This patch is incomplete and has the following issues:

 - Multiple statuses can be entered on the edit rule page (only the first one is used).
 - Statuses are not rendered correctly when re-editing a rule.

Test Plan: Applied to our local phab instance and verified it works with our task workflow.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: joshuaspence, revi, epriestley, jsmith

Maniphest Tasks: T7848

Differential Revision: https://secure.phabricator.com/D14359
2015-12-05 10:55:36 -08:00
epriestley
77d33ec7be Fix confusing ordering of similar actions in transaction groups
Summary:
Fixes T7250. Currently, if a display group of transactions (multiple transactions by the same author in a short period of time with no intervening comments) has several transactions of similar strength (e.g., several status change transactions) we can end up displaying them in reverse chronological order, which is confusing.

Instead, make sure transactions of the same type/strength are always in logical order.

Test Plan:
  - Merged a task into another task, then reopened the merged task.
  - Before patch: merge/reopen showed in wrong order.

{F1014954}

  - After patch: merge/reopen show in correct order.

{F1014955}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7250

Differential Revision: https://secure.phabricator.com/D14680
2015-12-05 10:51:13 -08:00
Chad Little
0ce373a012 Add subscriber mailtag to blog posts
Summary: For consistency, plus I ignore these. Ref T9897

Test Plan: Change to notify, log into notchad, subscribe, change back, see notification instead of email.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9909, T9897

Differential Revision: https://secure.phabricator.com/D14676
2015-12-05 18:01:24 +00:00
epriestley
eb439cf577 Improve UI formatting of some configuration values
Summary: This just pretties up some config like `maniphest.custom-field-definitions` which I noticed was kind of hard to read while chasing down other stuff.

Test Plan: {F1014940}

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14679
2015-12-05 09:58:47 -08:00
epriestley
1fcdcddd5f Fix EditEngine preview/draft for first comment on a task you didn't create
Summary: Ref T9132. See T9908#147038.

Test Plan:
  - As user A, created a new task.
  - As user B, started typing a comment on it (with no prior activity).
  - Users A and B must be different.

Before patch: preview/draft don't work, trace in error log (see above).

After patch: preview/draft work.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14678
2015-12-05 09:57:45 -08:00
Chad Little
6e7940cea2 Minor Phame polish
Summary:
- Add Blogs crumb to posts
 - Tidy up post edit page copy
Ref T9897

Test Plan: Review a Post, Edit Post

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14677
2015-12-05 09:52:43 -08:00
epriestley
5977215437 Don't require access to default EditConfiguration to view objects
Currently, to render comment actions you need to be able to see the
default form. Just make this work for now until it gets cleaned up.
2015-12-04 16:58:21 -08:00
epriestley
273e22d59f Save stacked actions in drafts, not just comments
Summary:
Ref T9132. Fixes T4580. Thhat might actually have been fixed a while ago or something since it describes a buggy/bad interaction which doesn't reproduce for me at HEAD.

This saves and restores all the stacked actions (subscribers, projects, etc) so that you don't lose anything if you close a window by accident.

Test Plan:
Added a bunch of actions in various states, reloaded the page, draft stuck around.

Submitted form, actions didn't stick around anymore.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4580, T9132

Differential Revision: https://secure.phabricator.com/D14675
2015-12-04 16:29:43 -08:00
epriestley
7aa865db2d Swap "Create Task" button over to EditEngine
Summary: Ref T9132. I can't actually get rid of the EditController yet since a few weird things still use it, but I think I can swap this button out without breaking anything. This will let us do "New Feature Request" / "New Bug" / "Advanced Task Creation" on secure and start playing with this stuff sooner.

Test Plan: Clicked "Create Task", got sent to new form.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14673
2015-12-04 16:29:41 -08:00
epriestley
eded19a5c6 Unify EditEngine preview behavior; prepare for saving complex drafts
Summary:
Ref T9132. We currently have an old preview/draft behavior and a new actions behavior.

Let the actions behavior do drafts/previews too, so we can eventually throw away the old thing.

This is pretty much just copying the old behavior into the new one, but with a few tweaks. The major change is that we submit all the stacked actions behavior now, so the preview reflects everything the change will do (and, soon, we can save it in the draft in a consistent way).

Also includes one hack-fix that I'll clean up at some point.

Test Plan: Added a bunch of stacked actions and observed meaningful previews.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14672
2015-12-04 16:29:40 -08:00
epriestley
f1744ac6d9 Change/drop/reconcile some miscellaneous edit behaviors in Maniphest
Summary:
Ref T9132. Open to discussion here since it's mostly product stuff, but here's my gut on this:

  - Change Maniphest behavior to stop assigning tasks if they're unassigned when closed. I think this behavior often doesn't make much sense. We'll probably separately track "who closed this" in T4434 eventually.
  - Only add the actor as a subscriber if they comment, like in other applications. Previously, we added them as a subscriber for other types of changes (like priority and status changes). This is more consistent, but open to retaining the old behavior or some compromise between the two.
  - Retain the "when changing owner, subscribe the old owner" behavior.

Test Plan:
  - Added a comment, got CC'd.
  - Changed owners, saw old owner get CC'd.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14670
2015-12-04 16:29:38 -08:00
epriestley
f9e84d1a88 Make "Assign / Claim" stacked action work properly in Maniphest
Summary:
Ref T9132. This is kind of a mess because the tokenizer rewrite left rendering tokenizers in Javascript a little rough. This causes bugs like icons not showing up on tokens in the "Policy" dialog, which there's a task for somewhere I think.

I think I've fixed it enough that the beahavior is now correct (i.e., icons show up properly), but some of the code is a bit iffy. I'll eventually clean this up properly, but it's fairly well contained for now.

Test Plan:
  - Reassigned a task.
  - Put a task up for grabs.
  - No reassign on closed tasks.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14669
2015-12-04 16:29:35 -08:00
epriestley
92ea07e787 Restore "Change Status" and "Change Priority" comment actions to Maniphest
Summary: Ref T9132. Supports selects in stacked actions and adds "Change Status" + "Change Priority".

Test Plan: Changed status and priority from stacked actions.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14667
2015-12-04 16:29:33 -08:00
epriestley
b3cf00333c Limit number of EditEngine tokenizer tokens in "Owner" field UI to 1
Summary:
Ref T9132. Only allow a task to have a single owner in the UI.

In Conduit, make this field appear and behave as "phid" instead of "list<phid>".

Test Plan: Edited a task with new fancy form, got limited to one owner. Assigned/unassigned. Used Conduit to assign/unassign.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14666
2015-12-04 16:29:31 -08:00
epriestley
dd0b09a610 Make "Quote" work with EditEngine in Paste and Maniphest
Summary: Ref T9132. This makes the "Quote" action on comments work properly in these applications.

Test Plan: Quoted text in each application.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14665
2015-12-04 16:29:29 -08:00
epriestley
8bbea6d41c Make "Add Action..." add actions at the bottom instead of the top
Summary: Ref T9132. Shhh this never happened shhhhhhh.

Test Plan: Selected multiple actions, saw them add at the bottom.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14664
2015-12-04 16:29:28 -08:00
epriestley
6bfb101aff Replace all Maniphest commenting code with EditEngine commenting code
Summary:
Ref T9132. Like D14659, I'll hold this until after the cut.

This swaps commenting in Maniphest over to EditEngine / stackable actions. New code doesn't have parity yet, although none of the things we're missing should technically be //strictly mandatory//. There's a list inline. I'll restore these in the next diffs.

Briefly -- comments, subscribers and projects work. Status, owners and priority do not yet.

Test Plan:
  - Made comments and added subscribers and projects.
  - Read through the old code to look for missing features and tried to document them all.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14663
2015-12-04 16:29:25 -08:00
epriestley
fa27352309 Rough in EditEngine for Maniphest
Summary:
Ref T9132. I'm going hold this until after the release cut since it isn't going to land completely smoothly, but I think I can prep it today/tomorrow and hopefully get it close enough to working to put in HEAD on Saturday after the push.

This adds the basics: new EditEngine, new EditController, and new `maniphest.edit` API endpoint.

I put the new stuff at `editpro/` for now until it works a little better.

Some notes on stuff this is dropping/changing/not-working-yet:

  - Preview for the description. I'd rather solve this by putting a "Preview" button on every Remarkup area if we want to retain it. Particularly, it does not generalize to adding custom remarkup fields in its current form. See also T3967.
  - Per-field policies are no longer enforced. They were never truly enforced anyway (for example, any user who can edit a task has always been able to edit every field via Conduit or email actions or Herald, where Herald supports things), and only really served as a hint to users. I think we can obsolete this by having installs hide/lock these fields instead. This is a desirable outcome for me, since I don't like retaining these policies and the idea of truly enforcing them properly is worrisome. These were originally added for Uber as an onboarding sort of thing. I'll prepare users for this in greater detail in the documentation.
  - Couple of minor bugs with ordering / defaults / only-one-owner-allowed in this diff that I'll clean up in future diffs before this stuff lands.
  - I don't have a concrete plan on "Create Similar Task" / "Clone" yet (do you have thoughts? Is this worth trying to do in every application?). I'll probably just mostly mimic the current behavior.

Test Plan: I'll vet this more thoroughly in followups, just banged around some tasks for now and created/edited via the API.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14659
2015-12-04 16:29:23 -08:00
Chad Little
b482027687 Actual 2x avatar, new profile picture options
Summary: Provides a real 2x avatar and offers new built in images for profile pictures.

Test Plan: reload profile, see sharper image, pick eevee, see eevee

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14668
2015-12-04 13:24:25 -08:00
Chad Little
cf6c3fb41a Minor updates to PhameBlogSearch
Summary: Use Profile Image, remove skin, show domain info better, add New Post button. Ref T9897

Test Plan: Test new buttons, see new images.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14671
2015-12-04 13:24:09 -08:00
Chad Little
74882503aa Spiffy up PhamePostView
Summary: Cleaner Author information, less "Properties", Build a History Page. Ref T9897

Test Plan:
Review New Posts, Draft Posts, View History

{F1012934}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14660
2015-12-03 15:28:45 -08:00
Chad Little
7ce2ad294f Separate out PhameDescriptionView
Summary: Make this function re-usable in other views. Ref T9897

Test Plan: View a blog, see the same information

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14658
2015-12-03 14:40:17 -08:00
Chad Little
905d0f43b1 Misc Phame Updates
Summary: Color nodata as nodata, fix picture redirect, give hints when items aren't set on blogs. Ref T9897

Test Plan: Tested each of these items.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14657
2015-12-03 14:06:54 -08:00
Chad Little
39903769f0 Fix Phame Post creation time
Summary: I spent way to long to arrive at this solution. Ref T9360

Test Plan: Publish a new post, see time, unpublish post, see draft. Start a new post, wait 10 minutes, publish, see "now".

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9360

Differential Revision: https://secure.phabricator.com/D14656
2015-12-03 13:43:44 -08:00
epriestley
dc0d914134 Basic stacked action support for EditEngine
Summary: Ref T9132. This still has a lot of rough edges but the basics seem to work OK.

Test Plan: {F1012627}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14653
2015-12-03 12:32:02 -08:00
epriestley
b82863d972 Implement versioned drafts in EditEngine comment forms
Summary:
Ref T9132. Fixes T5031. This approximately implements the plan described in T5031#67988:

When we recieve a preview request, don't write a draft if the form is from a version of the object before the last update the viewer made.

This should fix the race-related (?) zombie draft comments that sometimes show up.

I just added a new object for this stuff to make it easier to do stacked actions (or whatever we end up with) a little later, since I needed to do some schema adjustments anyway.

Test Plan:
  - Typed some text.
  - Reloaded page.
  - Draft stayed there.
  - Tried real hard to get it to ghost by submitting stuff in multiple windows and typing a lot and couldn't, although I didn't bother specifically narrowing down the race condition.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T5031, T9132

Differential Revision: https://secure.phabricator.com/D14640
2015-12-03 07:07:29 -08:00
epriestley
618cec23d8 Make notification counts properly translatable
Summary:
Ref T9132. When I've touched `PhabricatorApplication` I keep hitting this bad `pht()` junk.

The warning is correct, these strings are not extactable and can not be translated.

Fix it so they can be extracted and translated.

Broadly, in all cases we want to render one of these:

> 95 Things (for fewer than some limit)
> 99+ Things (when we hit the limit)

Test Plan: Looked at homepage status counts, moused over them, saw reasonable strings. Grepped for removed method.

Reviewers: chad

Reviewed By: chad

Subscribers: joshuaspence

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14638
2015-12-03 07:06:39 -08:00
epriestley
a1c7ba6b8b Initial support for comments/append-edits in EditEngine
Summary:
Ref T9132. This just replaces the "Add Comment" form in Paste with a generic flow in EditEngine.

No actual field-awareness or action stacking or anything quite yet, but that will come in a bit. This mildly regresses drafts (which don't seem like a big deal for Pastes). I'll hook those up again in the next diff, but I want to build them in a better way that will work with multiple actions in a generic way, and solve T5031.

Big practical advantage here is that applications don't need copy/pasted preview controllers.

Test Plan:
  - Saw previews.
  - Added comments.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14637
2015-12-03 07:06:25 -08:00
Chad Little
274f115d41 Update Pholio to return Remarkup in Feed
Summary: Uses getRemarkupBodyForFeed instead

Test Plan: New Mock, Edit Mock, Inline comments.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9825

Differential Revision: https://secure.phabricator.com/D14650
2015-12-02 23:49:28 +00:00
Chad Little
8d62ade70a Render Remarkup poorly in Phame Feed stories
Summary: Seeing if this is the correct path, then will apply in Pholio, Ponder.

Test Plan: epriestley

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: joshuaspence, Korvin

Maniphest Tasks: T9825

Differential Revision: https://secure.phabricator.com/D14646
2015-12-02 14:16:03 -08:00
Chad Little
dd82cd4922 Clean up Phame Preview
Summary: This adds a separate Publish/Unpublish step aside from Preview in Phame Posts. This allows easier access to publishing without previewing, though I left publish in tact on the preview page. Also cleaned up some minor transaction issues with mail.

Test Plan: New Post, Publish Post, Preview Post. Check mail logs. Get mail upon publish.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14642
2015-12-02 13:28:07 -08:00
Joshua Spence
9104867c71 Linter fixes
Summary: Minor linter fixes.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14631
2015-12-03 07:44:23 +11:00
epriestley
773ecb9a44 Support Conduit application of most CustomField transactions in EditEngine
Summary:
Ref T9132. Give most standard custom fields reasonable Conduit support so you can use the new `application.x` endpoints to set them.

Major missing field type is dates, again.

Test Plan: Used Conduit to set various custom fields on a package.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14635
2015-12-02 09:32:49 -08:00
epriestley
c1ae5321d7 Support HTTP parameter prefilling in EditEngine forms for CustomFields
Summary:
Ref T9132. This allows you to prefill custom fields with `?custom.x.y=value`, for most types of custom fields.

Dates (which are substantially more complicated) aren't supported. I'll just do those once the dust settles. Other types should work, I think.

Test Plan:
  - Verified custom fields appear on "HTTP Parameters" help UI.
  - Used `?x=y` to prefill custom fields on edit form.
  - Performed various normal edits.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14634
2015-12-02 09:32:26 -08:00
epriestley
91447c54bc Write 500 words on how to restart webservers
Summary:
Fixes T9874.

  - Stop using the phrase "restart your webserver". Instead, say "restart Phabricator".
  - Write a document explaining that "Restart Phabricator" means to restart all of the server processes, depending on how your configuration is set up, and approximately how to do that.
  - Link to this document.
  - In places where we are not specifically giving instructions and the user isn't expected to do anything, be intentionally vague so as to avoid being misleading.

Test Plan:
  - Read document.
  - Hit "exetnsion" and "PHP config" setup checks, got "restart Phabricator" with documentation links in both cases.

Reviewers: chad

Maniphest Tasks: T9874

Differential Revision: https://secure.phabricator.com/D14636
2015-12-02 09:16:10 -08:00
Chad Little
b5bd4c65c2 Update transactions for handleRequest
Summary: Updates Transactions for handleRequest

Test Plan: Leave Comment, View Raw, Delete, Quote, etc.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T8628

Differential Revision: https://secure.phabricator.com/D14629
2015-12-02 07:59:36 -08:00
Chad Little
1b61af126f Update Subscriptions for handleRequest
Summary: Modernizes Subscriptions

Test Plan: Subscribe/Unsubscribe... anything else?

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T8628

Differential Revision: https://secure.phabricator.com/D14630
2015-12-02 07:58:13 -08:00
epriestley
029b1b6733 Partially support CustomFields in EditEngine
Summary:
Ref T9132. This isn't perfect, but doesn't break any existing functionality. This stuff works:

  - Editing values.
  - Reordering fields.
  - All builtin field tyepes.

This stuff may not work yet:

  - Assigning custom field defaults.
  - Some conduit stuff.
  - Fully custom fields?
  - Locking/hiding fields? Didn't actually test this one.

I'll keep chipping away at that stuff. In some cases, it may be easier to convert all the CustomField apps first, although Differential might be a fair bit of work.

Test Plan:
Created a bunch of custom fields of every avialable type and edited them.

{F1008789}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14617
2015-12-02 05:21:31 -08:00
epriestley
a407b83dc2 Move Owners to EditEngine
Summary:
Ref T9132. Paste is in fairly good shape so Owners is up next. Reasoning:

  - One install wants API access for it.
  - It's a simple application for getting CustomFields working with EditEngine.

This only does the EditEngine part, so CustomFields are no longer editable until I make that work. That will be up next, and I'll hold this until that's ready.

Test Plan:
  - Created and edited packages via web UI.
  - Created and edited package editing forms via web UI.
  - Created and edited packages via Conduit.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14598
2015-12-02 05:21:15 -08:00
epriestley
b596d850ff Fix one more call to addExtraQuicksandConfig()
Summary:
Fixes T9881. This one had Quicksand spelled as "QuickSand" (with capital "S") so it probably didn't get hit by `grep`.

Didn't need to do any special magic with the footer, as far as I can tell.

Test Plan: Loaded project board view, seemed to work OK (no footer, nav works, title works, mobile menu sane).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9881

Differential Revision: https://secure.phabricator.com/D14626
2015-12-01 13:41:30 -08:00
Joshua Spence
7164606285 Add a lock to storage upgrade and adjustment
Summary: Fixes T9715. Adds a MySQL-based lock to ensure that schema migrations are not applied on multiple hosts simultaneously.

Test Plan: Ran `./bin/storage upgrade` concurrently. One invocation was successful whilst the other hit a `PhutilLockException`.

Reviewers: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T9715

Differential Revision: https://secure.phabricator.com/D14463
2015-12-02 06:18:28 +11:00
Chad Little
bbd1da4f8d Remove addExtraQuicksandConfig
Summary: Removes all calls to addExtraQuicksandConfig Ref T9690

Test Plan: grep for addExtraQuicksandConfig, view a Pholio Page with and without chatbar, edit a pholio mock, save mock.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

Differential Revision: https://secure.phabricator.com/D14622
2015-12-01 18:29:21 +00:00
Chad Little
b2b652ef28 Allow builtin Phame UI to be publicly viewable
Summary: These weren't open to the public even if the blog was public.

Test Plan: View a blog post, blog view, and blog manage page while logged out.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14619
2015-11-30 16:54:43 -08:00
Chad Little
4e6cd90e41 Add a homepage for Phame
Summary: Sends `/phame/` to PhameHomeController, which is all published posts. Still some rough edges to work out for new posts, new blogs, but I think this is the right direction.

Test Plan:
go to Phame, see most recent posts, no drafts. click on find posts, see post list, click on find blogs, see blogs.

{F1008800}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9742

Differential Revision: https://secure.phabricator.com/D14618
2015-12-01 00:25:59 +00:00
Aviv Eyal
2fba7e66e7 Versions Panel: Show extensions, dates
Summary: ref T9788

Test Plan: {F1008540}

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T9788

Differential Revision: https://secure.phabricator.com/D14610
2015-11-30 22:57:24 +00:00
Chad Little
065df01f65 Modernize Slowvote, fix Badges mobile menu
Summary: Uses modern methods in Slowvote, adds appmenu, consistent create into Badges

Test Plan: View Poll list, new poll, edit poll, vote in poll.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

Differential Revision: https://secure.phabricator.com/D14592
2015-11-30 12:58:11 -08:00
Chad Little
d2bed3438d Style drafts in new PhameBlogView
Summary: Provides more information that a post is a draft.

Test Plan:
Add a draft post, see new style. Check Blog as non-editor, don't see draft post.

{F1008655}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9360

Differential Revision: https://secure.phabricator.com/D14613
2015-11-30 12:37:50 -08:00
lkassianik
47a5ebb4fe Correctly implementing mailkey for Phurl
Summary: Re T6049, Correctly implementing mailkey for Phurl

Test Plan: Edit Phurl URL, receive email.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14605
2015-11-30 10:44:54 -08:00
epriestley
9d59086d01 Consolidate transaction generation in EditType objects
Summary:
Ref T9132. This is a bit more cleanup to make adding CustomField support easier.

Right now, both `EditField` and `EditType` can actually generate a transaction. This doesn't matter too much in practice today, but gets a little more complicated a couple of diffs from now with CustomField stuff.

Instead, always use `EditType` to generate the transaction. In the future, this should give us less total code and make more things work cleanly by default.

Test Plan: Used web UI and Conduit to make various edits to pastes, including doing race-condition tests on "Projects".

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14607
2015-11-30 09:01:00 -08:00
epriestley
56be700561 Improve code structure of PHID fields in EditEngine
Summary: Ref T9132. I had some hacks in place for dealing with Edge/Subscribers stuff. Clean that up so it's structured a little better.

Test Plan:
  - Edited subscribers and projects.
  - Verified things still show up in Conduit.
  - Made concurrent edits (added a project in one window, removed it in another window, got a clean result with a correct merge of the two edits).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14601
2015-11-30 09:00:37 -08:00
epriestley
50f257adee Allow EditEngine Conduit endpoints to accept object IDs and monograms
Summary:
Ref T9132. This is a quality-of-life improvement for new `application.edit` endpoints.

Instead of strictly requiring PHIDs, allow IDs or monograms. This primarily makes these endpoints easier to test and use.

Test Plan: Edited objects via API by passing IDs, PHIDs and monograms.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14600
2015-11-30 09:00:24 -08:00
epriestley
acd955c6c9 Modularize application extensions to EditEngine
Summary:
Ref T9132. Currently, EditEngine had some branchy-`instanceof` code like this:

```
if ($object instanceof Whatever) {
  do_magic();
}

if ($object instanceof SomethingElse) {
  do_other_magic();
}
```

...where `Whatever` and `SomethingElse` are first-party applications like ProjectsInterface and SubscribersInterface.

This kind of code is generally bad because third-parties can't add new stuff, and it suggest something is kind of hacky in its architecture. Ideally, we would eventually get rid of almost all of this.

T9789 is a similar discussion of this for the next layer down (`TransactionEditor`) and plans to get rid of branchy-instanceofs there too.

Since I'm about to add more stuff here (for Custom Fields), split it out first so I'm not digging us any deeper than I already dug us.

Broadly, this allows third-party extensions to add fields to every EditEngine UI if they want, like we do for Policies, Subscribers, Projects and Comments today (and CustomFields soon).

Test Plan:
{F1007575}

  - Observed that all fields still appear on the form and seem to work correctly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14599
2015-11-30 08:59:27 -08:00
Chad Little
9a19309345 Update PhameBlogView UI
Summary: Creates a new PhameBlogView which is more of a blog landing page with the latest posts. Management has moved to PhameManageController with a new timeline.

Test Plan:
Edit Blog, Publish, Subscribe, view posts.

{F1008400}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9360

Differential Revision: https://secure.phabricator.com/D14608
2015-11-30 08:56:32 -08:00
Chad Little
1bfddccf39 Modernize Herald
Summary: Updates Herald to use modern methods.

Test Plan: View List, View Test Console, Run a test, View Results, View Rules, New Rule, Edit Rule, Check mobile menus.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

Differential Revision: https://secure.phabricator.com/D14596
2015-11-30 07:11:52 -08:00
Chad Little
ee102c7aca Modernize Countdown
Summary: Update to new modern methods.

Test Plan: View List, New Countdown, Edit Countdown, Delete Countdown

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

Differential Revision: https://secure.phabricator.com/D14593
2015-11-30 07:11:03 -08:00
Chad Little
5686fb7fa4 Modernize Pholio
Summary: Use modern methods in Pholio

Test Plan: View list, create mock, edit mock, view mobile menu

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

Differential Revision: https://secure.phabricator.com/D14595
2015-11-30 06:58:05 -08:00
epriestley
b35f578ae9 Modernize Transaction value controller, fixing logged-out policy issue
Summary: Fixes T9869. This specific transaction endpoint was missing `shouldAllowPublic()`. Also modernize things a little.

Test Plan: Viewed a policy change by clicking the policy name from the transaction record on a public object while logged out.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9869

Differential Revision: https://secure.phabricator.com/D14606
2015-11-30 06:55:31 -08:00
Chad Little
b9fcaadce8 Modernize Maniphest
Summary: Updates (some) of Maniphest for modern methods. Didn't convert Reports (probably need a setNavigation call added).

Test Plan: View List, edit task, new task, view reports.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14597
2015-11-30 06:45:39 -08:00
Aviv Eyal
f6c98a55a4 Don't raise setup warning for "bad version" if the binary is not there
Test Plan: warning is not in warnings list.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D14594
2015-11-29 23:13:26 +00:00
epriestley
37893ba2e6 Allow EditEngine configurations to be disabled and marked as "Default"
Summary:
Ref T9132.

Let configurations be enabled/disabled. This doesn't do much right now.

Let configurations be marked as default entries in the application "Create" menu. This makes them show up in the application in a dropdown, so you can replace the default form and/or provide several forms.

In Maniphest, we'll do this to provide a menu something like this:

  - New Bug Report
  - New Feature Request
  - ADVANCED TASK CREATION!!11~ (only available for Community members)

Test Plan: {F1005679}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14584
2015-11-29 08:27:26 -08:00
Chad Little
760655aa09 Modernize Badges
Summary: Ref T9690, updates Badges in various ways.

Test Plan: View List, View Badge, Create Badge, Assign Badge

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

Differential Revision: https://secure.phabricator.com/D14591
2015-11-28 15:04:14 -08:00
Chad Little
0d7b59e323 Update Almanac for newPage
Summary: Swaps out for modern methods. Ref T9690

Test Plan: Check various Almanac pages, new devices, editing, lists.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

Differential Revision: https://secure.phabricator.com/D14590
2015-11-28 14:47:59 -08:00
epriestley
0d01dab5a3 Partially revert D14511 to fix "INLINE COMMENTS" in mail
Summary:
Ref T9845. In Differential, this is not a remarkup block -- it's a mail section. `addTextSection()` has special magic behavior when handed a prebuilt section since D9375.

Swapping to `addRemarkupSection()` causes the error in T9845 and renders nothing in the comment section.

Even if it were a block of text, it would not be appropriate to add it as remarkup. This would incorrectly render comments in files like `__init__.py`, which are common on Python (the filename would render as "__init__.py"). Okay that's a bad example since it works fine but, uh, a file named `T123` would be no good or whatever.

I'll realign T9845 to clean this up and fix it more durably.

Test Plan: Sent myself some mail with inline comments, saw them in the mail.

Reviewers: joshuaspence, chad

Reviewed By: chad

Maniphest Tasks: T9845

Differential Revision: https://secure.phabricator.com/D14589
2015-11-28 13:40:57 -08:00
Chad Little
5eada3d89c Add Profile Images to PhameBlog
Summary: Will use these more in the upcoming unbeta design of PhameBlog, likely. Also curious how this works.

Test Plan: Add an image to a blog, remove an image from a blog.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14587
2015-11-28 13:39:08 -08:00
Chad Little
e8a39ca3e5 Implement PhabricatorDestructibleInterface in Phame
Summary: Allows Blogs and Posts to be destroyed. Fixes T9756

Test Plan: Test `bin/remove destroy POST` and `bin/remove destroy BLOG` to great success.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9756

Differential Revision: https://secure.phabricator.com/D14586
2015-11-28 13:10:41 -08:00
Chad Little
a6e24cb2be Remove pro-white-background, re-style PHUIDocumentViewPro
Summary: This makes document views a little more automatic, and a little more style to the page. The Document itself remains on a pure white centered background, but footer and preceeding objects go back to the original body color. This provides a bit more depth and separation over content and definitions/comments.

Test Plan:
Tested Phriction, Diviner, Legalpad, Phame, Email Commands, HTTP Commands, with and without a footer.

{F1005853}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14582
2015-11-28 07:20:55 -08:00
Chad Little
d880346b64 Remove delete function in PhamePost
Summary: Ref T9756, removes the ability to delete a PhamePost

Test Plan: See link removed, unpublish post, publish post, new post.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9756

Differential Revision: https://secure.phabricator.com/D14581
2015-11-27 14:10:25 -08:00
epriestley
afcbbce80f Minor spelling/wordsmith on CLA doc
Summary: Caught these while re-reading.

Test Plan: Reading?

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14580
2015-11-27 13:45:13 -08:00
epriestley
eb62a98e0f Document the CLA in more detail
Summary: Provide a long-form description of why we require a CLA and the distinction between the individual and corporate CLAs. See Q219 and Q97.

Test Plan: Reading.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14578
2015-11-27 13:26:49 -08:00
epriestley
fc1c36106d Pass recently applied transactions to HeraldAdapters
Summary: Ref T9851. See T9860. This adds a missing capability to custom HeraldActions, to pave the way for removing the obsolete/undesirable WILLEDITTASK and DIDEDITTASK events.

Test Plan: See T9860 for a replacement action.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9851

Differential Revision: https://secure.phabricator.com/D14575
2015-11-26 08:53:08 -08:00
Chad Little
8c016b20d2 Fix New Phame Blog status setting
Summary: Column status cannot be null fix.

Test Plan: Create a new blog.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14574
2015-11-25 18:25:53 -08:00
epriestley
b219285999 Fix handling of implicit comment transaction in paste creation
Summary:
Fixes T9850. The `getComment()` test should be a `hasComment()` test, in order to discard empty comments.

Also backport a couple of future fixes which can get you into trouble if you reconfigure forms in awkward ways.

Test Plan: Created a new paste without a comment.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9850

Differential Revision: https://secure.phabricator.com/D14571
2015-11-25 08:25:10 -08:00
Nipunn Koorapati
c4ea1e6e21 Increase the maximum size eligible for image transforms configurable from 4MB->16MB
Summary: Also increase the timeout for the external process to complete the transform.

Test Plan: Careful inspection

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: joshuaspence, cburroughs, chad, Korvin

Differential Revision: https://secure.phabricator.com/D14528
2015-11-25 06:42:44 -08:00
Chad Little
5b4825cf1e Use new DocumentView for Legalpad previews
Summary: Moves to showing Legalpad previews using PHUIDocumentViewPro

Test Plan: Create a new document, edit an existing document

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14550
2015-11-24 10:07:39 -08:00
Chad Little
8f23e41f62 Update to FontAwesome 4.5
Summary: New icons

Test Plan: Use new icons

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14568
2015-11-24 08:52:33 -08:00
Joshua Spence
2047483cc0 Render Remarkup in emails
Summary: Ref T992. I noticed that `ManiphestTask` mail doesn't render Remarkup properly (instead, it renders Remarkup literally). I //think// this is because the code calls `addTextSection()` rather than `addRemarkupSection()`.

Test Plan: Created a new Maniphest Task and saw Remarkup in the generated self-email (inspect the email contents with `./bin/mail show-outbound`). I didn't test the other affected applications.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T992

Differential Revision: https://secure.phabricator.com/D14511
2015-11-24 06:43:01 +11:00
Chad Little
df7f21b4e8 Use PHUIRemarkupPreviewView in Phame
Summary: Reuse PHUIMarkupPreviewView in Phame for consistency, less custom code. Also, doesn't work (JS issue).

Test Plan: New Post, Edit Post, Save Post

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14552
2015-11-23 10:36:02 -08:00
epriestley
2f7010d18e Markup project hashtags which begin with (or contain only) digits
Summary:
Fixes T9832. We currently refuse to recognize project hashtags in remarkup if they begin with a digit. This is motivated by attempting to not recognize them if they contain only digits.

I don't think we really gain anything by this. Although most `#123` in text are probably not project references, the cost of doing a lookup for them is quite small, and //some// of them are.

In cases where users use `#123` to refer to tasks in an external system, they can use a rule for that with higher precedence than this one or not give their projects conflicting hashtags.

Test Plan:
  - This is well-covered by unit tests.
  - Referenced a `#3u1`, per T9832.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9832

Differential Revision: https://secure.phabricator.com/D14547
2015-11-23 06:50:43 -08:00
Chad Little
2a063a93a9 Fix constant in PhameBlogTransaction
Summary: These constants are incorrect.

Test Plan: Archive a blog, see feed story. Publish a blog, see another feed story.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14545
2015-11-23 14:37:44 +00:00
epriestley
8f484f2e3a Fix outdated lies in "Script and Regex" linter documentation
Summary: See D14536. Some time ago, linters changed to no longer receive these special/unusual file types as inputs by default.

Test Plan:
  - Read new docs.
  - Attempted to grep for other similar lies, although it's possible I missed some. I didn't find anything.

Reviewers: bgamari, chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14543
2015-11-23 05:59:13 -08:00
epriestley
b964f8873b Fix daemon restart behavior to check once every 10 seconds
Summary: This logic is flipped.

Test Plan:
  - Before change: ran `bin/phd debug task`, saw queries to the config table every second.
  - After change: ran `bin/phd debug task`, saw queries to the config table every 10 seconds.

Reviewers: chad, joshuaspence

Reviewed By: chad, joshuaspence

Differential Revision: https://secure.phabricator.com/D14542
2015-11-23 05:59:04 -08:00
epriestley
39cf013472 Add objectPHID keys to Harbormaster task schedulers
Summary:
Fixes T9816. It's currently hard to hunt down some particulars in the worker queue if things go awry in Harbormaster.

Supplement the queue with `objectPHID` keys so we can hunt tasks down more easily if the issues in T9816 continue.

Test Plan:
```
mysql> select * from worker_archivetask order by id desc limit 30;
+--------+------------------------------------------------+-----------------------------------+--------------+--------------+--------+--------+----------+-------------+--------------+----------+--------------------------------+
| id     | taskClass                                      | leaseOwner                        | leaseExpires | failureCount | dataID | result | duration | dateCreated | dateModified | priority | objectPHID                     |
+--------+------------------------------------------------+-----------------------------------+--------------+--------------+--------+--------+----------+-------------+--------------+----------+--------------------------------+
| 496024 | HarbormasterTargetWorker                       | 8514:1448232248:Orbital.local:3   |   1448318648 |            0 | 311880 |      0 |   233758 |  1448232248 |   1448232248 |     2000 | PHID-HMBT-thq4oof4byllmbc4q3tt |
| 496023 | PhabricatorApplicationTransactionPublishWorker | 8514:1448232247:Orbital.local:1   |   1448239447 |            0 | 311879 |      0 |    53731 |  1448232247 |   1448232247 |     1000 | PHID-HMBD-i6zo2ltc73rre7o54s7v |
| 496022 | HarbormasterBuildWorker                        | 8514:1448232247:Orbital.local:2   |   1448239447 |            0 | 311878 |      0 |    30736 |  1448232248 |   1448232248 |     2000 | PHID-HMBD-i6zo2ltc73rre7o54s7v |
...
```

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9816

Differential Revision: https://secure.phabricator.com/D14541
2015-11-23 05:58:54 -08:00
Chad Little
06aa3a0a1b Fix Phriction toc rendering when toc is null
Summary: Removes the exception, maybe there is a better way, but landing this for now. Fixes T9829

Test Plan: Test pages with and without a table of contents

Reviewers: epriestley, avivey

Subscribers: epriestley

Maniphest Tasks: T9829

Differential Revision: https://secure.phabricator.com/D14546
2015-11-22 23:07:16 -08:00
epriestley
c034752578 Support comments as an EditEngine field
Summary:
Ref T9132. This adds an automatic "Comments" field, like the Subscribers/Projects/Policy fields.

The primary goals here are:

  - Allow users to make comments via Conduit.
  - In the future, get stackable action support.

As a side effect, this also allows you to put comments on create forms. This is a little silly but seems fine, and may be relevant on edit forms (which I'm not 100% sure how I want to handle yet). I've just hidden them by default for now.

Test Plan:
{F976036}

{F976037}

{F976038}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14515
2015-11-22 16:27:17 -08:00
epriestley
269e0bfc94 Allow EditEngine form fields to be locked and hidden
Summary:
Ref T9132. Allows fields to be locked (shown, but not modifiable) and hidden (not shown).

In both cases, default values are still respected.

This lets you do things like create a form that generates objects with specific projects, policies, etc.

Test Plan:
  - Set defaults.
  - Locked and hid a bunch of fields.
  - Created new objects using the resulting form.

{F975801}

{F975802}

{F975803}

{F975804}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14509
2015-11-22 16:25:32 -08:00
epriestley
53d5cd3950 Allow EditEngine forms to have defaults assigned
Summary: Ref T9132. Allow form configurations to include defaults (like default projects, spaces, policies, etc).

Test Plan:
Defaulted "Language" to "Rainbow", plus other adjustments:

{F975746}

{F975747}

{F975748}

{F975749}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14508
2015-11-22 16:25:00 -08:00
epriestley
9aee90f8c1 Allow form configurations to retitle and reorder forms and add preambles
Summary:
Ref T9132. This just makes edited forms do //something//, albeit not anything very useful yet.

You can now edit a form and:

  - Retitle it;
  - add a preamble (instructions on top of the form); and
  - reorder the form's fields.

Test Plan:
{F974632}

{F974633}

{F974634}

{F974635}

{F974636}

Reviewers: chad

Reviewed By: chad

Subscribers: hach-que

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14503
2015-11-22 15:12:57 -08:00
epriestley
d7212d855e Fix edits of Ponder comments which mention other objects
Summary: Fixes T9806. See some discussion there.

Test Plan:
  - Edited a comment with `T12` in it.
  - Before change: exception.
  - After change: no exception.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9806

Differential Revision: https://secure.phabricator.com/D14539
2015-11-22 15:12:28 -08:00