1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-21 17:58:47 +02:00
Commit graph

2757 commits

Author SHA1 Message Date
vrana
00f730d6e9 Delete unused code in Diffusion browse file
Test Plan: Browsed a file.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4508
2013-01-18 08:37:52 -08:00
Asher Baker
27e2198e11 Fix displaying non-image files.
Summary: The Files application currently tries to render all browser-viewable files in an img tag, not taking into account if they're an image or not.

Test Plan: Looked at various image and non-image files.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4511
2013-01-18 06:20:33 -08:00
epriestley
656a6f9b55 Fix editing of JSON config values via web UI
Summary: We should set the value if it's valid, not if it's invalid. derpp~

Test Plan: Set `files.viewable-mime-types`.

Reviewers: asherkin, codeblock, btrahan, vrana

Reviewed By: asherkin

CC: aran

Differential Revision: https://secure.phabricator.com/D4510
2013-01-18 05:47:34 -08:00
Chad Little
dc62433d17 Reduce home nav to 300px.
Summary: Based on loose feedback, reduce the width of the navigation.

Test Plan: Test, reload. Chrome and FF.

Reviewers: epriestley, vrana, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4507
2013-01-17 21:01:46 -08:00
epriestley
5beaafb952 Load libraries before adding database config
Summary:
If your configuration overrides the connection adapter, we need to load libraries before we can setup the database config source.

Also lock this since it won't work when edited from the web anymore, and so sneaky users can't upload stuff and then edit their config to run arbitrary code.

Test Plan: See chatlog in #phabricator. This is a problem for Facebook only.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4498
2013-01-17 18:59:58 -08:00
epriestley
68083c4693 Remove $view; statement with no effect
Summary: See rP96839d35f49c76e8e266af69bbbdcb4c013b9af9.

Test Plan: No effect.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4495
2013-01-17 18:59:47 -08:00
epriestley
b0d815d157 Repair invalid configuration by setting values back to defaults
Summary:
When configuration is set incorrectly (e.g., of the wrong type), detect and repair it by setting it to the default value. A setup warning will be raised separately.

Notably, this removes the need to hard-code all the class types.

This runs separately from the "invalid config" check because we need to run it on every page, but do setup checks only once per restart (some of them are slow).

Also dirty setup when we edit configuration.

Test Plan: Set config incorrectly on purpose, saw Phabricator correct it on restart and on every subsequent page load until it was fixed.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2292

Differential Revision: https://secure.phabricator.com/D4492
2013-01-17 16:25:38 -08:00
epriestley
141d479104 Restore some title glyphs to new-style applications
Summary: Not all applications' glyphs survived the migration. Restore them.

Test Plan: Looked at Differential, Phriction, Ponder. Saw title glyphs in page titles.

Reviewers: lesha, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4489
2013-01-17 15:04:57 -08:00
Chad Little
e53244d1da Minor homepage re-format
Summary: Cleans up homepage layout. Removes panels, moves 'mini panels' under panels with information.

Test Plan: Test out my homepage, ask Evan to test his.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4491
2013-01-17 14:02:18 -08:00
Tristan Pemble
c7c25e141a Added support for STARTTLS with LDAP
New config value 'ldap.start-tls' (defaults to false) for STARTTLS
support over LDAP
2013-01-17 09:51:13 -08:00
Ricky Elrod
da6296a176 LDAP STARTTLS option.
Summary: For GitHub PR 246.

Test Plan: Looked at the option.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4485
2013-01-17 09:50:01 -08:00
epriestley
1b4369056e Remove unnecessary $nav
Summary: See D4451.

Test Plan: Looked at Maniphest, saw it unchanged.

Reviewers: edward, btrahan

Reviewed By: edward

CC: aran

Differential Revision: https://secure.phabricator.com/D4484
2013-01-17 08:33:34 -08:00
vrana
df8d0a578b Correctly handle unset generated paths 2013-01-16 16:57:09 -08:00
epriestley
83f5452d53 Implement all remaining config options
Summary: Resolves T2255.

Test Plan: Looked at mail options. Saw no remaining "Setup Issues".

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4477
2013-01-16 15:06:39 -08:00
epriestley
482f6ea56b Remove "Flags" from homepage
Summary: Flags have a large red count on the homepage now, which I think is a sufficient reminder of flagged stuff. This element was nice at first to raise awareness of the app, but it's fairly well integrated now and enjoys moderate use. This is also a sort of feeler for how much people use it / the homepage in general.

Test Plan: Looked at homepage, no flags.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4479
2013-01-16 15:06:19 -08:00
epriestley
99847da3aa Mask remaining config values, and implement set type
Summary: The remaining hash/key values are already-migrated, I am just bad at grep. Also implement a "set" type.

Test Plan: Looked at set, edited set.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4476
2013-01-16 15:06:07 -08:00
vrana
9f549ba75e Fix whitespace around else 2013-01-16 12:16:37 -08:00
epriestley
e3cfcc4a46 Sort options by key on "all config"
Summary: Oops, missed this -- alphabetical is probably a better sort order than by-group-then-by-definition.

Test Plan: Looked at alphabetical options.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4474
2013-01-16 11:39:13 -08:00
epriestley
6e69523efc Move "show all config" from DarkConsole to /config/
Summary:
Currently, we have a "config" panel in DarkConsole. It's useful to have a table of all effective config values, but it doesn't need to be in DarkConsole. Move it to Config instead. Basically:

  - You don't need to activate DarkConsole to see it anymore;
  - now visible only to admins;
  - respects config mask/hide;
  - somewhat prettier;
  - links to config edit;
  - no longer ships down on every DarkConsole request with a giant table of rarely-used data.

Test Plan: Looked at the table. Looked at lack of table in darkconsole.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4473
2013-01-16 11:10:41 -08:00
epriestley
c2a70932e3 MetaMTA: Owners, Pholio, Macro
Summary:
Port MetaMTA options for Owners, Pholio and Macro.

At some point I'd like to get rid of all these options (provide one "reply domain", and not allow overrides of reply handlers -- use events instead) but that's a battle we can fight later.

Test Plan: Looked at options, looked at setup issues, edited something.

Reviewers: codeblock, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4469
2013-01-16 10:52:30 -08:00
epriestley
3ded757e84 Implement more configuration options
Summary:
Allow extra options to be locked, hidden or masked via config. These options are themselves locked and can not be edited via the web UI.

The primary goal here is to let us lock or hide things from SaaS installs (e.g., keys, etc.), or to let server administrators lock or hide information from web UI administrators if they want to for some reason.

The secondary goal is to remove the `darkconsole.config-mask` option, although I might just remove the panel entirely and put it in the config app, since that probably makes far more sense. Yeahhhhh... probably doing that.

These options need masks when ported (they haven't been ported yet):

    phabricator.csrf-key
    phabricator.mail-key
    security.hmac-key

Test Plan: Artifically tweaked lock/hide settings on options, verified the UI respected them.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4472
2013-01-16 10:52:09 -08:00
epriestley
0e612c910b Sort repositories in Diffusion by name, not creation order
Summary: Ref T2298. This seems like the least complicated reasonable order to implement.

Test Plan: Looked at repositories, saw them ordered by name.

Reviewers: vrana, btrahan, brennantaylor

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2298

Differential Revision: https://secure.phabricator.com/D4395
2013-01-16 10:51:08 -08:00
Ricky Elrod
65fbbd06c6 OAuth options.
Test Plan: Looked at the options.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4470
2013-01-16 10:00:54 -08:00
Ricky Elrod
8b1fb16865 Don't preface 'Daemons' with 'Phabricator'.
Summary:
It's obvious that they're Phabricator related (why else would we provide
settings for them) and nothing else is prefaced.

Test Plan: Looked at /config/

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4471
2013-01-16 09:47:29 -08:00
Ricky Elrod
800f62d0d5 Repository option.
Test Plan: Looked at the option.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4468
2013-01-16 09:35:48 -08:00
epriestley
c85cc932ef Remove Drydock config options
Summary: Adding random config options has a higher cost now since we can't remove them without raising warnings in installs about missing/unknown config. These are a bit premature to expose just yet -- I might want to put them in web-based config, too.

Test Plan: Grepped for strings.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4467
2013-01-16 09:20:23 -08:00
epriestley
b04a6a1999 Diffusion / MetaMTA options
Summary: Implement Diffusion MetaMTA options. Also make the fake '{{config.option}}' rule work, and use Remarkup to render summaries as well as descriptions.

Test Plan: Looked at Diffusion rules, edited some, looked at setup issues, verified '{{config.option}}' linked to the right option.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4466
2013-01-16 09:08:13 -08:00
epriestley
307acd6067 Maniphest / MetaMTA config options
Summary: Move the Maniphest-related mta options into config.

Test Plan: Looked at options and edited a couple. Looked at setup warnings to make sure the relevant setup warnings were no longer raised.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4465
2013-01-16 09:01:32 -08:00
epriestley
a9ff58ff27 Add even more Differential options
Summary:
These are technically in MetaMTA right now, but I put them in Differential since I think it's probably a better primary category fit and having 120 options in MetaMTA won't do anyone any favors. (We can do some kind of cross-categorization or "related options" later if we get feedback that people are having trouble finding options like these which have multiple reasonable categories.)

Also improve the readability of displayed JSON literals with forward slashes.

Test Plan: Looked at options, edited a couple of them. Looked at JSON literal values, saw them rendered more readably.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4464
2013-01-16 09:01:16 -08:00
epriestley
0b7f760a41 Base class of differential.field-selector should be DifferentialFieldSelector, not DifferentialDefaultFieldSelector
Summary: Missed this -- the "Default" flavor extends from the actual abstract base.

Test Plan: Loaded setup issues, no longer saw an issue raised for my local extension class.

Reviewers: codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4463
2013-01-16 09:00:20 -08:00
epriestley
fffa7ffb6c Allow users to customize applicaiton tile sizes
Summary:
See discussion in D4438. Allows users to customize application tiles, and implements generally reasonable defaults so they hopefully won't.

Sizes are "invisible" (internal only, used to hide admin apps from non-admins), "hidden" (hide by default, show after clicking "Show More Applications"), "show" (show a small square tile) and "full" (show a full-width tile with subtitle).

Test Plan:
Default view for a non-admin:

{F29375}

Adjusted settings, hidden:

{F29373}

Adjusted settings, shown:

{F29374}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4439
2013-01-16 09:00:11 -08:00
Chad Little
fb9a1c38fb Panel background changes for Repositories app.
Summary: Changed some background panels.

Test Plan: Reload page.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4458
2013-01-16 07:49:24 -08:00
Chad Little
cba5a866f8 Consistent panels for account settings.
Summary: Sets all panels to full width and no backgrounds in settings for consistency.

Test Plan: Check each page width.

Reviewers: epriestley, codeblock, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4460
2013-01-16 07:49:05 -08:00
Ricky Elrod
e974ffea7f Remove curly braces around line count.
Summary:
I'm assuming they aren't meant to be there.

Old:
This file has a very large number of changes ({4,032} lines). Show File Contents

New:
This file has a very large number of changes (4,032 lines). Show File Contents

Test Plan:
Saved a 5000-line test file, diffed from /dev/null, uploaded diff to local
instance, viewed.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4462
2013-01-16 07:26:40 -08:00
vrana
f74c2bb138 Optimize displaying info about lint messages
Summary:
Log of some FB paths takes over 10 seconds.
We query two logs only to get accurate message about lint info which is not that important.

Test Plan: Displayed and clicked on it.

Reviewers: nh, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4429
2013-01-15 17:59:06 -08:00
epriestley
e6e09fcf0a Fix calendar icon
Summary: Guess this never actually got implemented.

Test Plan: looked at home

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4456
2013-01-15 16:12:36 -08:00
epriestley
6543740c62 Implement full-width application tiles
Summary: Fix mystery meat by providing full-width tiles for core applications.

Test Plan: {F29364}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4438
2013-01-15 15:41:37 -08:00
epriestley
c506cfe8d9 Implement very basic uberhome
Summary:
No fancy-pants smarty stuff yet, but merges /applications/ and the awful application buttons into the dark navigation.

Hover state is maybe a little weird.

Test Plan: {F29324}

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran, btrahan, codeblock

Differential Revision: https://secure.phabricator.com/D4431
2013-01-15 15:41:22 -08:00
epriestley
55072a2640 Move all ListFilter buttons into crumbs
Summary:
Maniphest and Owners still have green ListFilter buttons, which have looked awkward for a while and are extra-awkward after D4447. Move them into crumbs and remove the ability of ListFilter to support buttons.

The actual implementation can be simplified too now.

Test Plan: Looked at Owners, Maniphest. Clicked create buttons. Looked at UIExample.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4451
2013-01-15 15:38:05 -08:00
epriestley
668a818f3c Move Phame config into config options
Summary: so much work

Test Plan: clicky clicky

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4448
2013-01-15 15:36:49 -08:00
Chad Little
4c231486d7 More Diffusion panel updates.
Summary: In Commit Details, remove the panel backgrounds.

Test Plan: Chrome

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4454
2013-01-15 15:05:15 -08:00
Chad Little
ca135256b5 Remove panels in Audit.
Summary: Checked Audit and removed panel backgrounds.

Test Plan: Chrome

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4452
2013-01-15 14:58:56 -08:00
Ricky Elrod
7857508185 Finish Differential options.
Test Plan: Saw the new options show up, saved some of them.

Reviewers: epriestley, chad, btrahan

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4443
2013-01-15 13:17:23 -08:00
epriestley
950076ec95 Bring SendGrid configuration into PHP
Summary: Port more settings.

Test Plan: Looked at, edited settings.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4442
2013-01-15 12:04:05 -08:00
epriestley
c8a2bc982c Bring PHPMailer config into the new config UI
Summary:
Port PHPMailer options. Also:

  - Don't show values on config lists if they're masked (this is mostly for passwords, to prevent them from being idly/accidentally disclosed).
  - Don't show "default" icon -- just show an icon if the value has been customized. This makes it easier to pick out custom values.

Test Plan: Looked at / edited mailer values.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4441
2013-01-15 12:03:44 -08:00
Gregor Stocks
cd9d59344c Fix a rap bug, and add a beat
Summary:
The flow was off in some cases. This should mitigate it.

Adds a Unicode musical note character at the start of the rap which,
when clicked, embeds a song in the background, hides it and plays it.
Currently the song is Gangsta's Paradise (karaoke version) but if you'd
prefer a different song, I can probably change it with only a few weeks
of work.

This doesn't respect the "embed youtubes" preference because you have to
click something to embed it, so it's your own fault your referers are
getting leaked.

For now, does the simplest thing and doesn't loop it. If it turns out
people are spending a lot of time on this page, we should look into
doing something like youtuberepeater.

Not trying to make this share code with the existing Youtube embedding
stuff - I think they're doing different enough things that solving them
both in the same way would be more code.

Test Plan:
Clicked the note in Firefox. Clicked the note in Chrome.
Considered clicking the note in Safari and Internet Explorer.

Reviewers: epriestley

Reviewed By: epriestley

CC: miorel, HarrisonW, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4437
2013-01-15 10:32:49 -08:00
epriestley
4566b86376 Fix two diff rendering bugs
Summary:
  - The order of operations for file changes is wrong. We need to wrap them in a table, then render the changeset talbe around that table.
  - Line data was being set to late, so renderShield() got the wrong line count and rendered empty diffs behind, e.g., generated changes.

Test Plan: Looked at an image change with property changes. Clicked "show file contents" on a generated file.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4432
2013-01-15 08:07:40 -08:00
epriestley
3998bcc104 Phriction setting.
Summary: One setting.

Test Plan:
- Looked at the setting in the web interface.
- Waved to it
- Introduced myself
- Had a nice conversation
- Made a new friend
- Turns out `phriction.enabled` is a nice guy.

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4436
2013-01-15 06:31:54 -08:00
Ricky Elrod
c3fbb6e66b Feed options.
Test Plan: Looked at them.

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4434
2013-01-14 18:35:30 -08:00
Gregor Stocks
e2f37b059b Replace "insert rap about tokens here" with a rap about tokens
Test Plan:
Made getTokenStatus() return the four legal values and an
illegal one, looked at the linked account page and confirmed that the
rap rendered and had correct meter

Reviewers: epriestley

Reviewed By: epriestley

CC: miorel, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4433
2013-01-14 17:29:37 -08:00
Chad Little
e2e890672a Adds a new 'setnobackground' panel class, implements in Differential / Diffusion.
Summary: Still working through basic re-design. Adds the ability to re-use panel view without the background.

Test Plan: Viewed Diffusion and Differential in Chrome, FF, Safari.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4430
2013-01-14 16:40:04 -08:00
epriestley
901328088d Render inline comments somewhat-correctly on 1-up diffs
Summary: You can't interact with them yey, but do a less awful job of rendering them.

Test Plan: {F29204}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4426
2013-01-14 14:20:54 -08:00
epriestley
ea8faedf0b Add very basic 1-up HTML renderer support
Summary:
  - Add a query parameter to select the diff renderer.
  - When we populate diffs, use the 1-up renderer if the device isn't a desktop. Don't switch renderers once the page has loaded since it will be a tremendous mess. We can add an "always use 1-up" preference later.
  - Tweak JX.Device so we avoid a race condition, where `JX.Device.getDevice()` may not be valid when other behaviors run.
  - Implement enough of the 1-up HTML renderer to provide a vague hint that it actually works.
  - Fix a couple of bugs with primitive construction.

Test Plan:
{F29168}
{F29169}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4423
2013-01-14 14:20:35 -08:00
epriestley
2de107f21b Remove DifferentialChangesetRenderer->(g|s)etLineCount()
Summary: The "line count" is always the same as count($this->getOldLines()), and somewhat misleading since it's really "number of rows in the two-up view". D4421 removed the only (or only remaining?) call.

Test Plan: looked at some diffs

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4422
2013-01-14 14:20:26 -08:00
epriestley
612b29fff4 Implement basic one-up and test renderers
Summary:
This is a half-step toward one-up and test renderers. This is mostly a structural change, and has no user-facing impact. It splits the rendering hierarchy like this:

  - Renderer (more methods are abstract than before)
    - HTML Renderer (most HTML stuff has moved down from the base to here)
      - HTML 1-up (placeholder only -- not yet a functional implementation)
      - HTML 2-up (minimal changes, uses mostly old code)
    - Test Renderer (unit-testable renderer base, implements text versions of the HTML stuff)
      - Test 1-up (selects 1-up mode for test rendering)
      - Test 2-up (selects 2-up mode for test rendering)

Broadly, I'm trying to share as much code as possible by splitting rendering into more, smaller stages. Specifically, we do this:

  - Combine the various sorts of inputs (changes, context, inlines, etc.) into a single, relatively homogenous list of "primitives". This happens in the base class.
    - The primitive types are: old (diff left side), new (diff right side), context ("show more context"), no-context ("context not available") and inline (inline comment).
  - Possibly, apply a filtering/reordering step to the primitives to get them ready for 1-up rendering. This mostly removes information, and does a small amount of reordering. This also happens in the base class.
  - Pass the primitives to the actual renderer, to convert them into HTML, text, or whatever else. This happens in the leaf class.

The primitive implementation is not yet complete (it doesn't attach as much information to the primitives as it should -- stuff like coverage and copies), but covers the basics.

The existing HTMLTwoUp renderer does not use the primitive path; instead, it still goes down the old path.

Test Plan: Ran unit tests, looked at a bunch of diffs.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4421
2013-01-14 14:20:06 -08:00
Chad Little
ff91884f7d Dark sidebar everywhere
Summary:
First pass at testing out a dark sidebar everywhere. Wanting feedback with real test time before implementing before commiting.

Thoughts
- Aligns with Mobile, Tablet UI experience.
- Creates 'application' feel on Desktop.
- Begins to make Phabricator feel like a branded UI.

Cons
- Probably contensious visually.

TODO:
- Update diff view sidebar.
- Make breadcrumbs appear above content area, not above nav.
- Change background texture on crumbs to match table headers.

Test Plan: Testing Nav with fellow co-workers.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4427
2013-01-14 13:40:51 -08:00
Ricky Elrod
9470ab0576 First go at Files settings.
Summary:
Based on @epriestley's https://secure.phabricator.com/differential/diff/9186/
plus others that seemed like they belong here.

Test Plan: Saw the new settings show up in the web interface.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4425
2013-01-13 17:01:02 -08:00
Ricky Elrod
0c6e5f86bc Port a few various options.
Summary:
- remarkup.enable-embedded-youtube
- controller.oauth-registration
- aphront.default-application-configuration-class
- cache.enable-deflate

Test Plan: Saw the new options in the web interface.

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4424
2013-01-13 15:10:40 -08:00
John Watson
d67b42dcc0 Missing verb in StoryPhriction renderText
Test Plan: Get feed.query with a Phriction story

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4417
2013-01-13 12:50:26 -08:00
Chad Little
38626dce64 Remove spacer from sidebars.
Summary: This removes all calls to addSpacer and the method. We were applying it inconsistently and it was causing spacing issues with redesigning the sidenav. My feeling is we can recreate the space in CSS if the design dictates, which would apply it consistently.

Test Plan: Go to Applications, click on every application.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4420
2013-01-13 08:17:12 -08:00
Ricky Elrod
ab9556345f Left-align dates on /differential.
Test Plan: Went to /differential.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4415
2013-01-11 16:56:20 -08:00
vrana
b0edca7294 Display #1 instead of #comment-1 in comment anchors
Summary: I changed this a long time ago probably without knowing that this format is usable in Remarkup.

Test Plan: Viewed revision and task.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4413
2013-01-11 15:51:21 -08:00
Ricky Elrod
76c10f497f Fix error in PhabricatorSetupIssueView
Summary:
- Move `prettyPrintJSON()` and make it static.
- Use it from `PhabricatorSetupIssueView`
- Update other `config/` places that use it to call it from the new class.

This fixes a bug in `PhabricatorSetupIssueView` which showed up if the value
was an array and couldn't be rendered by `phutil_escape_html()`.

Test Plan:
- Rendered some config options.
- Went to /config/issue/config.unknown.phame.skins/ without error.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4411
2013-01-11 15:28:39 -08:00
Ricky Elrod
08687c0b17 Search options.
Test Plan:
- Looked at the new options
- Saved `search.engine-selector` successfully.

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4410
2013-01-11 15:28:19 -08:00
epriestley
dbdb01f858 Fix whitespace and unchanged file shields
Summary:
Fixes T181. I actually have no idea what the original issue in T181 was, but this fixes several problems:

  - The code for figuring out whitespace-only changes was extremely confusing and probably buggy (the code for figuring out unchanged files was equally confusing but probably less buggy).
  - When rendering a whitespace shield, we did not offer a "Show Changes" link. Instead, show the "Show Changes" link: we can always render the content beneath this link.
  - When clicking "Show Changes", we used the current whitespace mode, which might result in a diff with no changes. Instead, force "show all" whitespace mode.
  - We never offered a "show changes" link for unchanged files. Instead, offer this link if we can service it.
  - When clicking "Show Changes", we pierced the shield but didn't force file content, which would fold the entire file even if it was available. Instead, force the file content.

Test Plan: Generated whitespace-only and no-change diffs. Clicked shield links, or verified no shield link available in no-change-with-no-content. Generated an "@generated" change, verified shield worked correctly.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T181, T2009

Differential Revision: https://secure.phabricator.com/D4407
2013-01-11 15:27:42 -08:00
epriestley
039a5a6d86 Simplify hunk parsing
Summary:
Simplify whitespace-ignoring diffing:

  - Currently, we generate two diffs (one ignoring whitespace, one normal) and then copy the //text content// from the normal one to the whitespace-ignoring one.
  - Instead, copy the //change types// from the ignoring one to the normal one.
    - This is cheaper and much simpler.
    - It means that we have the right change types in reparseHunksForSpecialAttributes(), and can simplify some other things.

Simplify whitespace changes, unchanged files, and deleted file detections:

  - Currently, we do this inline with a bunch of other stuff, in the reparse step.
  - Instead, do it separately. This is simpler.

Simplify intraline whitespace handling:

  - Currently, this is a complicated mess that makes roughly zero sense.
  - Instead, do it in reparse in a straightforward way.

Partially fix handling of files changed only by changing whitespace.
Partially fix handling of unchanged files.

Test Plan:
  - Ran unit tests.
  - Created context-less diffs, verified they rendered reasonably.
  - Generated a diff with prefix whitespace, suffix whitespace, intraline whitespace, and non-whitespace changes. Verified changes rendered correctly in "ignore most" and "show all" modes.
  - Verified unchanged files and files with only whitspace changes render with the correct masks.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4398
2013-01-11 15:25:15 -08:00
vrana
dbeb60adbe Display other locations of lint errors
Summary:
Depends on D4392.

I don't plan on adding these to changesets.

Test Plan: Added `$message['locations'] = array(array('line' => 10));` in the code and displayed a revision with lint problems.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4394
2013-01-11 14:04:29 -08:00
vrana
d04bc0747c Allow filtering Differential overviews by other participants
Summary:
This is useful for writing feedback - what did I work on with someone?
This creates `AND IN (...)` and not `AND AND AND` if more participants are specified.
User may not expect it but whatever, it works the same for the most common case of 1 extra participant.
It would be nice to have this also for other filters but it would by way harder.

Test Plan: Displayed my revisions with some specific reviewer and some elses revisions with me as reviewer.

Reviewers: epriestley

Reviewed By: epriestley

CC: wez, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4408
2013-01-11 13:45:25 -08:00
vrana
c59aeb22fe Allow displaying more users at once in Differential overview
Summary:
I want to check the work of several people (bootcampers) at once.
This implements the OR filter required for that.
In the next diff, I plan to implement also the AND filter which can be useful too.

Test Plan:
Searched for several people, clicked all filters.
Searched for one person, verified that pretty URL is still created.

Reviewers: epriestley

Reviewed By: epriestley

CC: wez, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4404
2013-01-11 12:32:33 -08:00
epriestley
b73622b866 Make "Create Document" in Phriction use workflow
Summary:
My claims that this worked on D4183 were incorrect:

  - Make it work.
  - Then use it.
  - Also make cancel URI not cancel to the same page.

Test Plan: Clicked "Create Document", got a workflow on-page dialog instead of a page transition.

Reviewers: codeblock

Reviewed By: codeblock

CC: aran

Differential Revision: https://secure.phabricator.com/D4403
2013-01-11 11:58:31 -08:00
Ricky Elrod
368657a570 Somewhat give Phriction the new Breadcrumb UI.
Summary:
Okay, just a forewarning, this is horrible right now.

But I think it's an okay enough start that it's worth sending what I've done.

This rips out the old Phriction breadcrumb UI and replaces it with the new one
that other apps have been starting to use.

Test Plan: Looked at a bunch of Phriction pages.

Reviewers: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4183
2013-01-11 11:40:43 -08:00
Ricky Elrod
30345cfbdd Port Maniphest options.
Test Plan: Viewed the new options.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4401
2013-01-11 10:24:37 -08:00
Ricky Elrod
86938688e0 Fix tooltip typo.
Summary: chilren.

Test Plan: yep.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4400
2013-01-11 09:54:46 -08:00
epriestley
6a69108358 Simplify context parsing and add test coverage
Summary:
  - Remove 'missingNew', etc. It's impossible for a diff to popluate these, as far as I can tell (I can't generate such a diff, or find any which generate it).
  - Add unit tests.

Test Plan: Unit tests, viewed a diff with some missing context.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4393
2013-01-10 16:06:39 -08:00
epriestley
ebf2435c49 Make feed its own application
Summary:
Fixes the two-level nav issue introduced by D4376.

(My claim that this page is device ready in the code is something of a lie, but it's fairly close.)

(@chad, this could use an icon at some point, or you can point me at which one you want and I can take a stab at slicing it.)

Test Plan: Looked at feed; saw it not-broken. Also checked public feed (which should just merge at some point).

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4381
2013-01-10 16:06:29 -08:00
Michael Halstead
21ed25019d Prevent exceptions when adding repositories via conduit.
Summary: Simple change to stop exceptions from being thrown based on the diff in D4146.

Test Plan: arc call-conduit repository.create

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: vrana, aran, Korvin

Maniphest Tasks: T2268

Differential Revision: https://secure.phabricator.com/D4342
2013-01-10 15:37:56 -08:00
John Watson
1f58185f89 Add renderText to FeedStory for simple text repr of story
Summary:
This pushes the rendering of feed stories out of IRCDifferentialNotificationHandler and into feed.query

Also fixes bug in feed.query that broke attachment of related objects to stories.

Test Plan: echo '{"view": "text", "limit": 10}' | arc call-conduit feed.query

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, codeblock

Differential Revision: https://secure.phabricator.com/D4390
2013-01-10 11:11:18 -08:00
Ricky Elrod
dceb161150 Add the tokenizer.ondemand setting to Core for now.
Summary:
T2255 lists it as "???" and we don't have a "Misc" category and it seems silly
to make it for one option, so stick this in core for now.

Test Plan: Went to the setting page and saw the bool options.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4389
2013-01-10 11:09:38 -08:00
Ricky Elrod
054f09fb50 Add syntax highlighting options.
Test Plan: Quick view of each option in the web interface.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4386
2013-01-10 09:56:39 -08:00
epriestley
9aeebbbf58 Fix "context not available" in contextless diffs
Summary: D4351 swapped this from a map to a list, and then stopped it from getting to the ChangesetParser so it didn't make it to the Renderer.

Test Plan: Ran "arc diff", copy/pasted it into the web UI. Saw a diff with "context not available" blocks in between missing contexts.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4384
2013-01-10 09:51:52 -08:00
Ricky Elrod
58dcb00fd8 Rename a setViewer call to setUser to fix a fatal.
Summary: Fixes T2303.

Test Plan: Rendered /uiexample/view/PhabricatorTimelineExample/ without a fatal

Reviewers: chad, epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin

Maniphest Tasks: T2303

Differential Revision: https://secure.phabricator.com/D4387
2013-01-10 09:51:31 -08:00
epriestley
ad4c4acafc Break profiles less after D4376
Summary: This won't win any awards, but makes User and Project profile pages significantly less broken in the wake of D4376.

Test Plan:
{F28858}
{F28859}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4382
2013-01-09 13:57:31 -08:00
Bob Trahan
f1d7c8fbf8 fix whitespace mode for differentialHunkParser
Summary: I forgot to "set it" from the changeset parser.

Test Plan: made a diff with silly whitespace changes. toggled the various whitespace modes and got appropriate results

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4378
2013-01-09 13:28:27 -08:00
Bob Trahan
84c27ae255 re-factor DifferentialChangesetParser pass 3 / N
Summary: introducing a new friend called DifferentialHunkParser. Sort of like the DifferentialChangesetParser but works with hunks only. tried to grab hunk parsing type things from across the code base and move them into this new class.

Test Plan: unit tests and played around in Differential a bit.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4351
2013-01-09 13:11:17 -08:00
vrana
fc30a6eb33 Add Atom export to Phame
Summary:
There's no link to this yet, I'll add it to some skin.

Fixes T2272.

Test Plan: http://validator.w3.org/appc/

Reviewers: btrahan, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2272

Differential Revision: https://secure.phabricator.com/D4366
2013-01-09 12:25:50 -08:00
epriestley
7ad3147b3b Remove all older-style navs
Summary: Move all navs to use the newer-style, darker, textured look. I'm //pretty// sure this doesn't break anything.

Test Plan: Looked at a bunch of apps.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4376
2013-01-09 12:03:58 -08:00
Ricky Elrod
abee691bc1 Fix more boolean reversals.
Summary: Missed these in D4357.

Test Plan: Meh.

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4371
2013-01-09 08:33:56 -08:00
epriestley
bc2db90f61 Minor, fix old call to setOptions() introduced out of order.
Auditors: codeblock
2013-01-09 08:15:18 -08:00
Ricky Elrod
71b5d8f584 Default to "True" and "False" for bool options.
Summary:
Rather than throwing if we don't `setOptions()`, let's just default to `true`
and `false`.

Test Plan:
Removed a `setOptions()` call temporarily and saw options default to
`true` / `false`.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4368
2013-01-09 08:14:29 -08:00
epriestley
f12dbe36d6 Raise a better error when a file upload fails in Differential
Summary:
Ref T2296. If a file upload fails (e.g., too large), we read the textarea from the "Create New Diff" interface. This means we show the user an error like "empty diff" when we should show them an error like "file upload failed, patch is too large". This is part of the issue in T2296, which features a 2.5MB diff.

Instead, check if a file was specified, so we'll raise a better error.

Test Plan: Tried to upload a large patch, got a "file is too large" error instead of an empty-diff-related error.

Reviewers: btrahan, vrana, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2296

Differential Revision: https://secure.phabricator.com/D4369
2013-01-09 08:14:17 -08:00
Ricky Elrod
cdaf898b9c PHD Options.
Test Plan: Looked at the options render properly.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4367
2013-01-09 06:05:36 -08:00
epriestley
7752717125 Fix a MetaMTA array_combine() warning
Summary:
Fixes T2290. Older versions of PHP (prior to PHP 5.4) raised a warning if you tried to combine empty arrays. (Newer versions don't, which is why I missed this in testing, although I may also not have tried sending empty mail.)

If mail has no recipients, we reach this with an empty array. Just skip the function body and return immediately, the result is empty array.

(You can get mail with no recipients in various valid ways, currently by, e.g., commenting on a Macro with no subscribers.)

Test Plan: Sent mail with zero, nonzero recipients. Received the nonzero recipient mail. Verified on php.net that this is a version issue.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2290

Differential Revision: https://secure.phabricator.com/D4360
2013-01-08 10:39:49 -08:00
epriestley
df2c811a54 Fix an error in DiffusionBrowseTableView with SVN repsositories with no lint information
Summary: If the repository has no lint information, we don't set a 'lint' key, but try to access it unconditionally later on.

Test Plan: Looked at an SVN repository browse view, saw no errors.

Reviewers: vrana, btrahan, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2281

Differential Revision: https://secure.phabricator.com/D4359
2013-01-08 09:50:03 -08:00
epriestley
4adf55919c Port Diviner Core to Phabricator
Summary:
This implements most/all of the difficult parts of Diviner on top of Phabricator instead of as standalone components. See T988. In particular, here are the things I want to fix:

**Performance** The Diviner parser works in two stages. The first stage breaks source files into "Atoms". The second stage renders atoms into a display format (e.g., HTML). Diviner currently has a good caching story on the first step of the pipeline, but zero caching in the second step. This means it's very slow, even for a fairly small project like Phabricator. We must re-render every piece of documentation every time, instead of only changed documentation. Most of this diff concerns itself with addressing this problem. There's a fairly large explanatory comment about it, but the trickiest part is that when an atom changes, other atoms (defined in other places) may also change -- for example, if `class B extends A`, editing A should dirty B, even if B is in an entirely different file. We perform analysis in two stages to propagate these changes: first detecting direct changes, then detecting indirect changes. This isn't completely implemented -- we need to propagate 'extends' through more levels -- but I believe it's structurally correct and good enough until we actually document classes.

**Inheritance** Diviner currently has a very weak story on inheritance. I want to inherit a lot more metas/docs. If an interface documents a method, we should just pull that documentation in to every implementation by default (implementations can still override it if they want). It can be shown in grey or something, but it should be desirable and correct to omit documentation of a method implementation when you are implementing a parent. Similarly, I want to pull in inherited methods and @tasks and such. This diff sets up for that, by formalizing "extends" relationships between atoms.

**Overspecialization** Diviner currently specializes atoms (FileAtom, FunctionAtom, ClassAtom, etc.). This is pretty much not useful, because Atomizers (which produce the atoms) need to be highly specialized, and Renderers/Publishers (which consume the atoms) also need to be highly specialized. Nothing interesting actually lives in the atom specializations, and we don't benefit from having them -- it just costs us generality in storage/caches for them. In the new code, I've used a single Atom class to represent any type of atom.

**URIs** We have fairly hideous URIs right now, which are very cumbersome  For in-app doc links, I want to provide nice URIs ("/h/notfications" or similar) which are stable redirects, and probably add remarkup for it: !{notifications} or similar. This diff isn't related to that since it's too premature.

**Search** Once we have a database generation target, we can index the documentation.

**Design** Chad has some nice mocks.

Test Plan: Ran `bin/diviner generate`, `bin/diviner generate --clean`. Saw appropriate graph propagation after edits. This diff doesn't do anything very useful yet.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D4340
2013-01-07 14:04:23 -08:00
Ricky Elrod
f7939b90e3 Fix reversed order of boolean config options.
Summary: See discussion in D4355, this fixes reversed bool logic.

Test Plan:
- Quickly viewed in the web interface to make sure it didn't break anything.
- Saved `ldap.auth-enabled` with correct boolean value in the db.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4357
2013-01-07 13:54:37 -08:00
vrana
0f1086fd68 Mark SVN dir copy as direct change for its files
Test Plan: HHVM currently core dumps so I didn't test it.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4343
2013-01-07 13:46:26 -08:00
Ricky Elrod
9aa772ed00 First go at Authentication config options.
Test Plan: Looked at them in the web UI.

Reviewers: epriestley, chad, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4355
2013-01-07 12:48:43 -08:00
Ricky Elrod
49b842187e Add Policy options.
Test Plan: Looked at the setting and available options from the dropdown.

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4354
2013-01-07 12:47:29 -08:00
Mailson Menezes
712e22208c Store width and height metadata of image files
Summary: Also provide a way to update old files metadata.

Test Plan: Create a revision which includes a image file. Check whether the widht, height metadata exists. Run `scripts/files/manage_files.php metadata --all` to update previously uploaded files.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2101

Differential Revision: https://secure.phabricator.com/D4347
2013-01-07 09:46:43 -08:00
Ricky Elrod
ae0773b789 Add translations config group.
Summary:
Adds the translations group as per T2255. Currently `translation.override` is
`wild` -- it should be changed to dict<string, string> when that exists.

Also fixes a small bug from D4326 which caused "class" types to not ever
validate.

Test Plan:
- Looked at the settings.
- Successfully saved a setting relating to classes.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4350
2013-01-04 16:22:56 -08:00
Bob Trahan
3448781c40 de-duplicate emails received by phabricator multiple times
Summary: this can happen if you have Phabricator and email lists co-mingling such that Phabricator receives an email multiple times. we can prevent this from then spamming everyone or otherwise taking the action multiple times by storing a message id hash and dropping the message if we have more than one message that matches.

Test Plan: simulated sending the same email multiple times on the command line. noted only the first one made it through.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1726

Differential Revision: https://secure.phabricator.com/D4328
2013-01-03 17:04:30 -08:00
epriestley
9a936b5bf3 Move notification configuration into PHP
Summary: Bring notification settings to PHP.

Test Plan: Viewed notification settings in /config/.

Reviewers: codeblock, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4337
2013-01-03 09:29:19 -08:00
epriestley
af604464d7 Move Recaptcha config to PHP
Summary: Bring these over. Also sort the group list.

Test Plan: Viewed config.

Reviewers: btrahan, codeblock, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4338
2013-01-03 09:17:38 -08:00
epriestley
0ecfb75101 Expand abbreviated Mercurial hashes to full hashes
Summary:
If you go to `/rXnnnn` in Git, we expand the hash. If you go to `/rXnnnn` in Mercurial, we give you a confusing error message.

Reconcile Mercurial behavior with Git. Fixes T2265.

Test Plan: Viewed partial hash, full hash commit in Diffusion. Viewed very short hash, got reasonable behaviors.

Reviewers: btrahan, tido

Reviewed By: tido

CC: aran

Maniphest Tasks: T2265

Differential Revision: https://secure.phabricator.com/D4330
2013-01-03 06:01:53 -08:00
epriestley
0902543fc8 Port MySQL settings to PHP
Summary:
  - Ports MySQL settings to PHP.
  - Removes "mysql.retries" -- this existed only because Magic Numbers Are Bad, but there is no concievable reason it should ever be set to anything other than 3.
  - Introduced "Hidden" config, which isn't visible from the web (for SaaS, we'll just mark anything with secret keys as "hidden").
  - Introduced "Masked" config, which will be masked in darkconsole once that gets updated.
  - "Hidden" implies "Masked" and "Locked".
  - Moved "storage.default-namespace" here -- it probably makes more sense than core; this was my bad in T2255.
  - Put cancel button back for hidden/locked config.
  - Introduce 'class' config type.

Test Plan: Viewed MySQL options. None are editable.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4326
2013-01-03 06:01:14 -08:00
Ricky Elrod
3b3808c476 Add the rest of the "Debug/Developer" config group.
Summary:
- Adds the rest of the group as per T2255.
- Adds a pht() around the `$developer_warning` in `PhabricatorStandardPageView`.

Test Plan:
- Viewed new config options.
- Triggered a fake warning to make sure I didn't break error callouts.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4333
2013-01-03 05:48:21 -08:00
Ricky Elrod
f84e0ca533 Add the "Security" config group options.
Summary: Added all the "Security" group options listed in T2255.

Test Plan:
- Looked at all the options.
- Tested validation on `security.alternate-file-domain`

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4334
2013-01-03 05:46:37 -08:00
Ricky Elrod
7b2ab1a4bc Add the "Extending Phabricator" config group.
Summary: Refs T2255 and takes care of the "EXTENDING PHABRICATOR" group thereof.

Test Plan: Looked at each of the new options.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4325
2013-01-02 15:52:36 -08:00
Ricky Elrod
cad546301d Add pht() to two strings in Core settings.
Summary: See title.

Test Plan: Checked that the strings still rendered.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4327
2013-01-02 15:52:19 -08:00
epriestley
962b432bfb Move LDAP config into PHP
Summary: This config section is weak (poorly documented) and inconsistent (keys with "_" instead of "-") but I'm going to keep punting on improving it until after T1536.

Test Plan: Loaded, examined LDAP config.

Reviewers: btrahan, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4322
2013-01-02 14:04:05 -08:00
epriestley
a5c7286df7 Don't issue unnecssary query when loading user profile images
Summary: Fixes T2264.

Test Plan: Loaded profile.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2264

Differential Revision: https://secure.phabricator.com/D4324
2013-01-02 14:03:36 -08:00
epriestley
a3fdb20a8e Move GC into PHP and simplify it
Summary:
  - Move GC options into PHP.
  - Remove the "run at" and "run for" options. The GC daemon doesn't actually do any table scans, is very gentle, and runs for like 3 seconds per day in any normal install. Just limit it to running once every 4 hours when it's caught up and call it a day.

Test Plan: Edited GC options.

Reviewers: btrahan, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4321
2013-01-02 14:03:08 -08:00
epriestley
9cef013def Allow configuration options to be locked
Summary: Some config shouldn't reasonably be edited from the web interface because it immediately torpedoes the install if you make a mistake. Block edits to "locked" config.

Test Plan: Tried to edit locked config, got denied. Viewed locked config on edit and list screens.

Reviewers: codeblock, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4320
2013-01-02 14:02:43 -08:00
epriestley
db21319b39 Specialize list<string> in config
Summary: Specialize editing, display and validation of list<string> options.

Test Plan: Edited, viewed and validated "environment.append-paths".

Reviewers: codeblock, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4319
2013-01-02 14:02:31 -08:00
epriestley
cff043a800 Validate timezones
Summary:
Add validation for timezones, since date_default_timezone_set() returns a usable error code.

Note that we could also list all the timezones using timezone_identifiers_list(), but the list is enormous (many hundreds of entries) and impossible to use (~160 entries in "America" alone). I listed the likely US values as examples but left it as a string input text field.

Test Plan: Tried to save an invalid setting. Saved a valid setting.

Reviewers: codeblock, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4318
2013-01-02 14:02:22 -08:00
Ricky Elrod
9c41ea9609 Add some more options to the "core" group.
Summary:
Refs #2255 and completes the first group ("CORE") in @epriestley's comment
thereof.

Test Plan: Saw the new options appear in the list and save correctly.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4317
2013-01-02 06:55:16 -08:00
epriestley
ec7d799b2f Add "Core" config, with complex validation
Summary: This is more or less a copy of the validation which lives in `webroot/index.php` right now, but I don't want to wipe that out just yet because there's no way for normal users to see this new validation.

Test Plan: Tried to set "phabricator.base-uri" to crazy nonsense, was harshly rebuffed.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4316
2013-01-01 18:22:48 -08:00
epriestley
a86fd38394 Allow configuration to be explicitly validated, including validation of complex attributes
Summary:
  - Allows us to implement setup warnings for edits which don't go through the web UI, e.g. "you edited a config file and set value X to something goofy".
  - Allows us to implement more sophisticated validations, beyond basic type checks (e.g., "phabricator.base-uri" must be a URI).
  - Fixes T358 (or, close enough -- fixes it for all options which have been migrated as per T2255.

Test Plan: Set "darkconsole.enabled" to "xyz" in my config, observed setup warning. Added fake validation, observed web UI edit error.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255, T358

Differential Revision: https://secure.phabricator.com/D4315
2013-01-01 18:15:03 -08:00
epriestley
32e4a7a37f Use transactions to show edit history for Configuration
Summary: Use ApplicationTransactions in Config to create an edit history. Resolves T2256.

Test Plan: {F28477}

Reviewers: btrahan, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2256

Differential Revision: https://secure.phabricator.com/D4314
2013-01-01 18:14:41 -08:00
epriestley
25ca17da46 Show current value in configuration list; show default vs non-default values
Summary:
  - When viewing a config list, show the current effective value.
  - Add an icon showing default vs nondefault values.

Test Plan: {F28475}

Reviewers: btrahan, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4313
2013-01-01 14:11:39 -08:00
epriestley
21efc7cb64 Show all configuration defaults when editing configuration
Summary: Show the value for all loaded configuration sources.

Test Plan:
{F28469}

{F28470}

{F28471}

Reviewers: btrahan, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4312
2013-01-01 14:10:33 -08:00
epriestley
3852ca632b Display examples when editing configuratoin
Summary: Show example config values to the user when available.

Test Plan:
{F28465}
{F28466}

Reviewers: btrahan, codeblock

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2221, T2255

Differential Revision: https://secure.phabricator.com/D4311
2013-01-01 14:09:59 -08:00
epriestley
8a52a6d585 Add Disqus, Facebook, Google, GitHub auth config; AWS config
Summary: Also improve behavior for the "unknown config" warning.

Test Plan: Looked at configs, went through unknown config workflow.

Reviewers: btrahan, codeblock

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4310
2013-01-01 14:09:29 -08:00
epriestley
a3bff35b2b Add "Developer" and "Access Log" config option groups, some types
Summary:
  - Add a "developer" option group.
  - Add an "access log" option group.
  - Render the types "bool", "int" and "string" in a more tailored way.
  - Add a config check for dead config. Right now this serves as a "TODO" list of things that need to be migrated.

Test Plan: Looked at config options, setup issues. Edited bool, int, string options.

Reviewers: codeblock, btrahan

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4308
2013-01-01 14:09:17 -08:00
epriestley
c32295aab6 Improve resolution process for nonfatal setup issues
Summary:
  - When a setup issue is nonfatal (i.e., a warning), instruct the user to edit the value from the web UI instead of using `bin/config`.
  - When the user edits configuration in response to a setup issue, send them back to the issue when they're done.
  - When an issue relates to PHP configuration, link to the PHP documentation on configuration.
  - Add new-style setup check for timezone issues.

Test Plan: Mucked with my timezone config, resolved the issues I created.

Reviewers: codeblock, btrahan, vrana

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2221, T2228

Differential Revision: https://secure.phabricator.com/D4298
2012-12-30 17:04:38 -08:00
epriestley
b852f213c3 Begin moving Phabricator configuration into PHP
Summary: Ref T2255. Ref T2221. Lay the groundwork to move configuration into PHP, so we can show descriptions in the web UI, do typechecking, disable application options when an application is uninstalled, etc.

Test Plan:
{F28421}
{F28420}
{F28422}

Reviewers: codeblock, btrahan, vrana

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2221, T2255

Differential Revision: https://secure.phabricator.com/D4306
2012-12-30 15:36:06 -08:00
epriestley
023c9c19b6 Remove advice to "yum install php5-x" for RedHat
Summary: See D4295.

Test Plan: Cursory glance.

Reviewers: codeblock

Reviewed By: codeblock

CC: aran

Differential Revision: https://secure.phabricator.com/D4307
2012-12-30 15:35:19 -08:00
epriestley
cb228ed4e3 Fix write to undefined property $_hunks
Summary: Some time long in the past, this was renamed to unsavedHunks. Fixes T2249.

Test Plan: Ran `destroy_revision.php D20`, got a successful destruction.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2249

Differential Revision: https://secure.phabricator.com/D4304
2012-12-30 13:44:48 -08:00
epriestley
4f933d34f5 Improve S3 integration
Summary:
  - Fixes T2257. We wrote a 0-length file (erroneously?) and currently throw when retrieving it. This also happens if you intentionally upload an empty file. I'm not sure what happened with the image: we check for errors during the write, so its existence implies S3 told us the write was successful and then lost the data. Since this is a one-off, I'm not too worried about it. The indistinguishable case of an actually empty file is fixed, at least.
  - Writes to a directory like "phabricator/ab/cd/efgh" instead of "phabricator/abcdefgh". When I had to go look for the file on S3 it took a few minutes of scrolling since the web interface isn't very fast. Make it so a file can be located by navigating through pieces of the hash.

Test Plan: Viewed an empty file, no fatal. Viewed the file from T2257 locally, no fatal (no data either, but it's gone). Uploaded a file, saw a nice path.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2257

Differential Revision: https://secure.phabricator.com/D4303
2012-12-30 13:44:37 -08:00
epriestley
96839d35f4 Detect and raise setup warnings from within Phabricator
Summary:
This is basicaly a light version of D4286. The major problem with D4286 is that it's a huge leap and completely replaces the setup process in one step.

Instead, I want to do this:

  - Add the post-setup warnings (yellow bar with "6 unresolved warnings...").
  - Copy all setup checks into post-setup warnings (so every check has an old-style check and a new-style check).
  - Run that for a little bit and make sure it's stable.
  - Implement fatal post-setup checks (the red screen, vs the yellow bar).
  - Run that for a little bit.
  - Nuke setup mode and delete all the old checks.

This should give us a bunch of very gradual steps toward the brave new world of simpler setup.

Test Plan:
 - Faked APC setup failures, saw warnings raise.
 - Verified that this runs after restart (get + set).
 - Verified that this costs us only one cache hit after first-run (get only).

Reviewers: btrahan, codeblock, vrana, chad

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2228

Differential Revision: https://secure.phabricator.com/D4295
2012-12-30 06:37:49 -08:00
Ricky Elrod
908253f1db Fix two bugs with Config's Edit controller.
Summary:
* When we restored to the default value, we did, in fact delete the row from the
  database, but then a few lines later down, we saved it again. This patch causes
  the controller to return early on delete, like it was supposed to do to begin
  with.
* When checking the user's input value for `null` (since PHP's JSON encoder will
  return `null` on failure), check the value that the user gave, not the value
  that we default to (which is often `null` anyway). Oops.

Test Plan:
* Saved an empty text field and saw the delete work properly and NOT get
  re-added.
* Put `null` in the text field, and saved successfully.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4300
2012-12-30 06:15:51 -08:00
Ricky Elrod
a9aedc64e4 Show the default value in Config.
Summary:
As mentioned by @epriestley in an inline on D4290, we should show what happens
if the user leaves the box blank.

Test Plan: Went to edit a setting and saw the default below the text box.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, asherkin

Differential Revision: https://secure.phabricator.com/D4293
2012-12-28 11:38:05 -08:00
Ricky Elrod
a774620042 Start of a config web interface.
Summary:
This is somewhat clowny, particularly in how it handles JSON encode/decode, but
I've commented why I did things the way I did. The goal is to store minified JSON
but show pretty-printed JSON where possible, to the user editing it.

Test Plan:
* Went to /config/ and saw a list of keys from the `default` config.
* Clicked on one of them, submitted the default value successfully.
* Changed the value to invalid JSON and got a decent error.
* Changed the value to valid JSON and checked the DB to confirm it saved.
* Confirmed the DB values were minified.
* Confirmed the user-facing values were pretty-printed where they could be.
* Confirmed that PHIDs were getting assigned properly and that isDeleted
  properly defaulted to false/0.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2246

Differential Revision: https://secure.phabricator.com/D4290
2012-12-27 15:21:21 -08:00
Ricky Elrod
ec57678f70 Mark deleted Phriction pages as closed.
Summary:
This replaces D4042 and gives you the option to search for existing Phrication
documents only.

Test Plan:
# Reindexed ALL THE THINGS, saw existing documents show up in search in all cases.
# Deleted a document and saw it only show up when "Open and Closed Documents" are
shown.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4289
2012-12-26 17:10:38 -08:00
epriestley
a88b69a4b6 Add a "setup" cache
Summary:
See T2062. This cache allows us to essentially implement this sort of block:

  if (this_code_has_not_run_since_the_last_server_restart()) {
    ...
  }

This will let us do setup checks automatically (i.e., without a specialized setup mode) without imposing hundreds of milliseconds of `git submodule status` and similar checks on every page load, even if an install does not have APC.

Broadly, the major goals here are:

  - Reduce user errors and support costs related to misconfiguration (e.g., failure to update submodules).
  - Simplify setup and configuration (remove 'phabricator.setup', remove/reduce PHABRICATOR_ENV).
  - Move as much configuration to the web as possible (required for SaaS).

Test Plan:
Added this block to webroot/index.php:

  $cache = PhabricatorCaches::getSetupCache();
  $result = $cache->getKeys(array('x'));
  if (empty($result['x'])) {
    phlog('Cache miss + set.');
    $cache->setKeys(array('x' => 'y'));
  } else {
    phlog('Cache hit.');
  }

Verified it used APC correctly.
Disabled APC and verified it degraded to a reasonable disk-based behavior.

If we miss both of these we end up with no actual caching, but that's the best we can do. This code will also run too early in setup for it to be appropriate to raise exceptions out of this pathway -- later on, we can raise a warning that APC is not installed.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2227, T2062

Differential Revision: https://secure.phabricator.com/D4281
2012-12-25 06:09:51 -08:00
vrana
f2639e528c Fix displaying of user status
Summary:
This fixes two separate issues:

# `getTextStatus()` is used for machine readable data in handles and user.info method. Broken since D3810.
# Status may contain date. Broken since beginning but masked by the fact that CSS ignores unknown class names.

Test Plan:
Displayed revision with reviewer away.
Called `user.addstatus`.
Edited status in calendar.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

CC: nh, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4275
2012-12-21 16:30:36 -08:00
vrana
1264e38541 Fix double escaping in calendar
Test Plan: Used `<img` as status description.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T139

Differential Revision: https://secure.phabricator.com/D4276
2012-12-21 16:25:33 -08:00
vrana
1c2e7e5daa Fix Paste translation
Summary: This syntax is extremely stupid, I'll probably rewrite it later.

Test Plan:
  pht('%s Line(s)', number_format(1000));

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4272
2012-12-21 15:39:25 -08:00
epriestley
8f0bab73ef Support search indexing in ApplicationTransaction
Summary: Hook D4261 into ApplicationTransaction

Test Plan: Edited a mock; searched for it.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4262
2012-12-21 14:21:50 -08:00
epriestley
f6b1964740 Improve Search architecture
Summary:
The search indexing API has several problems right now:

  - Always runs in-process.
    - It would be nice to push this into the task queue for performance. However, the API currently passses an object all the way through (and some indexers depend on preloaded object attributes), so it can't be dumped into the task queue at any stage since we can't serialize it.
    - Being able to use the task queue will also make rebuilding indexes faster.
    - Instead, make the API phid-oriented.
  - No uniform indexing API.
    - Each "Editor" currently calls SomeCustomIndexer::indexThing(). This won't work with AbstractTransactions. The API is also just weird.
    - Instead, provide a uniform API.
  - No uniform CLI.
    - We have `scripts/search/reindex_everything.php`, but it doesn't actually index everything. Each new document type needs to be separately added to it, leading to stuff like D3839. Third-party applications can't provide indexers.
    - Instead, let indexers expose documents for indexing.
  - Not application-oriented.
    - All the indexers live in search/ right now, which isn't the right organization in an application-orietned view of the world.
    - Instead, move indexers to applications and load them with SymbolLoader.

Test Plan:
  - `bin/search index`
    - Indexed one revision, one task.
    - Indexed `--type TASK`, `--type DREV`, etc., for all types.
    - Indexed `--all`.
  - Added the word "saboteur" to a revision, task, wiki page, and question and then searched for it.
    - Creating users is a pain; searched for a user after indexing.
    - Creating commits is a pain; searched for a commit after indexing.
    - Mocks aren't currently loadable in the result view, so their indexing is moot.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: 20after4, aran

Maniphest Tasks: T1991, T2104

Differential Revision: https://secure.phabricator.com/D4261
2012-12-21 14:21:31 -08:00
epriestley
aae5f9efd3 Implement a more compact, general database-backed key-value cache
Summary:
See discussion in D4204. Facebook currently has a 314MB remarkup cache with a 55MB index, which is slow to access. Under the theory that this is an index size/quality problem (the current index is on a potentially-384-byte field, with many keys sharing prefixes), provide a more general index with fancy new features:

  - It implements PhutilKeyValueCache, so it can be a component in cache stacks and supports TTL.
  - It has a 12-byte hash-based key.
  - It automatically compresses large blocks of data (most of what we store is highly-compressible HTML).

Test Plan:
  - Basics:
    - Loaded /paste/, saw caches generate and save.
    - Reloaded /paste/, saw the page hit cache.
  - GC:
    - Ran GC daemon, saw nothing.
    - Set maximum lifetime to 1 second, ran GC daemon, saw it collect the entire cache.
  - Deflate:
    - Selected row formats from the database, saw a mixture of 'raw' and 'deflate' storage.
    - Used profiler to verify that 'deflate' is fast (12 calls @ 220us on my paste list).
  - Ran unit tests

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4259
2012-12-21 14:17:56 -08:00
epriestley
62bc3373e5 Fix error with inline comments on images
Summary: This data structure is a `dict<int, list<Comment>>` now, where the `int` is the line number.

Test Plan:
  - Created a diff changing an image.
  - Added inline comments on the left and right sides of the diff.
  - Saw some exceptions and general sadness.
  - Applied patch.
  - Reloaded page.
  - Everything worked great.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4264
2012-12-21 14:16:00 -08:00
vrana
394340fd8f Rename setViewer() to setUser() in feed.query
Summary: D4270 missed a spot I think.

Test Plan: Called it.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4271
2012-12-21 14:04:11 -08:00
Bob Trahan
479ed08ee1 fix fatal - setViewer => setUser
Summary: D4249 missed a spot I think.

Test Plan: no more fatal

Reviewers: vrana, epriestley

Reviewed By: vrana

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4270
2012-12-21 13:59:27 -08:00
Bob Trahan
2b0526e9f9 one more phame tweak for better social sharing -- make sure $uri is the full uri
Summary: basically when we're on a page we have a URIPath so set that and pass it over. I wasn't super duper happy with this but it seems to be the best way to pass this data.

Test Plan: verified the og:url was correct on my dev instance of phacility blog for both the main blog and individual post view

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4269
2012-12-21 13:46:23 -08:00
vrana
2cc7f82ece Move Conduit methods inside applications
Test Plan:
/conduit/
/conduit/method/arcanist.projectinfo/
Call method

  $ echo '{}' | arc call-conduit user.whoami

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4268
2012-12-21 12:21:59 -08:00
vrana
96e5264f05 Rename setViewer() to setUser() in views
Summary: I prefer consistency.

Test Plan: /paste/

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4249
2012-12-21 12:18:55 -08:00
Bob Trahan
9c27c7ab60 tweak phame blog template a bit for better Facebook integration
Summary: this makes it more sensical when you hit "share" from a bookmarklet or cut and paste a link into FB, basically by having post-specific data when sharing a post.

Test Plan: looked at generated HTML on my test blog

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4266
2012-12-21 11:29:31 -08:00
epriestley
a2367ddf75 Minor, fix a bad merge on my part.
Auditors: btrahan
2012-12-21 07:58:31 -08:00
epriestley
b116861b16 Add draft support to ApplicationTransactions
Summary:
When previewing, save drafts. When loading objects, restore drafts if they are available.

Depends on: D665

Test Plan:
  - Viewed a Mock.
  - Typed text into the comment box.
  - Reloaded the page.
  - Text still there.
  - Hit submit, got my comment.
  - Reloaded the page.
  - Draft correctly deleted.
  - Repeated for Macros.

Reviewers: btrahan, chad, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4252
2012-12-21 05:57:14 -08:00
epriestley
0fd77783a4 Add previews to ApplicationTransaction
Summary:
Implements previews for Macros and Pholio.

(Design is nonfinal -- kind of split the difference between `diff_full_view.png`, laziness, and space concerns. Next couple diffs will add more stuff here.)

Test Plan: {F28055}

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran, vrana

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4246
2012-12-21 05:51:33 -08:00
epriestley
141318fd01 Fix a Maniphest issue where multiple saved copies of a query break the menu
Summary: Fixes T2210. Recently, we require unique keys on menu items, but it's currently possible in Maniphest to save the same custom query under multiple names. Avoid exploding in this case (we'll hide the duplicates). This isn't a great fix, but makes Maniphest usable again.

Test Plan: Saved the same query twice, laoded page, got exception, applied patch, loaded page, saw duplicate query stripped.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2210

Differential Revision: https://secure.phabricator.com/D4247
2012-12-21 05:42:38 -08:00
vrana
9358b08b46 Use "Diff <id>" instead of "D<id>" in changeset view
Summary: We use "D<id>" for revisions.

Test Plan: Looked at revision.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4258
2012-12-20 18:28:34 -08:00
Bob Trahan
a652ca462e finish implementing N and W tooltips and use W in differential
Summary: 'cuz new fluid layouts require the westerlyness. Looks like D4126 started the N and W implementation but didn't finish it...? note I had to do the shifting of the 5 pixels in javascript; using the CSS didn't work for me in chrome.

Test Plan: uiexample, and hoping it goes well when deployed in prod for differential case

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T2211

Differential Revision: https://secure.phabricator.com/D4257
2012-12-20 18:23:35 -08:00
vrana
3452315c7c Save absolute path when linting git-svn repo
Test Plan: Dumped `$this->svnRoot` in git-svn repo.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4255
2012-12-20 18:13:44 -08:00
vrana
800be357e8 Order repositories in Diffusion from oldest
Summary: Same to ordering in Repository List.

Test Plan: /diffusion/

Reviewers: epriestley, nh

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4251
2012-12-20 15:49:37 -08:00
vrana
ebe2a58f8a Use user's timezone in repo history
Test Plan: Looked at repo overview, repo history and commit detail.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4250
2012-12-20 15:16:05 -08:00
vrana
ef214e94ce Move setUser() to AphrontView
Summary: This is used in every other view.

Test Plan: Browsed around.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4248
2012-12-20 14:49:52 -08:00
Nick Harper
45b66be96d Fix paste (again)
Summary:
I messed up D4244 (and didn't test it properly) - this change should load
the raw content so we can use it.

Test Plan: use the conduit console and actually test the paste conduit methods

Reviewers: vrana, epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4245
2012-12-20 13:14:18 -08:00
Nick Harper
2f32aebf6f Fix paste
Summary:
The caching introduced by rP7e37eb48273eef87e6e6811703fb5d85a3e07a81
broke the use of PhabricatorPaste::getContent() for forking/editing
pastes and downloading pastes with arc paste. I think this fixes all
the appropriate callsites.

Test Plan: fork a paste in the web ui

Reviewers: vrana, epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4244
2012-12-20 12:24:34 -08:00
epriestley
eeb97db283 Fix EncodeQ implementation in PHPMailer, and provide SSL/TLS options
Summary:
See f5c2a2ab4b (commitcomment-2333247)

Copy of working implementation from PHPMailerLite.

Also expose the SSL/TLS options.

Test Plan: Switched to this mailer, configured Gmail SMTP, sent email. Verified email arrived intact.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran, mbeck

Differential Revision: https://secure.phabricator.com/D4239
2012-12-20 11:11:15 -08:00
epriestley
6dd0169873 Fix various issues with SSH receivers
Summary:
  - Original command is in SSH_ORIGINAL_COMMAND, not normal argv.
  - Use PhutilShellLexer to parse it.
  - Fix a protocol encoding issue with ConduitSSHWorkflow. I think I'm going to make this protocol accept multiple commands anyway because SSH pipes are crazy expensive to build (even locally, they're ~300ms).

Test Plan: With other changes, successfully executed "arc list --conduit-uri=ssh://localhost:2222".

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T550

Differential Revision: https://secure.phabricator.com/D4232
2012-12-19 11:11:32 -08:00
epriestley
e78898970a Implement SSHD glue and Conduit SSH endpoint
Summary:
  - Build "sshd-auth" (for authentication) and "sshd-exec" (for command execution) binaries. These are callable by "sshd-vcs", located [[https://github.com/epriestley/sshd-vcs | in my account on GitHub]]. They are based on precursors [[https://github.com/epriestley/sshd-vcs-glue | here on GitHub]] which I deployed for TenXer about a year ago, so I have some confidence they at least basically work.
    - The problem this solves is that normally every user would need an account on a machine to connect to it, and/or their public keys would all need to be listed in `~/.authorized_keys`. This is a big pain in most installs. Software like Gitosis/Gitolite solve this problem by giving you an easy way to add public keys to `~/.authorized_keys`, but this is pretty gross.
    - Roughly, instead of looking in `~/.authorized_keys` when a user connects, the patched sshd instead runs `echo <public key> | sshd-auth`. The `sshd-auth` script looks up the public key and authorizes the matching user, if they exist. It also forces sshd to run `sshd-exec` instead of a normal shell.
    - `sshd-exec` receives the authenticated user and any command which was passed to ssh (like `git receive-pack`) and can route them appropriately.
    - Overall, this permits a single account to be set up on a server which all Phabricator users can connect to without any extra work, and which can safely execute commands and apply appropriate permissions, and disable users when they are disabled in Phabricator and all that stuff.
  - Build out "sshd-exec" to do more thorough checks and setup, and delegate command execution to Workflows (they now exist, and did not when I originally built this stuff).
  - Convert @btrahan's conduit API script into a workflow and slightly simplify it (ConduitCall did not exist at the time it was written).

The next steps here on the Repository side are to implement Workflows for Git, SVN and HG wire protocols. These will mostly just proxy the protocols, but also need to enforce permissions. So the approach will basically be:

  - Implement workflows for stuff like `git receive-pack`.
  - These workflows will implement enough of the underlying protocol to determine what resource the user is trying to access, and whether they want to read or write it.
  - They'll then do a permissons check, and kick the user out if they don't have permission to do whatever they are trying to do.
  - If the user does have permission, we just proxy the rest of the transaction.

Next steps on the Conduit side are more simple:

  - Make ConduitClient understand "ssh://" URLs.

Test Plan: Ran `sshd-exec --phabricator-ssh-user epriestley conduit differential.query`, etc. This will get a more comprehensive test once I set up sshd-vcs.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603, T550

Differential Revision: https://secure.phabricator.com/D4229
2012-12-19 11:08:07 -08:00
epriestley
db89e23761 Make Repositories partially policy-aware
Summary: Small step toward repository hosting. No user-visible changes.

Test Plan: Looked at repositories in Diffusion.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D4227
2012-12-19 11:07:06 -08:00
Bob Trahan
fcc5366eff fix differential + diffusion for showing generated files
Summary: in the re-factor quest this got broken. Turns out NewLines (aka $this->new in the parser) gets updated right up until the very end for showing text changes so instead pass over the total line count to the renderer to get this codepath right.

Test Plan: showed content of some generated files in diffusion and all was well

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2204

Differential Revision: https://secure.phabricator.com/D4237
2012-12-19 10:56:00 -08:00
Nick Harper
b8d372c4bc Fix bugs when saving package changes due to commit changes
Summary:
Because of the way PhabricatorOwnersPackage works, the code to save package
changes when parsing commit changes was raising a few undefined index errors,
and was throwing an exception trying to call a method on null (because not
all of the phids related to the package had their handles loaded). This fix
doesn't load the missing handles, it just avoids trying to use them.

Test Plan:
./scripts/repository/reparse.php on a commit with path changes that triggered
a package change

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4236
2012-12-19 10:53:04 -08:00
Nick Harper
4a81ae6d6d Add data information to daemon task view
Summary:
Load the data for daemon worker tasks when viewing them, and present
the information in a useful way. This defaults to printing the json data,
but for some classes of worker it will also link to the corresponding
object, to make debugging problems with workers easier.

Test Plan:
load /daemon/task/NNN for a CommitParserWorker and a MetaMTAWorker, and
see the addition of a data field with useful content and link.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4226
2012-12-17 17:12:55 -08:00
epriestley
edd5c208a6 Make all of Drydock work on Mobile
Summary: This is probably not the most useful app to have work on mobile, but get the log view to do something fairly sensible.

Test Plan: Looked at all Drydock views in mobile.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D4224
2012-12-17 15:16:44 -08:00
vrana
cd46fd4afe Mark finished postponed linters as okay
Test Plan: Called it on a diff with postponed linters and no messages.

Reviewers: mgummelt, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4223
2012-12-17 14:55:04 -08:00
Bob Trahan
bd70693d84 tweak pager and title in basic => template skin
Summary: its a bit confusing but "newer" posts are the "previous" page and "older" posts are the "next" page. this is because newer posts are those with higher ids. also make the title be the title of the post if we have an actual post.

Test Plan: set page limit to 5 and got somewhat sensical results (note this pagination seems to break with my test data set where there's fun gaps in the contiguity of the ids in a given blog) viewed an actual post and noted the page title was the post title

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4222
2012-12-17 14:48:47 -08:00
epriestley
53c1483ee5 Make most Drydock web interfaces work with mobile
Summary: The logs bits still need some work but add crumbs/lists to everything else. Also build a propery DrydockResourceQuery.

Test Plan: Looked at lease list/detail; resource list/detail.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D4221
2012-12-17 14:47:21 -08:00
epriestley
ee392ada93 Add user parameter to differential.createrevision
Summary: arc incorrectly passes a "user" parameter to differential.createrevision (long ago, we respected it, I think). After D4191 this fatals. Provide a stub call until the next version bump.

Test Plan: inspection

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4220
2012-12-17 14:45:11 -08:00
epriestley
97045077c7 Show Drydock resource leases, add DrydockLeaseQuery, allow reuse of working copies
Summary: Minor updates to Drydock things to make them work better. In particular, after this patch working copies are correctly allocated or reused.

Test Plan: Ran "reparse.php --harbormaster <derp derp>", saw reuse of working copies when unleased resources were avilable.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D4216
2012-12-17 13:53:32 -08:00
epriestley
adfe84ffce Add HarbormasterRunnerWorker, for running CI tests
Summary:
This is very preliminary and doesn't actually do anything useful. In theory, it uses Drydock to check out a working copy and run tests. In practice, it's not actually capable of running any of our tests (because of complicated interdependency stuff), but does check out a working copy and //try// to run tests there.

Adds various sorts of utility methods to various things as well.

Test Plan: Ran `reparse.php --harbormaster --trace <commit>`, observed attempt to run tests via Drydock.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2015, T1049

Differential Revision: https://secure.phabricator.com/D4215
2012-12-17 13:43:26 -08:00
vrana
79b241b31d Render warning instead of error for postponed lint
Test Plan: {F27152, size=full}

Reviewers: epriestley

Reviewed By: epriestley

CC: ypisetsky, aran, Korvin

Differential Revision: https://secure.phabricator.com/D4195
2012-12-17 12:30:42 -08:00
vrana
94d42b6313 Throw on invalid Conduit method parameters
Summary: NOTE: This may break stuff.

Test Plan:
  $ echo '{}' | arc call-conduit conduit.ping
  $ echo '{"x": 1}' | arc call-conduit conduit.ping

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4191
2012-12-17 12:30:14 -08:00
vrana
a0e93fd4c4 Provide a separate error code for invalid Conduit calls
Summary: I plan to use this in Arcanist.

Test Plan:
  $ echo '{}' | arc call-conduit x

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4192
2012-12-17 12:29:51 -08:00
epriestley
86353462cd Minor, add some missing pht(). See D4200.
Auditors: btrahan
2012-12-16 16:36:22 -08:00
epriestley
221562b294 Modernize file uploads
Summary:
Modernizes file uploads. In particular:

  - Adds a mobile menu, with an "Upload File" item.
  - Adds crumbs to the list view, detail view and upload view.
  - Adds "Upload File" action to crumbs.
  - Moves upload file to a separate page.
  - Removes the combined upload file + recent files page.
  - Makes upload file use a normal file control by default (works on mobile).
  - Home page, file list and file upload page are now global drop targets which accept files dropped anywhere on them. Dragging a file into the window shows a mask and an instructional message.
    - User education on this is a little weak but I think that's a big can of worms?
  - Fixes a bug where dropping multiple files into a Remarkup text area produced bad results (resolves T2190).

T879 is related, although it's specifically about Maniphest. I've declined to make global drop targets yet there because there are multiple drop targets on the page with different meanings. That UI needs updating in general.

@chad, do we have an "upload" icon (counterpart to "download")?

Test Plan: Uploaded files in Maniphest, Differential, Files, and from Home. Dragged and dropped multiple files into Differential. Used crumbs, mobile.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2190

Differential Revision: https://secure.phabricator.com/D4200
2012-12-16 16:34:01 -08:00
epriestley
7e37eb4827 Provide a highlighter cache for Paste
Summary:
D4188 adds a preview of Paste contents to the list, but gets slow for large lists if you have Pygments installed since it has to spend ~200ms/item highlighting them. Instead, cache the highlighted output.

  - Adds a Paste highlighting cache. This uses RemarkupCache because it has automatic GC and we don't have a more generalized cache for the moment.
  - Uses the Paste cache on paste list and paste detail.
  - Adds a little padding to the summary.
  - Adds "..." if there's more content.
  - Adds line count and language, if available. These are hidden on Mobile.
  - Nothing actually uses needRawContent() but I left it there since it doesn't hurt anything and is used internally (I thought the detail view did, but it uses the file content directly, and must for security reasons).

Test Plan:
{F27710}

  - Profiled paste list, saw good performance and few service calls.
  - Viewed paste.
  - Viewed raw paste content.

Reviewers: codeblock, btrahan, chad

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4204
2012-12-16 16:33:42 -08:00
epriestley
c65468371f Modernize file detail view
Summary:
Use modern elements for file detail view.

For the "Technical Details", maybe we should implement a disclosure triangle element? I'd guess there are other cases we could use it.

This makes two small practical changes:

  - We show "Delete File" even if you can't delete it; I'm going to align this properly with CAN_EDIT shortly.
  - We no longer show the feature discovery hint about using "arc download".

Test Plan:
{F27179}
{F27180}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4199
2012-12-16 16:33:24 -08:00
epriestley
6f0c87269b Modernize Files lists
Summary: Update to new UI stuff, prepare for mobile.

Test Plan: {F27167}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4198
2012-12-16 16:33:02 -08:00
Ricky Elrod
6f9683dc90 Add paste samples to list view.
Summary:
This adds a "body" field to `PhabricatorObjectItemView` which lets you optionally
add more information to the list view. It then uses this new field to show
samples of pastes in the paste list view.

Test Plan:
{F27147}

{F27148}

Reviewers: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4188
2012-12-16 16:28:07 -08:00
Ricky Elrod
bad576db92 Fix an exception in Ponder comment saving.
Summary:
Add a `setViewer()` so that PHID loading doesn't throw.

Also remove a period from a button because none of the others have one.

Test Plan: Saved a comment successfully.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4202
2012-12-16 12:01:43 -08:00
vrana
95a99e71c6 Require Conduit methods to be instances of ConduitAPIMethod
Test Plan:
Deleted `extends ConduitAPIMethod`, then:

  $ echo '{}' | arc call-conduit conduit.ping

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4190
2012-12-14 18:16:55 -08:00
vrana
9607642414 Display raw contents of deleted file in Diffusion
Test Plan:
Display change of deleted file.
Use **Show Raw File (Left)**.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4184
2012-12-14 17:49:18 -08:00
vrana
e4608470dd Make description in user.addstatus really optional
Summary:
Fixes:

> Column 'description' cannot be null".

Test Plan:
  $ echo '{"fromEpoch": 1, "toEpoch": 2, "status": "away"}' | arc call-conduit user.addstatus

Reviewers: btrahan, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4189
2012-12-14 16:37:31 -08:00
epriestley
e4bb9255be Allow leases to be explicitly released via web or CLI
Summary: Permit the forcible release of Drydock leases. The implementation isn't very exciting for now.

Test Plan: Released leases via web and CLI.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D4181
2012-12-14 15:42:58 -08:00
Ricky Elrod
07401cd99b Make Phriction edits show in the feed.
Summary: Add a WIKI block to the switch in PhabricatorObjectHandleData->loadObjects().

Test Plan: Went to /feed/ and saw my wiki edit stories.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4180
2012-12-13 13:35:33 -08:00
epriestley
883829e667 Improve design of PhabricatorObjectListView
Summary: See discussion in T2014. Aligns this element more closely with @chad's `frame_v3.psd` mock, and implements the icon/label element. Removes "details".

Test Plan: {F27062} {F27063} {F27064} {F27065}

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2014

Differential Revision: https://secure.phabricator.com/D4179
2012-12-13 10:59:29 -08:00
Bob Trahan
5b15f725bd differntial and diffusion design tweaks
Summary: most awesome is that differential-primary-pane no longer has a place in diffusion. less awesome is fixing the zebra striping on differential "Local Commits" view and making the font size of one of the table headers match the others.

Test Plan: looks good!

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4177
2012-12-13 10:46:41 -08:00
epriestley
406833ba90 Minor, fix a variable name after recent refactoring.
Test plan: Observed no fatal when viewing a diff which removes an image.

Auditors: btrahan
2012-12-13 09:49:03 -08:00
Bob Trahan
29730ca142 derp on a derp 2012-12-12 21:24:17 -08:00
Bob Trahan
86a106d0b1 cowboy commit -- fixing fatal I introduced from D4174
Summary: we don't always have a diff so instead set an explicit title in the controller.

Test Plan: no more fatals. grepped carefully for every call site and tested them all
2012-12-12 21:21:56 -08:00
Bob Trahan
2f82210e46 differential - lazy man's attempt at updated design
Summary: basically made the header elements for the individual panes and cleaned up the panes to make it look okay. tried to copy colors from @chad 's mocks.

Test Plan: looks good to me

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2004

Differential Revision: https://secure.phabricator.com/D4174
2012-12-12 21:00:35 -08:00
Nick Harper
e7bcdcdb94 Make differential revision ID parsing more robust
Summary:
If something that doesn't belong to any field appears in the commit message
below the differential revision field, it gets included as part of the
value for the field, which can mess up parsing.

Test Plan:
called differential.parsecommitmessage on a commit whose differential
revision field wasn't being parsed earlier (it had a line of dashes two
lines below the Differential Revision: line).

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4171
2012-12-12 20:01:42 -08:00
epriestley
cce5ebebe9 Improve Drydock's ability to allocate leases correctly
Summary:
Right now, Drydock gives out multiple leases to the same working copy and gives out leases to working copies with repository "P" in them when the user requested some other repository.

Add two callbacks:

  - `canAllocateLease()` - allows a blueprint to reject a lease on a resource because of a fundamental incompatibility, like "it's a working copy with Phabricator in it, but the lease wants a working copy with Javelin in it".
  - `shouldAllocateLease()` - allows a blueprint to reject a lease on a resource because of resource limits, like "only one active lease can own a working copy at a time".

Also cleaned up various other things.

Test Plan:
After implementing the callbacks, Drydock has the correct behavior:

  - It gives multiple leases on `localhost`, but only one lease per working-copy resource.
  - It does not grant leases on resources with repository X to requests for repository Y.

Ran `bin/drydock lease --type working-copy --repositoryID 12` and similar repeatedly and verified results in the web console.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D4166
2012-12-12 18:42:12 -08:00
epriestley
051276a96b Minor cleanups to Diffusion breadcrumbs
Summary:
  - Remove "Diffusion" crumb (redundant with application icon)
  - Put "All Repositories" in its place on the landing page.
  - Render the repository crumb as "rX" instead of "X Repository".

Test Plan: Looked at various Diffusion pages.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4173
2012-12-12 18:40:18 -08:00
Bob Trahan
9e8387175e upgrade diffusion to use modern header UI and fix a few quirks
Summary:
upgrades are CrumbsView, HeaderView, PropertyListView, and ActionListView. I had to modify CrumbsView stuff a bit to handle the "advanced" diffusion crumbs.

Quirks fixed include making file tree view show up in diffusion, the page not have extra space when the file tree is hidden, links no longer breaking once you visit files (since without the change the files always got "/" appended and thus 404'd), and a differential quirk where it read "next step:" and that colon is a no no,

Test Plan: played around in diffusion and differential

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, chad

Maniphest Tasks: T2048, T2178

Differential Revision: https://secure.phabricator.com/D4169
2012-12-12 17:50:42 -08:00
epriestley
239eca13d7 Fix fatal in Maniphest when viewing "show details" of a task description edit
Summary:
Clicking "show details" of a task description change in Maniphest currently throws an exception about the markup engine.

Since we don't actually need the engine an alternate fix would be "if ($this->markupEngine) { $renderer->setMarkupEngine($this->markupEngine); }" but we have one at the ready so just provide it. This should become part of the Transactions stuff anyway.

Test Plan: Clicked "show details".

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4167
2012-12-12 17:15:51 -08:00
Nick Harper
0ba7d34f97 Allow phabricator to manage repositories
Summary:
This adds a configuration option for repositories to be marked as managed
by phabricator, which is then used by the pullLocal daemon to try to recover
from some errors it runs into.

Test Plan: Set a bogus uri for a repo, saw that the pullLocal daemon fixed it.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3680
2012-12-12 14:43:09 -08:00
epriestley
d1429488cd Show lease and resource attributes in web view for Drydock
Summary: Show attributes on the view pages.

Test Plan: {F26985} {F26986}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D4165
2012-12-12 07:36:53 -08:00
Bob Trahan
a7f4103f51 make PonderQuestionQuery policy aware
Summary: wanted to play with some policy stuff as its been a bit. Turns out you can't edit questions so this is very silly "so long as you are a user you can view it" policy. also sorry if you have a diff or twelve out for this in your sandbox(es).

Test Plan: loaded up ponder and clicked about

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2113

Differential Revision: https://secure.phabricator.com/D4163
2012-12-11 18:03:16 -08:00
epriestley
4041a7e0f6 Add ApplicationTransaction handling for transactions with no effect
Summary:
When a user submits an action with no effect (like an empty comment, an "abandon" on an already-accepted revision, or a "close, resolved" on a closed task) we want to alert them that their action isn't effective. These warnings fall into two general buckets:

  - User is submitting two or more actions, and some aren't effective but some are. Prompt them to apply the effective actions only.
    - A special case of this is where the only effective action is a comment. We provide tailored text ("Post Comment") in this case.
  - User is submitting one action, which isn't effective. Tell them they're out of luck.
    - A special case of this is an empty comment. We provide tailored text in this case.

By default, the transaction editor throws when transactions have no effect. The caller can then deal with this, or use `PhabricatorApplicationTransactionNoEffectResponse` to provide a standard dialog that gives the user information as above. For cases where we expect transactions to have no effect (notably, "edit" forms) we just continue on no-effect unconditionally.

Also fix an issue where new, combined or filtered transactions would not be represented properly in the Ajax response (i.e., return final transactions from `applyTransactions()`), and translate some strings.

Test Plan:
  - Submitted empty and nonempy comments in Macro and Pholio.
  - Submitted comments with new and existing "@mentions".
  - Submitted edits in both applications.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T912, T2104

Differential Revision: https://secure.phabricator.com/D4160
2012-12-11 17:27:40 -08:00
epriestley
dd669c6d4e Make AphrontProxyResponse reduce to a real response instead of building a string
Summary: Currently, AphrontProxyResponse is expected to build a string. This prevents some response types (like Dialog) from being proxied, because they have special rules. Instead, make proxy responses reduce into a non-proxied response so it's possible to proxy any type of response and hit all the normal rules for it.

Test Plan: Built a proxied DialogResponse on top of this.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104, T912

Differential Revision: https://secure.phabricator.com/D4159
2012-12-11 17:27:25 -08:00
Bob Trahan
c970f7e89c refactor pass 2 of N on DifferentialChangesetParser and bonus bug fix
Summary: pull out some more stuff from the TwoUp renderer that's generically useful. also clean up $xhp variable and add a get method for the $coverage. Finally, fix T2177 while I'm in here.

Test Plan: played around with Differential. Also opened things up in Firefox to verify T2177.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2009, T2177

Differential Revision: https://secure.phabricator.com/D4161
2012-12-11 17:16:11 -08:00
epriestley
a6aa8f746f Implement "USER" policy
Summary: I thought I'd already implemented this, but hadn't. Implement a "USER" policy -- a USER phid means only that user has the capability.

Test Plan: Looked at macros as a user other than the comment owner.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4155
2012-12-11 17:16:05 -08:00
epriestley
03a1148480 Restore Maniphest to use comma-style lists for subscribers, projects
Summary: D4153 made these render with newlines between items; use commas instead.

Test Plan: {F26950}

Reviewers: btrahan, chad, vrana

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4162
2012-12-11 17:15:59 -08:00
vrana
40e3aadc76 Parse Conflicts field in commit message
Summary:
Git adds it automatically.

I don't like this solution much because there could be other unknown fields appended to the end of the commit message which will break parsing.

Test Plan:
Reparsed commit ending with:

> Differential Revision: ...
> Conflicts: ...

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4157
2012-12-11 16:52:14 -08:00
Bob Trahan
bfc5bb7c78 change DifferentialRevisionDetailView to use newer fangled UI abstractions
Summary: actions are still a bit messy - unsatisfactory icons (T2013 will help!)

Test Plan: viewed diffs - they look good

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T2007

Differential Revision: https://secure.phabricator.com/D3904
2012-12-11 14:59:27 -08:00
epriestley
571ec81dd9 Modernize the top half of Maniphest
Summary:
Use modern elements: crumbs, header, action list, property list, tags.

No functional changes.

Test Plan: {F26934}

Reviewers: chad, btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4153
2012-12-11 14:03:16 -08:00
epriestley
4a3d50bcb5 Improve overflow behavior of Timeline view
Summary:
For text like "MMM", make the right parts of the element scroll.

Also fixed a couple of 1px issues here and there.

Test Plan: Added, viewed UIExamples.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4152
2012-12-11 14:02:51 -08:00
epriestley
d2a5ee4fa4 Render application transactions via Ajax
Summary:
When possible, render application transactions via Ajax. Instead of reloading the page when the response returns, append new transactions to the transaction view.

Scroll the window to the new transactions, animate them in, and clear the form to make this interaction feel reasonable.

When editing transactions, fade them in but do not scroll to them (i.e., don't disrupt the user's position).

Test Plan: Edited and appended transactions via Ajax. Observed fade in animations and scroll behavior. Clicked anchors to verify proper anchor accounting.

Reviewers: vrana, btrahan, chad

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4151
2012-12-11 14:02:29 -08:00
epriestley
025411990b Apply ApplicationTransaction edits and deletes via Ajax if available
Summary: When possible, replace the edited or deleted transaction inline using Ajax.

Test Plan: Repeatedly edited and deleted transactions. Clicked their anchors to verify anchors were correctly preserved.

Reviewers: vrana, btrahan, chad

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1082

Differential Revision: https://secure.phabricator.com/D4150
2012-12-11 14:02:12 -08:00
epriestley
26dd2a0eef Allow ApplicationTransaction comments to be edited and deleted
Summary:
Allows you to edit or delete comments in appplications which support ApplicationTransactions.

UI/UX stuff:

  - The dialogs are rough but I want to do a dialog design pass more generally, @chad has some mocks.
  - When you add new mentions via edit, they don't currently count as mentions. I'm not sure what I want to do about this.
  - When you edit or delete a comment, we do not publish any notifications about it. I think this is reasonable.
  - I didn't separate "delete" out versus "edit"; I assume it will be reasonably intuitive that deleting all the text deletes effectively deletes the comment. I also want to discourage deletion somewhat (we still show the transaction, just show that the comment has been deleted).

Test Plan:
Transaction view, note "Edit" and "Edited" links:

{F26914}

Edit view, has some design issues but I want to do a pass on dialogs in general:

{F26915}

History view:

{F26913}

Reviewers: vrana, btrahan, chad

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1082

Differential Revision: https://secure.phabricator.com/D4149
2012-12-11 14:01:51 -08:00
epriestley
93938765c3 Lay in more styles from "diff_full_view.png"
Summary: Aligns more styles to the `diff_full_view.png` mock.

Test Plan: {F26859}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4142
2012-12-11 14:01:35 -08:00
epriestley
0b9c54a6bb Detect missing 'params' in Conduit calls
Summary:
Suhosin has about 50 options for filtering input variables, doucmented here:

http://www.hardened-php.net/suhosin/configuration.html

The default behavior of Suhosin is to drop the variable entirely if it violates any of the rules, then continue with the request. It doesn't affect 'php://input' and doesn't drop other variables, so it evades existing detection, and we can't figure out that it's happened at runtime. We could add blanket checks (Suhosin enabled + suhosin.filter.action set to nothing means this may happen, and will be undetectable if it does happen) but can't tailor a check or recovery to this specific problem.

Instead, raise a better error in the specific case where we encounter this, which is Conduit calls of "arc diff" of files over 1MB (the default POST limit). In these cases, Suhosin drops the variable entirely. If there is no 'params', scream. We never encounter this case normall (`arc`, including `arc call-conduit`, always sends this parameter) although other clients might omit it. The only exception is the web console with `conduit.ping`, which submits nothing; make it submit something so it keeps working.

See also https://github.com/facebook/phabricator/issues/233#issuecomment-11186074

Test Plan: Brought up a Debian + Suhosin box, verified the behavior of Suhosin, made requests with and without 'params'.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4144
2012-12-11 14:01:18 -08:00
epriestley
ba7723d905 Modernize Macro application
Summary: Adds feed, email, notifications, comments, partial editing, subscriptions, enable/disable, flags and crumbs to Macro.

Test Plan:
{F26839}
{F26840}
{F26841}
{F26842}
{F26843}
{F26844}
{F26845}

Reviewers: vrana, btrahan, chad

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2157, T175, T2104

Differential Revision: https://secure.phabricator.com/D4141
2012-12-11 14:01:03 -08:00
epriestley
4081579e79 Add feed integration to generic transactions
Summary: Publish feed stories, including from Pholio. Actual stories are somewhat garbage but it's all display-time; I'm going to do a pass on feed in general.

Test Plan: {F26832}

Reviewers: btrahan, chad, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4140
2012-12-11 14:00:21 -08:00
epriestley
1d5ace45bd Add mail support to generic transactions
Summary:
  - Adds mail support to the generic transaction construct.
  - Restores mail support to Pholio (now much improved; the mails are actually useful).

Test Plan: Updated a Pholio mock, got mail.

Reviewers: btrahan, chad, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4139
2012-12-11 14:00:07 -08:00
epriestley
7341c74276 Add "via", timestamps and anchors to new timeline/transaction view
Summary: I got rid of the "#4" and just linked the timestamps.

Test Plan: {F26826}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4138
2012-12-11 13:59:51 -08:00
epriestley
1761abcbfc Make timeline view prettier
Summary: Aligns the timeline view more closely with the `diff_full_view.png` mock.

Test Plan:
Desktop:

{F26822}

Mobile:

{F26823}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4137
2012-12-11 13:59:35 -08:00
epriestley
7b6fa0db12 Genericize transactions in Pholio
Summary:
Split Pholio's transaction implementation into generic and application-specific parts. Moves us toward generic transactions, with support for:

  - Editing and deleting comments.
  - Setting visibility of individual comments (I'm not a fan of this feature but we'll see).

I want to move everything to a more generic piece of infrastructure but there's very little they can share right now so adding transactions to, e.g., Paste or Macros (T2157) means massive amounts of similar code.

Tons of work left to do here, but I think it basically works. Here's a screenshot:

{F26820}

Test Plan: Made transactions in Pholio.

Reviewers: btrahan, vrana, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4136
2012-12-11 13:59:20 -08:00
vrana
0e53731d1d Expose repository info in arcanist.projectinfo
Summary: This is to reduce number of calls from Arcanist.

Test Plan: Called it from web interface.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4146
2012-12-10 15:19:09 -08:00
epriestley
6ed02e6ee8 Restore "Reply" action to Differential inline comments
Summary: Minor issue from D4117, user doesn't get passed down so inline comments are missing their "reply" link.

Test Plan: Looked at Differential, saw reply link.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4145
2012-12-10 15:12:32 -08:00
vrana
89ab9d4acb Support git svn dcommit in arc land
Test Plan: Displayed accepted Git SVN revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4124
2012-12-10 12:29:59 -08:00
hfcorriez
81d59a0b77 Fix call to undefined method for DifferentialChangesetParser::originalRight() 2012-12-10 17:47:58 +08:00
Hangjun Ye
f5c2a2ab4b Support SMTP as the mailer.
Summary:
Support SMTP as the mailer and user could turn on SMTP authentication if needed.
Import PHPMailer as PHPMailerLite doesn't support SMTP.

Make class PhabricatorMailImplementationPHPMailerAdapter final.

Test Plan: N/A

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2139

Differential Revision: https://secure.phabricator.com/D4063
2012-12-09 02:37:02 -08:00
Ricky Elrod
d704bf3a55 Fix an exception when viewing Phriction diffs.
Summary:
D4117 (which is otherwise awesome :)) requires you to `setMarkupEngine()` and
Phriction's diff rendering wasn't changed to call that with a
`PhabricatorMarkupEngine`.

Test Plan: Went to a Phriction diff page and saw it render correctly.

Reviewers: epriestley, btrahan, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4132
2012-12-08 17:36:03 -08:00
Bob Trahan
fb1a6575dc fix inline comment for new differential fluid view
Summary: we need to render left and right* classes as appropriate, plus colspan for the right

Test Plan: made inline comments and it was no longer borked

Reviewers: vrana, epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4131
2012-12-08 16:50:44 -08:00
Bob Trahan
638449b483 removed some debugging code from D4117
Summary: whoops!

Test Plan: no more debugging code

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4121
2012-12-07 18:08:27 -08:00
vrana
4f615ad2a9 Allow excluding paths from package
Summary: Resolves T2149.

Test Plan:
  $ bin/storage upgrade

# /owners/ - saw +
# /owners/package/1/ - saw +
# /owners/edit/1/ - added exclude paths, saw correct e-mail
# /rPabc123 - included paths are still highlighted and excluded not
# /owners/view/search/?path=/included/ - found
# /owners/view/search/?path=/excluded/ - not found
# owners.query - path: /included/
# owners.query - path: /excluded/
# new unit test

  PhabricatorOwnersPackage::loadAffectedPackages(
    $repository,
    array('/excluded/b.php'));

  PhabricatorOwnersPackage::loadAffectedPackages(
    $repository,
    array('/included/a.php'));

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2149

Differential Revision: https://secure.phabricator.com/D4102
2012-12-07 16:33:16 -08:00
epriestley
bf9bc885b7 Enable notifications by default
Summary: I think we've sorted out enough of the problems with these to turn them on for everyone. The real-time component remains configuration-dependent.

Test Plan: Turned off "notification.enabled", still saw notifications.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4120
2012-12-07 16:27:01 -08:00
epriestley
92678eb050 Improve style of notifications
Summary:
  - Gets about 25% of the way toward @chad's notification mocks.
    - YES: Hover states, entire notification is a click target, border, header, footer.
    - NO: Profile pictures (lazy), timestamps (want to refactor time code before introducing a new formatting style), app icons (they'd look funny without timestamps I think)
  - Deletes some old files.
  - Mostly trying to get this good enough to turn on by default.

Test Plan: Looked at notifications. Clicked some notifications.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4119
2012-12-07 16:26:43 -08:00
epriestley
0bd3f3c53e Simplify notification code
Summary:
Currently we have two different feed story classes, one for notifications and one for feed stories. However, we never actually do anything different with them -- the notification is always the same as the feed story, just shown differently. Delete the notification special case to reduce the amount of code we have supporting feed and notifications.

This is a precursor to @chad's notification designs.

Test Plan: Viewed notifications and feed, saw exactly the same result before and after the patch (but less, simpler code).

Reviewers: btrahan

Reviewed By: btrahan

CC: chad, aran

Differential Revision: https://secure.phabricator.com/D4114
2012-12-07 16:25:23 -08:00
Bob Trahan
75e8ff26f5 Refactor DifferentialChangesetParser -- pass 1 of N
Summary:
basically did my darnedest to pull out a TwoUp rendering view. Made a base class for the rendering views with "old" and "new" terminology rather than "left" and "right.

Future revisions will finish cleaning up the terminology within the DifferentialChangesetParser itself and more of the ideas within T2009.

Test Plan: been playing with differential all day

Reviewers: epriestley

Reviewed By: epriestley

CC: vrana, chad, aran, Korvin

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4117
2012-12-07 16:19:57 -08:00
Bob Trahan
42a514ec79 make repository tool fail a little less hard if daemons don't interact nicely
Summary: we were catching a specific exception; just catch all exceptions

Test Plan: viewed repository tool home page

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2155

Differential Revision: https://secure.phabricator.com/D4118
2012-12-07 16:12:16 -08:00
Bob Trahan
08172cf361 fluid diff -- more table silliness
Summary: inline comments eat up all 3 tds and no code coverage should be shown.

Test Plan: verified in FIREFOX that inline comments looked good

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4115
2012-12-07 15:53:24 -08:00
epriestley
cd2e39025e Add crumbs to Differential
Summary: Adds very basic crumbs to Differential, to prevent regression when we drop the application menu. I'll do a more proper pass at this but want to unblock landing the commit sequence for all this stuff.

Test Plan: Looked at detail view and list view, saw crumbs, clicked them.

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4111
2012-12-07 13:37:45 -08:00
epriestley
f306cab653 Use application icons for "Eye" menu and Crumbs
Summary:
Issues here:

  - Need an application-sized "eye", or a "home" icon for "Phabricator Home".
  - Some of the "apps_lb_2x" sliced images are the "_dark_" versions, not the light versions.
  - If you slice an application-sized "logout" (power off) icon and application-sized "help" (questionmark in circle) icon I can replace the current menu icons and nearly get rid of "autosprite".
  - To replace the icons on /applications/, the non-retina size is "4x", so we'd need "8x" for retina. Alternatively I can reduce the icon sizes by 50%.
  - The "Help", "Settings" and "Logout" items currently have a "glowing" hover state, which needs a variant (or we can drop it).
  - The /applications/ icons have a white hover state (or we can drop it).
  - The 1x application (14x14) icons aren't used anywhere right now, should they be? Maybe in the feed in the future, etc?
  - The "apps-2x" and "apps-large" sheets are the same image, but getting them to actually use the same file is a bit tricky, so I just left them separate for now.

Test Plan:
{F26698}
{F26699}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4108
2012-12-07 13:37:28 -08:00
epriestley
1c9a6be979 Add a breadcrumbs element
Summary:
Add a basic breadcrumbs element, and implement it in Paste.

This needs some polish but is most of the way there.

Test Plan:
{F26443}
{F26444}
{F26445}

(This element is not visible on devices.)

Reviewers: chad

Reviewed By: chad

CC: aran, btrahan

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4087
2012-12-07 13:35:17 -08:00
epriestley
f910e38ecc Provide a mobile application menu
Summary:
Adds a right-hand-side application menu, based roughly on `frame_v3.png`.

This has the same icon as the left menu until we get real design in, but is functionally reasonable.

Test Plan: {F26170} {F26169}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4061
2012-12-07 13:34:44 -08:00
epriestley
e3f6bbfff8 Refactor the main menu in preparation for a mobile application menu
Summary:
As per discussion, this primes the existing mobile menu / menu button for "phabricator" and "application" menus.

Design here is very rough, I'm just trying to get everything laid in functionally first. It's based on `frame_v3.png` but missing a lot of touches.

Test Plan:
{F26143}
{F26144}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4058
2012-12-07 13:33:03 -08:00
epriestley
dd94512837 Abstract and further merge filter menus
Summary:
  - Adds `PhabricatorMenuItemView` which is a non-hacky object representing a single menu item.
  - Adds `PhabricatorMenuView`, a collection of items.
  - Deletes some busted/old interfaces full of garbage nonsense.
  - Merges menu item styles from `aphront-side-nav-view-css` and `phabricator-nav-view-css`. These are old-style and new-style rules which got partially updated recently.
    - The new-style menus have a darker background (#ececec) than the old-style menus (#f7f7f7) so some of the highlight/hover colors weren't visible. I shuffled them around but something or other might need further adjustment.

Test Plan: looked at every menu I could

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4036
2012-12-07 13:32:14 -08:00
epriestley
20ee3003b5 Replace all instances of AphrontSideNavView with AphrontSideNavFilterView
Summary:
AphrontSideNavView is an old class which required you to do a lot of work; it was obsoleted by AphrontSideNavFilterView. Remove all direct callsites so I can clean it up.

This is a precursor to letting me render a filter menu as a dropdown menu for T1960.

Test Plan:
Examined each interface for correct filter construction and selection:

  - Browsed Diffusion
  - Browsed Differential
  - Browsed Files
  - Browsed Slowvote
  - Browsed Phriction
  - Browsed repo edit interface

Grepped for `AphrontSideNavView`. The only remaining instances are in `AphrontSideNavView` itself and `AphrontSideNavFilterView` (which currently uses it).

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4034
2012-12-07 13:30:31 -08:00
epriestley
6482876cf3 Remove the application menu
Summary:
Toss this completely as per discussion elsewhere. Basically it doesn't feel as useful as we imagined it would, and breadcrumbs from T1960 will replace the primary useful part (navigating up).

There's some more cleanup to do but I'll hit that in the next few diffs.

Closes T1828 as wontfix.

Test Plan: Viewed app + local, app-without-local interfaces. Saw no app menus.

Reviewers: chad

Reviewed By: chad

CC: aran, vrana

Maniphest Tasks: T1828, T1960

Differential Revision: https://secure.phabricator.com/D4033
2012-12-07 13:29:44 -08:00
Bob Trahan
8a6e82eba6 more fixes to fluid diff
Summary: always render "copy" column for text. this gives us consistent left alignment. also tweak css to be less wide for the copy and code coverage columns.

Test Plan: http://phabricator.dev/rP1a3bf098ae4ab4f8add4af744a6b93a257851fb0 looks even better

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4110
2012-12-07 12:37:11 -08:00
Bob Trahan
1922590f98 fix fluid diff change
Summary: when we had a change that had new data and uncommitted changes the colspan could get off. make sure to only decrement the colspan if we are actually on a new line

Test Plan: http://phabricator.dev/rP1a3bf098ae4ab4f8add4af744a6b93a257851fb0 now looks good on Firefox

Reviewers: vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2005

Differential Revision: https://secure.phabricator.com/D4109
2012-12-07 12:00:28 -08:00
vrana
b7e8c0a300 Specify content source for differential.close
Test Plan:
  $ arc close-revision 1

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4041
2012-12-07 11:35:42 -08:00
epriestley
210f8e0390 Fix leftover call to renderRightCode() from D4083
See T2165.

Auditors: btrahan
2012-12-07 08:16:47 -08:00