1. 29 Mar, 2020 1 commit
    • Daniel Stone's avatar
      LOCAL: Make 'All Users' space extremely magic · 281f22c2
      Daniel Stone authored
      
      
      Phriction's view policy is ancestral: in order to access /w/foo/bar/baz,
      you must be able to access /w/foo and /w/bar in addition to
      /w/foo/bar/baz itself.
      
      This is fine and makes life easy: by setting restrictive policies on
      top-level pages, we can lessen the risk of someone exposing information
      they shouldn't, by accidentally making
      /w/cold-fusion/secret-research/funding-meeting/2018-09-14 public, when
      the rest of the hierarchy is super locked down.
      
      Phriction also recently gained Spaces support, which is nice: rather
      than trying to lock down with groups and harmonise permissions, we can
      just move top-level wiki pages to a particular Space, and then we don't
      need to worry about groups.
      
      Our clients don't know Spaces even exist, which is great since it avoids
      us having to explain the two-tier permission model to them. The reason
      they don't know it exists is because if you can only see a single Space,
      then Phabricator hides the entire Spaces UI away from you. Great!
      
      Unfortunately one detail ruins everything: /w/ is a top-level page
      itself, it counts for permission checks, and it _must be in a Space_.
      So, there is no way to have wiki documents in mutually-invisible Spaces
      unless you also have a common Space, at which point the whole Spaces UI
      suddenly becomes very visible everywhere.
      
      In order to try to keep our wiki partitioned, but to not confuse our
      clients (and give them the chance to potentially expose confidential
      information!), we:
        - have a magic 'Visible to Everyone' space
        - actually hide that space from everyone with policies
        - hack policy filters to make this space visible to everyone _only
          for the purpose of checking policies on wiki objects_
        - only allow admins to change view/edit policies on the root wiki
          page (see comment for reason why)
      
      This actual patch can obviously never go anywhere near upstream, but on
      the other hand we should probably make them aware of the problem and see
      if they're interested in discussing a solution, which is probably just
      to bless the root page with magic semantics.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      281f22c2
  2. 12 Sep, 2019 1 commit
    • epriestley's avatar
      Remove "Moved Document from ..." notice in Phriction · a0ade503
      epriestley authored
      Summary:
      Ref T13410. See PHI1431. Currently, when you move a document in Phriction, the target shows a "This document was moved from ..." banner until it is edited.
      
      This banner isn't particularly useful, and it's distracting and it isn't obvious how to dismiss it, and making a trivial edit to dismiss it is awkward.
      
      This information is also already available in the transaction log.
      
      Just remove this banner since it doesn't really serve any clear purpose.
      
      Test Plan:
        - Moved a page in Phriction, then loaded the destination page. Before change: header banner. After change: nothing.
        - Viewed a normal (non-moved) page, saw normal behavior.
        - Reviewed transactions, saw "Moved from ..." in the timeline.
      
      Maniphest Tasks: T13410
      
      Differential Revision: https://secure.phabricator.com/D20800
      a0ade503
  3. 22 May, 2019 1 commit
    • epriestley's avatar
      When creating a Phriction document, mark initial transactions as "create"... · f6af1c43
      epriestley authored
      When creating a Phriction document, mark initial transactions as "create" transactions to fix weird email
      
      Summary:
      Ref T13289. When you create a Phriction document, you currently get an email with the whole new content as a "diff".
      
      You also get extra transactions in the email and on the page.
      
      This is because Phriction isn't on EditEngine and doesn't mark "create" transactions in a modern way. Get them marked properly to fix these obviously-broken behaviors. This can all go away once Phriction switches to EditEngine, although I don't have any particular plans to do that in the immediate future.
      
      Test Plan:
        - Created a new document, viewed email, no longer saw redundant "edited content" transaction or "CHANGES TO CONTENT" diff.
        - Updated a document, viewed email, got interdiff.
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T13289
      
      Differential Revision: https://secure.phabricator.com/D20548
      f6af1c43
  4. 10 Dec, 2018 1 commit
    • Austin McKinley's avatar
      Make it less confusing to create root-level Phriction doc · da4341cf
      Austin McKinley authored
      Summary: Without an existing root document, Phriction shows a nice little "fake" document as the landing page, which has its own nice "Edit this document" button. When showing that page, don't also render the standard "New Document" breadcrumb in the top right. That button always prompts first for a slug name, which is silly when the root document doesn't exist (because the slug name is required to be '').
      
      Test Plan: Loaded Phriction with and without a root document.
      
      Reviewers: epriestley
      
      Reviewed By: epriestley
      
      Subscribers: Korvin
      
      Differential Revision: https://secure.phabricator.com/D19863
      da4341cf
  5. 18 Sep, 2018 2 commits
    • epriestley's avatar
      (stable) Fix Phriction rendering for initial install and 404 pages · 8ab7859d
      epriestley authored
      Summary:
      Depends on D19682. Ref T13202. We currently fatal when trying to render a timeline if:
      
        - an install is fresh, so there are no pages yet, and you look at "/w/"; or
        - you're looking at a Phriction page which doesn't exist (yet) like "/w/aadsflknadsflnf/".
      
      Rendering a timeline and comment area doesn't make sense in these cases, so don't render them.
      
      Test Plan: Hit both cases described above, got "new/empty page" prompts instead of fatals.
      
      Reviewers: amckinley
      
      Maniphest Tasks: T13202
      
      Differential Revision: https://secure.phabricator.com/D19683
      8ab7859d
    • epriestley's avatar
      Fix Phriction rendering for initial install and 404 pages · 5ba66e56
      epriestley authored
      Summary:
      Depends on D19682. Ref T13202. We currently fatal when trying to render a timeline if:
      
        - an install is fresh, so there are no pages yet, and you look at "/w/"; or
        - you're looking at a Phriction page which doesn't exist (yet) like "/w/aadsflknadsflnf/".
      
      Rendering a timeline and comment area doesn't make sense in these cases, so don't render them.
      
      Test Plan: Hit both cases described above, got "new/empty page" prompts instead of fatals.
      
      Reviewers: amckinley
      
      Maniphest Tasks: T13202
      
      Differential Revision: https://secure.phabricator.com/D19683
      5ba66e56
  6. 13 Sep, 2018 1 commit
    • epriestley's avatar
      Make Phriction diff-of-changes view draft-aware and clarify some language · 0abf2976
      epriestley authored
      Summary:
      Ref T13077. Ref T13197. See PHI840.
      
        - In the "History > Diff/Compare" view, the button language wasn't draft-aware.
        - Revise language to avoid the word "Revert", since this can be ambiguous.
          - "Edit this page, starting with an older version of the text" is now "Edit Older|Current|Draft Version X".
          - "Mark this older version of the page as the current published version" is now "Publish Older Version".
        - Let the user edit the current published version, too, since this is a reasonable operation if there are drafts.
      
      Test Plan: Navigated the history diff view, saw better button and action text.
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T13197, T13077
      
      Differential Revision: https://secure.phabricator.com/D19668
      0abf2976
  7. 12 Sep, 2018 4 commits
    • epriestley's avatar
      Add a Phriction hint when a draft exists, and fix some draft editing bugs · b6ba75d9
      epriestley authored
      Summary:
      Depends on D19662. Ref T13077. See PHI840.
      
        - If you're looking at the published version of a document, but a draft version exists and you can edit it, add a hint/link.
        - Fix an issue where the "draft" transaction would complain when you created a document since the initial content is empty and no "draft" transaction is adding any content.
      
      Test Plan: Created new documents, viewed documents with current published versions and unpublished drafts.
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T13077
      
      Differential Revision: https://secure.phabricator.com/D19663
      b6ba75d9
    • epriestley's avatar
      Allow Phriction document edits to be saved as drafts · 550028a8
      epriestley authored
      Summary:
      Depends on D19661. Ref T13077. See PHI840.
      
      When a user edits a page normally, add a "Save as Draft" button. Much of this change is around making that button render and behave properly: it needs to be an `<input type="submit" ...>` so browsers submit it and we can figure out which button the user clicked.
      
      Then there are a few minor rules:
      
        - If you're editing a page which is already a draft, we only give you "Save as Draft". This makes edits to update/revise a draft more natural.
        - Highlight "Publish" if it's a likely action that you might want to take.
      
      Internally, there are two types of edits. Both types create a new version with the new content. However:
      
        - A "content" edit sets the version shown on the live page to the newly-created version.
        - A "draft" edit does not update the version shown on the live page.
      
      Test Plan: Edited a published document, edited the draft. Published documents. Reverted documents.
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T13077
      
      Differential Revision: https://secure.phabricator.com/D19662
      550028a8
    • epriestley's avatar
      Remove obsolete, nonfunctional draft auto-saving in Phriction · 152e7713
      epriestley authored
      Summary:
      Depends on D19660. Ref T5811. Ref T13077.
      
      Long ago, if you started editing a Phriction document but didn't save it, we'd save the draft in the background as part of the preview.
      
      D11169 updated the preview to use shared infrastructure and broke this function, since we never save drafts.
      
      Since this doesn't work right now, I want to add another thing called "draft", and the future of this feature should be more integrated with modern drafts and EditEngine (which fixed some bugs related to versioning), just get rid of this code for the moment.
      
      Test Plan: Edited documents. This code doesn't do anything since D11169, so no behavior changed.
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T13077, T5811
      
      Differential Revision: https://secure.phabricator.com/D19661
      152e7713
    • epriestley's avatar
      Support (basic) commenting on Phriction documents · e19c5559
      epriestley authored
      Summary:
      Depends on D19659. Fixes T1894. Ref T13077. See PHI840.
      
        - Add an EditEngine, although it currently supports no fields.
        - Add (basic, top-level-only) commenting (we already had the table in the database).
      
      This will probably create some issues. I'm most concerned about documents accumulating a ton of old, irrelevant comments over time which are hard to keep track of and no longer relevant. But I think this is probably a step forward in almost all cases, and a good thing on the balance.
      
      This also moves us incrementally toward putting all editing on top of EditEngine.
      
      Test Plan: {F5877347}
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T13077, T1894
      
      Differential Revision: https://secure.phabricator.com/D19660
      e19c5559
  8. 11 Sep, 2018 1 commit
    • epriestley's avatar
      Give Phriction documents a normal timeline · 2379c21f
      epriestley authored
      Summary:
      Ref T13077. See PHI840. Ref T1894. I'm planning to just let you comment on Phriction documents. I think this will create a few problems (e.g., around popular documents which collect long comment threads that are eventually obsolete) but nothing should be too terribly critical (e.g., we handle it gracefully when objects have very large number of comments/transactions) and for most documents this is likely just a net improvement.
      
      "Just enable comments" is probably not the final iteration on this, but I think it's probably a step forward on the balance, not a step sideways or a slippery slope down into a dark hole or anything.
      
      Test Plan: {F5877316}
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T13077, T1894
      
      Differential Revision: https://secure.phabricator.com/D19659
      2379c21f
  9. 31 Aug, 2018 1 commit
  10. 30 Aug, 2018 2 commits
  11. 29 Aug, 2018 4 commits
    • epriestley's avatar
      Add a UI element for navigating between versions of a Phriction document · 876638e4
      epriestley authored
      Summary: Depends on D19621. Ref T13077. Fixes T4815. This adds previous/current/next/draft buttons and makes navigation between unpublished and published versions of a document more clear.
      
      Test Plan: {F5841997}
      
      Reviewers: amckinley
      
      Maniphest Tasks: T13077, T4815
      
      Differential Revision: https://secure.phabricator.com/D19622
      876638e4
    • epriestley's avatar
      Allow the published version of a Phriction document to differ from the most recent version · 34968631
      epriestley authored
      Summary:
      Depends on D19620. Ref T13077. This adds a "Publish" operation which points the current version at some historical version of the document -- not necessarily the most recent version. Newer versions become "drafts".
      
      This is still quite rough and missing a lot of hinting in the UI, I'm just making it work so I can start making the UI understand it.
      
      Test Plan: Used the "Publish" action to publish older versions of a document, saw the document revert. Many UI hints are missing and this operation is puzzling and not yet usable for normal users.
      
      Reviewers: amckinley
      
      Maniphest Tasks: T13077
      
      Differential Revision: https://secure.phabricator.com/D19621
      34968631
    • epriestley's avatar
      Move Phriction internal document/content references from IDs to PHIDs · 64cee4a9
      epriestley authored
      Summary:
      Ref T13077. This is mostly just a small cleanup change, even though the actual change is large.
      
      We currently reference content and document objects from one another with `contentID` and `documentID`, but this means that `contentID` must be nullable. Switching to PHIDs allows the column to be non-nullable.
      
      This also supports reorienting some current and future transactions around PHIDs, which is preferable for the API. In particular, I'm adding a "publish version X" transaction soon, and would rather callers pass a PHID than an ID or version number, since this will make the API more consistent and powerful.
      
      Today, `contentID` gets used as a cheaty way to order documents by (content) edit time. Since PHIDs aren't orderable and stuff is going to become actually-revertible soon, replace this with an epoch timestamp.
      
      Test Plan:
        - Created, edited, moved, retitled, and deleted Phriction documents.
        - Grepped for `documentID` and `contentID`.
        - This probably breaks //something// but I'll be in this code for a bit and am likely to catch whatever breaks.
      
      Reviewers: amckinley
      
      Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam
      
      Maniphest Tasks: T13077
      
      Differential Revision: https://secure.phabricator.com/D19619
      64cee4a9
    • epriestley's avatar
      Remove some unusual UI policy hints in Phriction · 04f8270a
      epriestley authored
      Summary:
      Ref T13077. We currently have these weird policy hints in Phriction that we don't use in other applications. Just remove them for consistency to make the eventual swap to EditEngine a little easier.
      
      Also nuke some unreacahble code.
      
      Test Plan: Loaded edit page, saw more standard UI.
      
      Reviewers: amckinley
      
      Maniphest Tasks: T13077
      
      Differential Revision: https://secure.phabricator.com/D19618
      04f8270a
  12. 28 Aug, 2018 2 commits
    • epriestley's avatar
      Allow DocumentView to render with a curtain, and make Phriction use a curtain · 4afb6446
      epriestley authored
      Summary:
      Depends on D19616. Ref T13077. Fixes T8172. In the last round of design updates, a lot of actions got stuffed into "Actions" menus.
      
      I never really got used to these and think they're a net usability loss, and broadly agree with the feedback in T8172. I'd generally like to move back toward a state where actions are available on the page, not hidden in a menu.
      
      For now, just put a curtain view on these pages. This could be refined later (e.g., stick this menu to the right hand side of the screen) depending on where other Phriction changes go.
      
      (Broadly, I'm also not satisfied with where we ended up on the fixed-width pages like Diffusion > Manage, Config, and Instances. In contrast, I //do// like where we ended up with Phortune in terms of overall design. I anticipate revisiting some of this stuff eventually.)
      
      Test Plan:
        - Looked at Phriction pages on desktop/tablet/mobile/printable -- actions are now available on the page.
        - Looked at other DocumentView pages (like Phame blogs) -- no changes for now.
      
      Reviewers: amckinley
      
      Maniphest Tasks: T13077, T8172
      
      Differential Revision: https://secure.phabricator.com/D19617
      4afb6446
    • epriestley's avatar
      Rename "PHUIDocumentViewPro" to "PHUIDocumentView" · fd0da4c4
      epriestley authored
      Summary: Ref T13077. There is no "PHUIDocumentView" so toss the "Pro" suffix from this classname.
      
      Test Plan: Grepped for `PHUIDocumentView` and `PHUIDocumentViewPro`.
      
      Reviewers: amckinley
      
      Maniphest Tasks: T13077
      
      Differential Revision: https://secure.phabricator.com/D19616
      fd0da4c4
  13. 03 Aug, 2018 1 commit
    • epriestley's avatar
      Add a "Last Edited" property to Wiki pages · f3fa1648
      epriestley authored
      Summary:
      Ref T13164. See PHI797. The last edit is available in the page header, but it's not precise (just says "180 days ago") and a little weird (it's unusual for us to put that kind of information in the header).
      
      Add a precise timestamp to the footer for now. I'd imagine re-examining this the next time Phriction gets some UI work and maybe trying to integrate timeline/transactions more cleanly (see also T1894).
      
      Test Plan: Looked at a wiki page, then edited it. Saw precise "Last Edit" timestamp adjacent to "Last Author".
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T13164
      
      Differential Revision: https://secure.phabricator.com/D19560
      f3fa1648
  14. 31 Jul, 2018 1 commit
    • epriestley's avatar
      Add Spaces support to Phriction · 8d8086fc
      epriestley authored
      Summary:
      Ref T13164. See PHI774. Fixes T12435.
      
      Since Phriction is hierarchical, there isn't a super strong motivation to support Spaces: you can generally set policies on a small number of documents to get the desired effective policy behavior.
      
      However, it still improves consistency and there's no reason //not// to support Spaces. In the case where you have some moderately weird/complex policy on one or more Spaces, using Spaces to define the policy behavior can make things a bit simpler and easier to understand.
      
      This probably doesn't actually fix whatever the root problem in T12435 was (complicated, non-hierarchical access policies?). See also a bunch of discussion in T12442. So we might end up going beyond this to address other use cases, but I think this is reasonable regardless.
      
      Test Plan: Created and edited Phriction documents and shifted them between Spaces. Searched by Space, etc.
      
      Reviewers: amckinley
      
      Reviewed By: amckinley
      
      Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam
      
      Maniphest Tasks: T13164, T12435
      
      Differential Revision: https://secure.phabricator.com/D19553
      8d8086fc
  15. 27 Apr, 2018 1 commit
    • Austin McKinley's avatar
      Extend PhabricatorPolicyCodex interface to handle "interesting" policy defaults · 9a0dd554
      Austin McKinley authored
      Summary:
      Fixes T13128. Ref PHI590. This is a rough-and-ready implementation of a new `PhabricatorPolicyCodex->compareToDefaultPolicy()` method that subclasses can override to handle special cases of policy defaults. Also implements a `PolicyCodex` for Phriction documents, because the default policy of a Phriction document is the policy of the root document.
      
      I might break this change into two parts, one of which maintains the current behavior and another which implements `PhrictionDocumentPolicyCodex`.
      
      Test Plan: Created some Phriction docs, fiddled with policies, observed expected colors in the header. Will test more comprehensively after review for basic reasonable-ness.
      
      Reviewers: epriestley
      
      Reviewed By: epriestley
      
      Subscribers: Korvin, swisspol
      
      Maniphest Tasks: T13128
      
      Differential Revision: https://secure.phabricator.com/D19409
      9a0dd554
  16. 16 Feb, 2018 4 commits
  17. 06 Sep, 2017 1 commit
  18. 05 Jun, 2017 1 commit
    • Chad Little's avatar
      Separate button CSS classes · d3c464a6
      Chad Little authored
      Summary: Try to dis-ambiguate various button types and colors. Moves `simple` to `phui-button-simple` and moves colors to `button-color`.
      
      Test Plan: Grep for buttons still inline, UIExamples, PHUIX, Herald, and Email Preferences.
      
      Reviewers: epriestley
      
      Reviewed By: epriestley
      
      Subscribers: Korvin
      
      Differential Revision: https://secure.phabricator.com/D18077
      d3c464a6
  19. 02 Jun, 2017 2 commits
    • epriestley's avatar
      (stable) Fix an issue where Phriction moves to new locations would fail with a... · acaa2e14
      epriestley authored
      (stable) Fix an issue where Phriction moves to new locations would fail with a "content required" error
      
      Summary:
      Ref T12793. I'd like to understand exactly when we broke this, but this seems to be a minimal fix that shouldn't do anything surprising.
      
      When you move document `/a/` to `/a/b/` and that path doesn't exist yet, the Content transaction currently fails because there's "no content". The content gets added later by the "move" transaction but this is implicit.
      
      To make this work, just ignore the "missing field" error. This is a little roundabout but unlikely to break anything in weird ways.
      
      Test Plan:
        - Moved document `/a/b/` to `/a/b/c/`.
        - Before patch: error about missing content.
        - After patch: move worked properly.
      
      Reviewers: chad, amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T12793
      
      Differential Revision: https://secure.phabricator.com/D18069
      acaa2e14
    • epriestley's avatar
      Fix an issue where Phriction moves to new locations would fail with a "content required" error · 17f09230
      epriestley authored
      Summary:
      Ref T12793. I'd like to understand exactly when we broke this, but this seems to be a minimal fix that shouldn't do anything surprising.
      
      When you move document `/a/` to `/a/b/` and that path doesn't exist yet, the Content transaction currently fails because there's "no content". The content gets added later by the "move" transaction but this is implicit.
      
      To make this work, just ignore the "missing field" error. This is a little roundabout but unlikely to break anything in weird ways.
      
      Test Plan:
        - Moved document `/a/b/` to `/a/b/c/`.
        - Before patch: error about missing content.
        - After patch: move worked properly.
      
      Reviewers: chad, amckinley
      
      Reviewed By: amckinley
      
      Maniphest Tasks: T12793
      
      Differential Revision: https://secure.phabricator.com/D18069
      17f09230
  20. 23 May, 2017 1 commit
  21. 22 May, 2017 1 commit
  22. 16 May, 2017 2 commits
  23. 18 Oct, 2016 1 commit
    • Giedrius Dubinskas's avatar
      Fix Phriction document move on to existing document placeholder · 4e831e78
      Giedrius Dubinskas authored
      Summary:
      Looks like the logic was there already but some minor parts were missing.
      Fixes T8082.
      
      Test Plan:
      - Create document `/w/foo`
      - Delete document `/w/foo`
      - Create document `/w/bar`
      - Move document `/w/bar` for `/w/foo`
      No error was displayed and document `/w/bar` was moved to `/w/foo`.
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: Korvin
      
      Maniphest Tasks: T8082
      
      Differential Revision: https://secure.phabricator.com/D16713
      4e831e78
  24. 11 Sep, 2016 1 commit
    • Luke081515's avatar
      Fixed inconsistency at phriction · 9e4bca83
      Luke081515 authored
      Summary:
      * All Applications are useing the description "Tags", Phriction actually uses "Projects"
      * Changed "Projects" to "Tags" for phriction
      Ref T11614
      
      Test Plan:
      * Edited a document, took a look at the description for that input line
      * Added a project to a page and saved it
      
      Reviewers: chad, #blessed_reviewers
      
      Reviewed By: chad, #blessed_reviewers
      
      Subscribers: avivey, chad, epriestley
      
      Tags: #phriction
      
      Maniphest Tasks: T11614
      
      Differential Revision: https://secure.phabricator.com/D16537
      9e4bca83
  25. 09 Sep, 2016 2 commits