Skip to content

Commit d3dbbec

Browse files
author
epriestley
committed
Rename Releeph "Project" transactions to "Product"
Summary: Ref T3549. This table isn't written to yet; rename it and the DAOs and modernize the history controller. Test Plan: Viewed history page for a product. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T3549 Differential Revision: https://secure.phabricator.com/D8633
1 parent a5ad923 commit d3dbbec

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE {$NAMESPACE}_releeph.releeph_projecttransaction
2+
RENAME {$NAMESPACE}_releeph.releeph_producttransaction;

src/__phutil_library_map__.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,6 +2516,8 @@
25162516
'ReleephPHIDTypeRequest' => 'applications/releeph/phid/ReleephPHIDTypeRequest.php',
25172517
'ReleephProductActionController' => 'applications/releeph/controller/project/ReleephProductActionController.php',
25182518
'ReleephProductController' => 'applications/releeph/controller/project/ReleephProductController.php',
2519+
'ReleephProductTransaction' => 'applications/releeph/storage/ReleephProductTransaction.php',
2520+
'ReleephProductTransactionQuery' => 'applications/releeph/query/ReleephProductTransactionQuery.php',
25192521
'ReleephProject' => 'applications/releeph/storage/ReleephProject.php',
25202522
'ReleephProjectController' => 'applications/releeph/controller/ReleephProjectController.php',
25212523
'ReleephProjectCreateController' => 'applications/releeph/controller/project/ReleephProjectCreateController.php',
@@ -2524,8 +2526,6 @@
25242526
'ReleephProjectListController' => 'applications/releeph/controller/project/ReleephProjectListController.php',
25252527
'ReleephProjectQuery' => 'applications/releeph/query/ReleephProjectQuery.php',
25262528
'ReleephProjectSearchEngine' => 'applications/releeph/query/ReleephProjectSearchEngine.php',
2527-
'ReleephProjectTransaction' => 'applications/releeph/storage/ReleephProjectTransaction.php',
2528-
'ReleephProjectTransactionQuery' => 'applications/releeph/query/ReleephProjectTransactionQuery.php',
25292529
'ReleephProjectViewController' => 'applications/releeph/controller/project/ReleephProjectViewController.php',
25302530
'ReleephReasonFieldSpecification' => 'applications/releeph/field/specification/ReleephReasonFieldSpecification.php',
25312531
'ReleephRequest' => 'applications/releeph/storage/ReleephRequest.php',
@@ -5490,6 +5490,8 @@
54905490
'ReleephPHIDTypeRequest' => 'PhabricatorPHIDType',
54915491
'ReleephProductActionController' => 'ReleephProductController',
54925492
'ReleephProductController' => 'ReleephController',
5493+
'ReleephProductTransaction' => 'PhabricatorApplicationTransaction',
5494+
'ReleephProductTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
54935495
'ReleephProject' =>
54945496
array(
54955497
0 => 'ReleephDAO',
@@ -5498,16 +5500,14 @@
54985500
'ReleephProjectController' => 'ReleephController',
54995501
'ReleephProjectCreateController' => 'ReleephProjectController',
55005502
'ReleephProjectEditController' => 'ReleephProjectController',
5501-
'ReleephProjectHistoryController' => 'ReleephProjectController',
5503+
'ReleephProjectHistoryController' => 'ReleephProductController',
55025504
'ReleephProjectListController' =>
55035505
array(
55045506
0 => 'ReleephController',
55055507
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
55065508
),
55075509
'ReleephProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
55085510
'ReleephProjectSearchEngine' => 'PhabricatorApplicationSearchEngine',
5509-
'ReleephProjectTransaction' => 'PhabricatorApplicationTransaction',
5510-
'ReleephProjectTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
55115511
'ReleephProjectViewController' =>
55125512
array(
55135513
0 => 'ReleephProjectController',

src/applications/releeph/controller/project/ReleephProjectHistoryController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
<?php
22

3-
final class ReleephProjectHistoryController extends ReleephProjectController {
3+
final class ReleephProjectHistoryController extends ReleephProductController {
44

55
private $id;
66

77
public function willProcessRequest(array $data) {
88
$this->id = $data['projectID'];
9-
parent::willProcessRequest($data);
109
}
1110

1211
public function processRequest() {
1312
$request = $this->getRequest();
1413
$viewer = $request->getUser();
1514

16-
$project = id(new ReleephProjectQuery())
15+
$product = id(new ReleephProjectQuery())
1716
->setViewer($viewer)
1817
->withIDs(array($this->id))
1918
->executeOne();
20-
if (!$project) {
19+
if (!$product) {
2120
return new Aphront404Response();
2221
}
22+
$this->setProduct($product);
2323

24-
$xactions = id(new ReleephProjectTransactionQuery())
24+
$xactions = id(new ReleephProductTransactionQuery())
2525
->setViewer($viewer)
26-
->withObjectPHIDs(array($project->getPHID()))
26+
->withObjectPHIDs(array($product->getPHID()))
2727
->execute();
2828

2929
$timeline = id(new PhabricatorApplicationTransactionView())
3030
->setUser($viewer)
31-
->setObjectPHID($project->getPHID())
31+
->setObjectPHID($product->getPHID())
3232
->setTransactions($xactions);
3333

3434
$crumbs = $this->buildApplicationCrumbs();
@@ -40,7 +40,7 @@ public function processRequest() {
4040
$timeline,
4141
),
4242
array(
43-
'title' => pht('Project History'),
43+
'title' => pht('Product History'),
4444
'device' => true,
4545
));
4646
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
final class ReleephProjectTransactionQuery
3+
final class ReleephProductTransactionQuery
44
extends PhabricatorApplicationTransactionQuery {
55

66
public function getTemplateApplicationTransaction() {
7-
return new ReleephProjectTransaction();
7+
return new ReleephProductTransaction();
88
}
99

1010
}

src/applications/releeph/storage/ReleephProjectTransaction.php renamed to src/applications/releeph/storage/ReleephProductTransaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
final class ReleephProjectTransaction
3+
final class ReleephProductTransaction
44
extends PhabricatorApplicationTransaction {
55

66
public function getApplicationName() {

0 commit comments

Comments
 (0)