Page MenuHomePhabricator

D8669.id.diff
No OneTemporary

D8669.id.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -417,7 +417,7 @@
'rsrc/js/application/projects/behavior-boards-dropdown.js' => '0ec56e1d',
'rsrc/js/application/projects/behavior-project-boards.js' => 'd4bf1f3c',
'rsrc/js/application/projects/behavior-project-create.js' => '065227cc',
- 'rsrc/js/application/projects/behavior-reorder-columns.js' => '09eee344',
+ 'rsrc/js/application/projects/behavior-reorder-columns.js' => 'e1d25dfb',
'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf',
'rsrc/js/application/releeph/releeph-request-state-change.js' => 'ab836011',
'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f',
@@ -647,7 +647,7 @@
'javelin-behavior-releeph-request-typeahead' => 'de2e896f',
'javelin-behavior-remarkup-preview' => 'f7379f45',
'javelin-behavior-reorder-applications' => '76b9fc3e',
- 'javelin-behavior-reorder-columns' => '09eee344',
+ 'javelin-behavior-reorder-columns' => 'e1d25dfb',
'javelin-behavior-repository-crossreference' => 'f9539603',
'javelin-behavior-search-reorder-queries' => 'e9581f08',
'javelin-behavior-select-on-click' => '4e3e79a6',
@@ -876,13 +876,6 @@
'javelin-mask',
'phabricator-drag-and-drop-file-upload',
),
- '09eee344' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-workflow',
- 'javelin-dom',
- 'phabricator-draggable-list',
- ),
'0a3f3021' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1761,6 +1754,13 @@
'javelin-dom',
'phabricator-prefab',
),
+ 'e1d25dfb' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-workflow',
+ 'javelin-dom',
+ 'phabricator-draggable-list',
+ ),
'e1ff79b1' => array(
'javelin-behavior',
'javelin-stratcom',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2520,6 +2520,7 @@
'PhragmentPatchUtil' => 'applications/phragment/util/PhragmentPatchUtil.php',
'PhragmentPolicyController' => 'applications/phragment/controller/PhragmentPolicyController.php',
'PhragmentQueryFragmentsConduitAPIMethod' => 'applications/phragment/conduit/PhragmentQueryFragmentsConduitAPIMethod.php',
+ 'PhragmentQuerySnapshotsConduitAPIMethod' => 'applications/phragment/conduit/PhragmentQuerySnapshotsConduitAPIMethod.php',
'PhragmentRevertController' => 'applications/phragment/controller/PhragmentRevertController.php',
'PhragmentSnapshot' => 'applications/phragment/storage/PhragmentSnapshot.php',
'PhragmentSnapshotChild' => 'applications/phragment/storage/PhragmentSnapshotChild.php',
@@ -5438,6 +5439,7 @@
'PhragmentPatchUtil' => 'Phobject',
'PhragmentPolicyController' => 'PhragmentController',
'PhragmentQueryFragmentsConduitAPIMethod' => 'PhragmentConduitAPIMethod',
+ 'PhragmentQuerySnapshotsConduitAPIMethod' => 'PhragmentConduitAPIMethod',
'PhragmentRevertController' => 'PhragmentController',
'PhragmentSnapshot' => array(
'PhragmentDAO',
diff --git a/src/applications/phragment/conduit/PhragmentQuerySnapshotsConduitAPIMethod.php b/src/applications/phragment/conduit/PhragmentQuerySnapshotsConduitAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phragment/conduit/PhragmentQuerySnapshotsConduitAPIMethod.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @group conduit
+ */
+final class PhragmentQuerySnapshotsConduitAPIMethod
+ extends PhragmentConduitAPIMethod {
+
+ public function getMethodStatus() {
+ return self::METHOD_STATUS_UNSTABLE;
+ }
+
+ public function getAPIMethodName() {
+ return 'phragment.querysnapshots';
+ }
+
+ public function getMethodDescription() {
+ return pht('Query snapshots based on their path.');
+ }
+
+ public function defineParamTypes() {
+ return array(
+ 'path' => 'required string'
+ );
+ }
+
+ public function defineReturnType() {
+ return 'nonempty dict';
+ }
+
+ public function defineErrorTypes() {
+ return array();
+ }
+
+ protected function execute(ConduitAPIRequest $request) {
+ $path = $request->getValue('path');
+
+ $fragment = id(new PhragmentFragmentQuery())
+ ->setViewer($request->getUser())
+ ->withPaths(array($path))
+ ->executeOne();
+
+ $snapshots = id(new PhragmentSnapshotQuery())
+ ->setViewer($request->getUser())
+ ->withPrimaryFragmentPHIDs(array($fragment->getPHID()))
+ ->execute();
+
+ $results = array();
+ foreach ($snapshots as $snapshot) {
+ $results[] = array(
+ 'phid' => $snapshot->getPHID(),
+ 'name' => $snapshot->getName());
+ }
+
+ return $results;
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 19, 9:13 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6731390
Default Alt Text
D8669.id.diff (4 KB)

Event Timeline