From 0306eb70edfcba6af269d5273a1864208e4768f8 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 16 Jul 2015 14:13:13 -0700 Subject: [PATCH] Group and order Herald fields Summary: Ref T8726. Some adapters now have a large number of fields, and we lost the sort-of-human-readable implicit ordering when fields were modularized. Instead, group and sort fields. Test Plan: {F603066} Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T8726 Differential Revision: https://secure.phabricator.com/D13619 --- resources/celerity/map.php | 22 +++++------ src/__phutil_library_map__.php | 30 +++++++++++++++ .../DifferentialChangeHeraldFieldGroup.php | 15 ++++++++ ...fferentialDiffAffectedFilesHeraldField.php | 4 ++ ...ifferentialDiffContentAddedHeraldField.php | 4 ++ .../DifferentialDiffContentHeraldField.php | 4 ++ ...ferentialDiffContentRemovedHeraldField.php | 4 ++ .../herald/DifferentialDiffHeraldField.php | 4 ++ .../DifferentialDiffHeraldFieldGroup.php | 15 ++++++++ ...entialRevisionAffectedFilesHeraldField.php | 4 ++ ...rentialRevisionContentAddedHeraldField.php | 4 ++ ...DifferentialRevisionContentHeraldField.php | 4 ++ ...ntialRevisionContentRemovedHeraldField.php | 4 ++ .../DifferentialRevisionHeraldField.php | 4 ++ .../DifferentialRevisionHeraldFieldGroup.php | 15 ++++++++ ...DifferentialRevisionPackageHeraldField.php | 4 ++ ...rentialRevisionPackageOwnerHeraldField.php | 4 ++ .../DiffusionChangeHeraldFieldGroup.php | 15 ++++++++ ...iffusionCommitAffectedFilesHeraldField.php | 4 ++ ...usionCommitDiffContentAddedHeraldField.php | 4 ++ .../DiffusionCommitDiffContentHeraldField.php | 4 ++ ...ionCommitDiffContentRemovedHeraldField.php | 4 ++ ...DiffusionCommitDiffEnormousHeraldField.php | 4 ++ .../herald/DiffusionCommitHeraldField.php | 4 ++ .../DiffusionCommitHeraldFieldGroup.php | 15 ++++++++ ...DiffusionCommitPackageAuditHeraldField.php | 4 ++ .../DiffusionCommitPackageHeraldField.php | 4 ++ ...DiffusionCommitPackageOwnerHeraldField.php | 4 ++ ...usionCommitRevisionAcceptedHeraldField.php | 4 ++ .../DiffusionCommitRevisionHeraldField.php | 4 ++ ...sionCommitRevisionReviewersHeraldField.php | 4 ++ ...onCommitRevisionSubscribersHeraldField.php | 4 ++ ...eCommitContentAffectedFilesHeraldField.php | 4 ++ ...mmitContentDiffContentAddedHeraldField.php | 4 ++ ...PreCommitContentDiffContentHeraldField.php | 4 ++ ...itContentDiffContentRemovedHeraldField.php | 4 ++ ...reCommitContentDiffEnormousHeraldField.php | 4 ++ .../DiffusionPreCommitContentHeraldField.php | 4 ++ ...mmitContentRevisionAcceptedHeraldField.php | 4 ++ ...ionPreCommitContentRevisionHeraldField.php | 4 ++ ...mitContentRevisionReviewersHeraldField.php | 4 ++ ...tContentRevisionSubscribersHeraldField.php | 4 ++ .../DiffusionPreCommitRefHeraldField.php | 4 ++ .../DiffusionPreCommitRefHeraldFieldGroup.php | 15 ++++++++ .../herald/adapter/HeraldAdapter.php | 10 +++++ .../controller/HeraldRuleController.php | 35 +++++++++++++++-- .../herald/field/HeraldAlwaysField.php | 4 ++ .../herald/field/HeraldAnotherRuleField.php | 4 ++ .../herald/field/HeraldBasicFieldGroup.php | 15 ++++++++ .../herald/field/HeraldContentSourceField.php | 4 ++ .../herald/field/HeraldEditFieldGroup.php | 15 ++++++++ src/applications/herald/field/HeraldField.php | 4 ++ .../herald/field/HeraldFieldGroup.php | 38 +++++++++++++++++++ .../herald/field/HeraldNewObjectField.php | 4 ++ .../herald/field/HeraldRelatedFieldGroup.php | 15 ++++++++ .../herald/field/HeraldSupportFieldGroup.php | 15 ++++++++ .../herald/ManiphestTaskHeraldField.php | 4 ++ .../herald/ManiphestTaskHeraldFieldGroup.php | 15 ++++++++ ...atorMetaMTAApplicationEmailHeraldField.php | 6 ++- .../pholio/herald/PholioMockHeraldField.php | 4 ++ .../herald/PholioMockHeraldFieldGroup.php | 15 ++++++++ .../herald/PhrictionDocumentHeraldField.php | 3 ++ .../PhrictionDocumentHeraldFieldGroup.php | 15 ++++++++ .../project/herald/HeraldProjectsField.php | 4 ++ .../spaces/herald/HeraldSpaceField.php | 4 ++ .../herald/HeraldSubscribersField.php | 4 ++ .../PhabricatorCustomFieldHeraldField.php | 4 ++ ...PhabricatorCustomFieldHeraldFieldGroup.php | 15 ++++++++ .../js/application/herald/HeraldRuleEditor.js | 23 +++++++++-- 69 files changed, 546 insertions(+), 19 deletions(-) create mode 100644 src/applications/differential/herald/DifferentialChangeHeraldFieldGroup.php create mode 100644 src/applications/differential/herald/DifferentialDiffHeraldFieldGroup.php create mode 100644 src/applications/differential/herald/DifferentialRevisionHeraldFieldGroup.php create mode 100644 src/applications/diffusion/herald/DiffusionChangeHeraldFieldGroup.php create mode 100644 src/applications/diffusion/herald/DiffusionCommitHeraldFieldGroup.php create mode 100644 src/applications/diffusion/herald/DiffusionPreCommitRefHeraldFieldGroup.php create mode 100644 src/applications/herald/field/HeraldBasicFieldGroup.php create mode 100644 src/applications/herald/field/HeraldEditFieldGroup.php create mode 100644 src/applications/herald/field/HeraldFieldGroup.php create mode 100644 src/applications/herald/field/HeraldRelatedFieldGroup.php create mode 100644 src/applications/herald/field/HeraldSupportFieldGroup.php create mode 100644 src/applications/maniphest/herald/ManiphestTaskHeraldFieldGroup.php create mode 100644 src/applications/pholio/herald/PholioMockHeraldFieldGroup.php create mode 100644 src/applications/phriction/herald/PhrictionDocumentHeraldFieldGroup.php create mode 100644 src/infrastructure/customfield/herald/PhabricatorCustomFieldHeraldFieldGroup.php diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 23c3ef8d92..8b726fbc57 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -382,7 +382,7 @@ return array( 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => 'e5822781', 'rsrc/js/application/files/behavior-icon-composer.js' => '8ef9ab58', 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', - 'rsrc/js/application/herald/HeraldRuleEditor.js' => '6c2dffcc', + 'rsrc/js/application/herald/HeraldRuleEditor.js' => '52684226', 'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec', 'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3', 'rsrc/js/application/maniphest/behavior-batch-editor.js' => '782ab6e7', @@ -538,7 +538,7 @@ return array( 'global-drag-and-drop-css' => '697324ad', 'harbormaster-css' => '49d64eb4', 'herald-css' => '826075fa', - 'herald-rule-editor' => '6c2dffcc', + 'herald-rule-editor' => '52684226', 'herald-test-css' => '778b008e', 'inline-comment-summary-css' => '51efda3a', 'javelin-aphlict' => '5359e785', @@ -1172,6 +1172,15 @@ return array( 'javelin-dom', 'javelin-reactor-dom', ), + 52684226 => array( + 'multirow-row-manager', + 'javelin-install', + 'javelin-util', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-json', + 'phabricator-prefab', + ), '5359e785' => array( 'javelin-install', 'javelin-util', @@ -1338,15 +1347,6 @@ return array( 'javelin-install', 'javelin-util', ), - '6c2dffcc' => array( - 'multirow-row-manager', - 'javelin-install', - 'javelin-util', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-json', - 'phabricator-prefab', - ), '6c53634d' => array( 'javelin-install', 'javelin-event', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index bd899b6491..0a11e7356c 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -304,6 +304,7 @@ phutil_register_library_map(array( 'DifferentialAuthorField' => 'applications/differential/customfield/DifferentialAuthorField.php', 'DifferentialBlameRevisionField' => 'applications/differential/customfield/DifferentialBlameRevisionField.php', 'DifferentialBranchField' => 'applications/differential/customfield/DifferentialBranchField.php', + 'DifferentialChangeHeraldFieldGroup' => 'applications/differential/herald/DifferentialChangeHeraldFieldGroup.php', 'DifferentialChangeType' => 'applications/differential/constants/DifferentialChangeType.php', 'DifferentialChangesSinceLastUpdateField' => 'applications/differential/customfield/DifferentialChangesSinceLastUpdateField.php', 'DifferentialChangeset' => 'applications/differential/storage/DifferentialChangeset.php', @@ -359,6 +360,7 @@ phutil_register_library_map(array( 'DifferentialDiffCreateController' => 'applications/differential/controller/DifferentialDiffCreateController.php', 'DifferentialDiffEditor' => 'applications/differential/editor/DifferentialDiffEditor.php', 'DifferentialDiffHeraldField' => 'applications/differential/herald/DifferentialDiffHeraldField.php', + 'DifferentialDiffHeraldFieldGroup' => 'applications/differential/herald/DifferentialDiffHeraldFieldGroup.php', 'DifferentialDiffInlineCommentQuery' => 'applications/differential/query/DifferentialDiffInlineCommentQuery.php', 'DifferentialDiffPHIDType' => 'applications/differential/phid/DifferentialDiffPHIDType.php', 'DifferentialDiffProperty' => 'applications/differential/storage/DifferentialDiffProperty.php', @@ -452,6 +454,7 @@ phutil_register_library_map(array( 'DifferentialRevisionHasReviewerEdgeType' => 'applications/differential/edge/DifferentialRevisionHasReviewerEdgeType.php', 'DifferentialRevisionHasTaskEdgeType' => 'applications/differential/edge/DifferentialRevisionHasTaskEdgeType.php', 'DifferentialRevisionHeraldField' => 'applications/differential/herald/DifferentialRevisionHeraldField.php', + 'DifferentialRevisionHeraldFieldGroup' => 'applications/differential/herald/DifferentialRevisionHeraldFieldGroup.php', 'DifferentialRevisionIDField' => 'applications/differential/customfield/DifferentialRevisionIDField.php', 'DifferentialRevisionLandController' => 'applications/differential/controller/DifferentialRevisionLandController.php', 'DifferentialRevisionListController' => 'applications/differential/controller/DifferentialRevisionListController.php', @@ -503,6 +506,7 @@ phutil_register_library_map(array( 'DiffusionBrowseTableView' => 'applications/diffusion/view/DiffusionBrowseTableView.php', 'DiffusionCachedResolveRefsQuery' => 'applications/diffusion/query/DiffusionCachedResolveRefsQuery.php', 'DiffusionChangeController' => 'applications/diffusion/controller/DiffusionChangeController.php', + 'DiffusionChangeHeraldFieldGroup' => 'applications/diffusion/herald/DiffusionChangeHeraldFieldGroup.php', 'DiffusionCommitAffectedFilesHeraldField' => 'applications/diffusion/herald/DiffusionCommitAffectedFilesHeraldField.php', 'DiffusionCommitAuthorHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuthorHeraldField.php', 'DiffusionCommitAutocloseHeraldField' => 'applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php', @@ -520,6 +524,7 @@ phutil_register_library_map(array( 'DiffusionCommitHasTaskEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasTaskEdgeType.php', 'DiffusionCommitHash' => 'applications/diffusion/data/DiffusionCommitHash.php', 'DiffusionCommitHeraldField' => 'applications/diffusion/herald/DiffusionCommitHeraldField.php', + 'DiffusionCommitHeraldFieldGroup' => 'applications/diffusion/herald/DiffusionCommitHeraldFieldGroup.php', 'DiffusionCommitHookEngine' => 'applications/diffusion/engine/DiffusionCommitHookEngine.php', 'DiffusionCommitHookRejectException' => 'applications/diffusion/exception/DiffusionCommitHookRejectException.php', 'DiffusionCommitMessageHeraldField' => 'applications/diffusion/herald/DiffusionCommitMessageHeraldField.php', @@ -640,6 +645,7 @@ phutil_register_library_map(array( 'DiffusionPreCommitContentRevisionSubscribersHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentRevisionSubscribersHeraldField.php', 'DiffusionPreCommitRefChangeHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitRefChangeHeraldField.php', 'DiffusionPreCommitRefHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitRefHeraldField.php', + 'DiffusionPreCommitRefHeraldFieldGroup' => 'applications/diffusion/herald/DiffusionPreCommitRefHeraldFieldGroup.php', 'DiffusionPreCommitRefNameHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitRefNameHeraldField.php', 'DiffusionPreCommitRefPusherHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitRefPusherHeraldField.php', 'DiffusionPreCommitRefPusherProjectsHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitRefPusherProjectsHeraldField.php', @@ -1006,6 +1012,7 @@ phutil_register_library_map(array( 'HeraldAlwaysField' => 'applications/herald/field/HeraldAlwaysField.php', 'HeraldAnotherRuleField' => 'applications/herald/field/HeraldAnotherRuleField.php', 'HeraldApplyTranscript' => 'applications/herald/storage/transcript/HeraldApplyTranscript.php', + 'HeraldBasicFieldGroup' => 'applications/herald/field/HeraldBasicFieldGroup.php', 'HeraldCommitAdapter' => 'applications/diffusion/herald/HeraldCommitAdapter.php', 'HeraldCondition' => 'applications/herald/storage/HeraldCondition.php', 'HeraldConditionTranscript' => 'applications/herald/storage/transcript/HeraldConditionTranscript.php', @@ -1017,10 +1024,12 @@ phutil_register_library_map(array( 'HeraldDifferentialDiffAdapter' => 'applications/differential/herald/HeraldDifferentialDiffAdapter.php', 'HeraldDifferentialRevisionAdapter' => 'applications/differential/herald/HeraldDifferentialRevisionAdapter.php', 'HeraldDisableController' => 'applications/herald/controller/HeraldDisableController.php', + 'HeraldEditFieldGroup' => 'applications/herald/field/HeraldEditFieldGroup.php', 'HeraldEffect' => 'applications/herald/engine/HeraldEffect.php', 'HeraldEmptyFieldValue' => 'applications/herald/value/HeraldEmptyFieldValue.php', 'HeraldEngine' => 'applications/herald/engine/HeraldEngine.php', 'HeraldField' => 'applications/herald/field/HeraldField.php', + 'HeraldFieldGroup' => 'applications/herald/field/HeraldFieldGroup.php', 'HeraldFieldTestCase' => 'applications/herald/field/__tests__/HeraldFieldTestCase.php', 'HeraldFieldValue' => 'applications/herald/value/HeraldFieldValue.php', 'HeraldInvalidActionException' => 'applications/herald/engine/exception/HeraldInvalidActionException.php', @@ -1036,6 +1045,7 @@ phutil_register_library_map(array( 'HeraldPreCommitRefAdapter' => 'applications/diffusion/herald/HeraldPreCommitRefAdapter.php', 'HeraldProjectsField' => 'applications/project/herald/HeraldProjectsField.php', 'HeraldRecursiveConditionsException' => 'applications/herald/engine/exception/HeraldRecursiveConditionsException.php', + 'HeraldRelatedFieldGroup' => 'applications/herald/field/HeraldRelatedFieldGroup.php', 'HeraldRemarkupRule' => 'applications/herald/remarkup/HeraldRemarkupRule.php', 'HeraldRepetitionPolicyConfig' => 'applications/herald/config/HeraldRepetitionPolicyConfig.php', 'HeraldRule' => 'applications/herald/storage/HeraldRule.php', @@ -1055,6 +1065,7 @@ phutil_register_library_map(array( 'HeraldSelectFieldValue' => 'applications/herald/value/HeraldSelectFieldValue.php', 'HeraldSpaceField' => 'applications/spaces/herald/HeraldSpaceField.php', 'HeraldSubscribersField' => 'applications/subscriptions/herald/HeraldSubscribersField.php', + 'HeraldSupportFieldGroup' => 'applications/herald/field/HeraldSupportFieldGroup.php', 'HeraldTestConsoleController' => 'applications/herald/controller/HeraldTestConsoleController.php', 'HeraldTextFieldValue' => 'applications/herald/value/HeraldTextFieldValue.php', 'HeraldTokenizerFieldValue' => 'applications/herald/value/HeraldTokenizerFieldValue.php', @@ -1181,6 +1192,7 @@ phutil_register_library_map(array( 'ManiphestTaskHasMockEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasMockEdgeType.php', 'ManiphestTaskHasRevisionEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasRevisionEdgeType.php', 'ManiphestTaskHeraldField' => 'applications/maniphest/herald/ManiphestTaskHeraldField.php', + 'ManiphestTaskHeraldFieldGroup' => 'applications/maniphest/herald/ManiphestTaskHeraldFieldGroup.php', 'ManiphestTaskListController' => 'applications/maniphest/controller/ManiphestTaskListController.php', 'ManiphestTaskListView' => 'applications/maniphest/view/ManiphestTaskListView.php', 'ManiphestTaskMailReceiver' => 'applications/maniphest/mail/ManiphestTaskMailReceiver.php', @@ -1799,6 +1811,7 @@ phutil_register_library_map(array( 'PhabricatorCustomFieldConfigOptionType' => 'infrastructure/customfield/config/PhabricatorCustomFieldConfigOptionType.php', 'PhabricatorCustomFieldDataNotAvailableException' => 'infrastructure/customfield/exception/PhabricatorCustomFieldDataNotAvailableException.php', 'PhabricatorCustomFieldHeraldField' => 'infrastructure/customfield/herald/PhabricatorCustomFieldHeraldField.php', + 'PhabricatorCustomFieldHeraldFieldGroup' => 'infrastructure/customfield/herald/PhabricatorCustomFieldHeraldFieldGroup.php', 'PhabricatorCustomFieldImplementationIncompleteException' => 'infrastructure/customfield/exception/PhabricatorCustomFieldImplementationIncompleteException.php', 'PhabricatorCustomFieldIndexStorage' => 'infrastructure/customfield/storage/PhabricatorCustomFieldIndexStorage.php', 'PhabricatorCustomFieldInterface' => 'infrastructure/customfield/interface/PhabricatorCustomFieldInterface.php', @@ -3059,6 +3072,7 @@ phutil_register_library_map(array( 'PholioMockEmbedView' => 'applications/pholio/view/PholioMockEmbedView.php', 'PholioMockHasTaskEdgeType' => 'applications/pholio/edge/PholioMockHasTaskEdgeType.php', 'PholioMockHeraldField' => 'applications/pholio/herald/PholioMockHeraldField.php', + 'PholioMockHeraldFieldGroup' => 'applications/pholio/herald/PholioMockHeraldFieldGroup.php', 'PholioMockImagesView' => 'applications/pholio/view/PholioMockImagesView.php', 'PholioMockListController' => 'applications/pholio/controller/PholioMockListController.php', 'PholioMockMailReceiver' => 'applications/pholio/mail/PholioMockMailReceiver.php', @@ -3246,6 +3260,7 @@ phutil_register_library_map(array( 'PhrictionDocumentController' => 'applications/phriction/controller/PhrictionDocumentController.php', 'PhrictionDocumentHeraldAdapter' => 'applications/phriction/herald/PhrictionDocumentHeraldAdapter.php', 'PhrictionDocumentHeraldField' => 'applications/phriction/herald/PhrictionDocumentHeraldField.php', + 'PhrictionDocumentHeraldFieldGroup' => 'applications/phriction/herald/PhrictionDocumentHeraldFieldGroup.php', 'PhrictionDocumentPHIDType' => 'applications/phriction/phid/PhrictionDocumentPHIDType.php', 'PhrictionDocumentPathHeraldField' => 'applications/phriction/herald/PhrictionDocumentPathHeraldField.php', 'PhrictionDocumentQuery' => 'applications/phriction/query/PhrictionDocumentQuery.php', @@ -3800,6 +3815,7 @@ phutil_register_library_map(array( 'DifferentialAuthorField' => 'DifferentialCustomField', 'DifferentialBlameRevisionField' => 'DifferentialStoredCustomField', 'DifferentialBranchField' => 'DifferentialCustomField', + 'DifferentialChangeHeraldFieldGroup' => 'HeraldFieldGroup', 'DifferentialChangeType' => 'Phobject', 'DifferentialChangesSinceLastUpdateField' => 'DifferentialCustomField', 'DifferentialChangeset' => array( @@ -3864,6 +3880,7 @@ phutil_register_library_map(array( 'DifferentialDiffCreateController' => 'DifferentialController', 'DifferentialDiffEditor' => 'PhabricatorApplicationTransactionEditor', 'DifferentialDiffHeraldField' => 'HeraldField', + 'DifferentialDiffHeraldFieldGroup' => 'HeraldFieldGroup', 'DifferentialDiffInlineCommentQuery' => 'PhabricatorDiffInlineCommentQuery', 'DifferentialDiffPHIDType' => 'PhabricatorPHIDType', 'DifferentialDiffProperty' => 'DifferentialDAO', @@ -3977,6 +3994,7 @@ phutil_register_library_map(array( 'DifferentialRevisionHasReviewerEdgeType' => 'PhabricatorEdgeType', 'DifferentialRevisionHasTaskEdgeType' => 'PhabricatorEdgeType', 'DifferentialRevisionHeraldField' => 'HeraldField', + 'DifferentialRevisionHeraldFieldGroup' => 'HeraldFieldGroup', 'DifferentialRevisionIDField' => 'DifferentialCustomField', 'DifferentialRevisionLandController' => 'DifferentialController', 'DifferentialRevisionListController' => 'DifferentialController', @@ -4028,6 +4046,7 @@ phutil_register_library_map(array( 'DiffusionBrowseTableView' => 'DiffusionView', 'DiffusionCachedResolveRefsQuery' => 'DiffusionLowLevelQuery', 'DiffusionChangeController' => 'DiffusionController', + 'DiffusionChangeHeraldFieldGroup' => 'HeraldFieldGroup', 'DiffusionCommitAffectedFilesHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitAuthorHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitAutocloseHeraldField' => 'DiffusionCommitHeraldField', @@ -4045,6 +4064,7 @@ phutil_register_library_map(array( 'DiffusionCommitHasTaskEdgeType' => 'PhabricatorEdgeType', 'DiffusionCommitHash' => 'Phobject', 'DiffusionCommitHeraldField' => 'HeraldField', + 'DiffusionCommitHeraldFieldGroup' => 'HeraldFieldGroup', 'DiffusionCommitHookEngine' => 'Phobject', 'DiffusionCommitHookRejectException' => 'Exception', 'DiffusionCommitMessageHeraldField' => 'DiffusionCommitHeraldField', @@ -4165,6 +4185,7 @@ phutil_register_library_map(array( 'DiffusionPreCommitContentRevisionSubscribersHeraldField' => 'DiffusionPreCommitContentHeraldField', 'DiffusionPreCommitRefChangeHeraldField' => 'DiffusionPreCommitRefHeraldField', 'DiffusionPreCommitRefHeraldField' => 'HeraldField', + 'DiffusionPreCommitRefHeraldFieldGroup' => 'HeraldFieldGroup', 'DiffusionPreCommitRefNameHeraldField' => 'DiffusionPreCommitRefHeraldField', 'DiffusionPreCommitRefPusherHeraldField' => 'DiffusionPreCommitRefHeraldField', 'DiffusionPreCommitRefPusherProjectsHeraldField' => 'DiffusionPreCommitRefHeraldField', @@ -4609,6 +4630,7 @@ phutil_register_library_map(array( 'HeraldAlwaysField' => 'HeraldField', 'HeraldAnotherRuleField' => 'HeraldField', 'HeraldApplyTranscript' => 'Phobject', + 'HeraldBasicFieldGroup' => 'HeraldFieldGroup', 'HeraldCommitAdapter' => 'HeraldAdapter', 'HeraldCondition' => 'HeraldDAO', 'HeraldConditionTranscript' => 'Phobject', @@ -4620,10 +4642,12 @@ phutil_register_library_map(array( 'HeraldDifferentialDiffAdapter' => 'HeraldDifferentialAdapter', 'HeraldDifferentialRevisionAdapter' => 'HeraldDifferentialAdapter', 'HeraldDisableController' => 'HeraldController', + 'HeraldEditFieldGroup' => 'HeraldFieldGroup', 'HeraldEffect' => 'Phobject', 'HeraldEmptyFieldValue' => 'HeraldFieldValue', 'HeraldEngine' => 'Phobject', 'HeraldField' => 'Phobject', + 'HeraldFieldGroup' => 'Phobject', 'HeraldFieldTestCase' => 'PhutilTestCase', 'HeraldFieldValue' => 'Phobject', 'HeraldInvalidActionException' => 'Exception', @@ -4639,6 +4663,7 @@ phutil_register_library_map(array( 'HeraldPreCommitRefAdapter' => 'HeraldPreCommitAdapter', 'HeraldProjectsField' => 'HeraldField', 'HeraldRecursiveConditionsException' => 'Exception', + 'HeraldRelatedFieldGroup' => 'HeraldFieldGroup', 'HeraldRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'HeraldRepetitionPolicyConfig' => 'Phobject', 'HeraldRule' => array( @@ -4664,6 +4689,7 @@ phutil_register_library_map(array( 'HeraldSelectFieldValue' => 'HeraldFieldValue', 'HeraldSpaceField' => 'HeraldField', 'HeraldSubscribersField' => 'HeraldField', + 'HeraldSupportFieldGroup' => 'HeraldFieldGroup', 'HeraldTestConsoleController' => 'HeraldController', 'HeraldTextFieldValue' => 'HeraldFieldValue', 'HeraldTokenizerFieldValue' => 'HeraldFieldValue', @@ -4823,6 +4849,7 @@ phutil_register_library_map(array( 'ManiphestTaskHasMockEdgeType' => 'PhabricatorEdgeType', 'ManiphestTaskHasRevisionEdgeType' => 'PhabricatorEdgeType', 'ManiphestTaskHeraldField' => 'HeraldField', + 'ManiphestTaskHeraldFieldGroup' => 'HeraldFieldGroup', 'ManiphestTaskListController' => 'ManiphestController', 'ManiphestTaskListView' => 'ManiphestView', 'ManiphestTaskMailReceiver' => 'PhabricatorObjectMailReceiver', @@ -5531,6 +5558,7 @@ phutil_register_library_map(array( 'PhabricatorCustomFieldConfigOptionType' => 'PhabricatorConfigOptionType', 'PhabricatorCustomFieldDataNotAvailableException' => 'Exception', 'PhabricatorCustomFieldHeraldField' => 'HeraldField', + 'PhabricatorCustomFieldHeraldFieldGroup' => 'HeraldFieldGroup', 'PhabricatorCustomFieldImplementationIncompleteException' => 'Exception', 'PhabricatorCustomFieldIndexStorage' => 'PhabricatorLiskDAO', 'PhabricatorCustomFieldList' => 'Phobject', @@ -7021,6 +7049,7 @@ phutil_register_library_map(array( 'PholioMockEmbedView' => 'AphrontView', 'PholioMockHasTaskEdgeType' => 'PhabricatorEdgeType', 'PholioMockHeraldField' => 'HeraldField', + 'PholioMockHeraldFieldGroup' => 'HeraldFieldGroup', 'PholioMockImagesView' => 'AphrontView', 'PholioMockListController' => 'PholioController', 'PholioMockMailReceiver' => 'PhabricatorObjectMailReceiver', @@ -7263,6 +7292,7 @@ phutil_register_library_map(array( 'PhrictionDocumentController' => 'PhrictionController', 'PhrictionDocumentHeraldAdapter' => 'HeraldAdapter', 'PhrictionDocumentHeraldField' => 'HeraldField', + 'PhrictionDocumentHeraldFieldGroup' => 'HeraldFieldGroup', 'PhrictionDocumentPHIDType' => 'PhabricatorPHIDType', 'PhrictionDocumentPathHeraldField' => 'PhrictionDocumentHeraldField', 'PhrictionDocumentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', diff --git a/src/applications/differential/herald/DifferentialChangeHeraldFieldGroup.php b/src/applications/differential/herald/DifferentialChangeHeraldFieldGroup.php new file mode 100644 index 0000000000..5addc8526c --- /dev/null +++ b/src/applications/differential/herald/DifferentialChangeHeraldFieldGroup.php @@ -0,0 +1,15 @@ +getAdapter()->loadAffectedPaths(); } diff --git a/src/applications/differential/herald/DifferentialDiffContentAddedHeraldField.php b/src/applications/differential/herald/DifferentialDiffContentAddedHeraldField.php index ddac2cab68..5a30390c5a 100644 --- a/src/applications/differential/herald/DifferentialDiffContentAddedHeraldField.php +++ b/src/applications/differential/herald/DifferentialDiffContentAddedHeraldField.php @@ -9,6 +9,10 @@ final class DifferentialDiffContentAddedHeraldField return pht('Added file content'); } + public function getFieldGroupKey() { + return DifferentialChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadAddedContentDictionary(); } diff --git a/src/applications/differential/herald/DifferentialDiffContentHeraldField.php b/src/applications/differential/herald/DifferentialDiffContentHeraldField.php index 3ded4b5a64..8a3514b7ca 100644 --- a/src/applications/differential/herald/DifferentialDiffContentHeraldField.php +++ b/src/applications/differential/herald/DifferentialDiffContentHeraldField.php @@ -9,6 +9,10 @@ final class DifferentialDiffContentHeraldField return pht('Changed file content'); } + public function getFieldGroupKey() { + return DifferentialChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadContentDictionary(); } diff --git a/src/applications/differential/herald/DifferentialDiffContentRemovedHeraldField.php b/src/applications/differential/herald/DifferentialDiffContentRemovedHeraldField.php index 03bd61ec02..d48ff8a697 100644 --- a/src/applications/differential/herald/DifferentialDiffContentRemovedHeraldField.php +++ b/src/applications/differential/herald/DifferentialDiffContentRemovedHeraldField.php @@ -9,6 +9,10 @@ final class DifferentialDiffContentRemovedHeraldField return pht('Removed file content'); } + public function getFieldGroupKey() { + return DifferentialChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadRemovedContentDictionary(); } diff --git a/src/applications/differential/herald/DifferentialDiffHeraldField.php b/src/applications/differential/herald/DifferentialDiffHeraldField.php index a5eb2c8047..a49a2e6d70 100644 --- a/src/applications/differential/herald/DifferentialDiffHeraldField.php +++ b/src/applications/differential/herald/DifferentialDiffHeraldField.php @@ -6,4 +6,8 @@ abstract class DifferentialDiffHeraldField extends HeraldField { return ($object instanceof DifferentialDiff); } + public function getFieldGroupKey() { + return DifferentialDiffHeraldFieldGroup::FIELDGROUPKEY; + } + } diff --git a/src/applications/differential/herald/DifferentialDiffHeraldFieldGroup.php b/src/applications/differential/herald/DifferentialDiffHeraldFieldGroup.php new file mode 100644 index 0000000000..74af47300a --- /dev/null +++ b/src/applications/differential/herald/DifferentialDiffHeraldFieldGroup.php @@ -0,0 +1,15 @@ +getAdapter()->loadAffectedPaths(); } diff --git a/src/applications/differential/herald/DifferentialRevisionContentAddedHeraldField.php b/src/applications/differential/herald/DifferentialRevisionContentAddedHeraldField.php index 03cd012dea..6b052e9a9a 100644 --- a/src/applications/differential/herald/DifferentialRevisionContentAddedHeraldField.php +++ b/src/applications/differential/herald/DifferentialRevisionContentAddedHeraldField.php @@ -9,6 +9,10 @@ final class DifferentialRevisionContentAddedHeraldField return pht('Added file content'); } + public function getFieldGroupKey() { + return DifferentialChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadAddedContentDictionary(); } diff --git a/src/applications/differential/herald/DifferentialRevisionContentHeraldField.php b/src/applications/differential/herald/DifferentialRevisionContentHeraldField.php index 6c2e7460a6..043b3ebe2b 100644 --- a/src/applications/differential/herald/DifferentialRevisionContentHeraldField.php +++ b/src/applications/differential/herald/DifferentialRevisionContentHeraldField.php @@ -9,6 +9,10 @@ final class DifferentialRevisionContentHeraldField return pht('Changed file content'); } + public function getFieldGroupKey() { + return DifferentialChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadContentDictionary(); } diff --git a/src/applications/differential/herald/DifferentialRevisionContentRemovedHeraldField.php b/src/applications/differential/herald/DifferentialRevisionContentRemovedHeraldField.php index dd9fc8ea3a..4278745cea 100644 --- a/src/applications/differential/herald/DifferentialRevisionContentRemovedHeraldField.php +++ b/src/applications/differential/herald/DifferentialRevisionContentRemovedHeraldField.php @@ -9,6 +9,10 @@ final class DifferentialRevisionContentRemovedHeraldField return pht('Removed file content'); } + public function getFieldGroupKey() { + return DifferentialChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadRemovedContentDictionary(); } diff --git a/src/applications/differential/herald/DifferentialRevisionHeraldField.php b/src/applications/differential/herald/DifferentialRevisionHeraldField.php index 845c933f5d..dceae60b86 100644 --- a/src/applications/differential/herald/DifferentialRevisionHeraldField.php +++ b/src/applications/differential/herald/DifferentialRevisionHeraldField.php @@ -6,4 +6,8 @@ abstract class DifferentialRevisionHeraldField extends HeraldField { return ($object instanceof DifferentialRevision); } + public function getFieldGroupKey() { + return DifferentialRevisionHeraldFieldGroup::FIELDGROUPKEY; + } + } diff --git a/src/applications/differential/herald/DifferentialRevisionHeraldFieldGroup.php b/src/applications/differential/herald/DifferentialRevisionHeraldFieldGroup.php new file mode 100644 index 0000000000..ba70222eb1 --- /dev/null +++ b/src/applications/differential/herald/DifferentialRevisionHeraldFieldGroup.php @@ -0,0 +1,15 @@ +getAdapter()->loadAffectedPackages(); return mpull($packages, 'getPHID'); diff --git a/src/applications/differential/herald/DifferentialRevisionPackageOwnerHeraldField.php b/src/applications/differential/herald/DifferentialRevisionPackageOwnerHeraldField.php index 5bfe3322d8..90605faeea 100644 --- a/src/applications/differential/herald/DifferentialRevisionPackageOwnerHeraldField.php +++ b/src/applications/differential/herald/DifferentialRevisionPackageOwnerHeraldField.php @@ -9,6 +9,10 @@ final class DifferentialRevisionPackageOwnerHeraldField return pht('Affected package owners'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $packages = $this->getAdapter()->loadAffectedPackages(); if (!$packages) { diff --git a/src/applications/diffusion/herald/DiffusionChangeHeraldFieldGroup.php b/src/applications/diffusion/herald/DiffusionChangeHeraldFieldGroup.php new file mode 100644 index 0000000000..aebd2823fd --- /dev/null +++ b/src/applications/diffusion/herald/DiffusionChangeHeraldFieldGroup.php @@ -0,0 +1,15 @@ +getAdapter()->loadAffectedPaths(); } diff --git a/src/applications/diffusion/herald/DiffusionCommitDiffContentAddedHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitDiffContentAddedHeraldField.php index cd7bf4cc30..f785b1593c 100644 --- a/src/applications/diffusion/herald/DiffusionCommitDiffContentAddedHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitDiffContentAddedHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitDiffContentAddedHeraldField return pht('Diff content added'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadDiffContent('+'); } diff --git a/src/applications/diffusion/herald/DiffusionCommitDiffContentHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitDiffContentHeraldField.php index d78e95f319..ed67d340ce 100644 --- a/src/applications/diffusion/herald/DiffusionCommitDiffContentHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitDiffContentHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitDiffContentHeraldField return pht('Diff content'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadDiffContent('*'); } diff --git a/src/applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php index 4bb36ed4ef..e5cf1a8ef6 100644 --- a/src/applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitDiffContentRemovedHeraldField return pht('Diff content removed'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->loadDiffContent('-'); } diff --git a/src/applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php index 2e3b91b0d6..323d512b25 100644 --- a/src/applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitDiffEnormousHeraldField return pht('Change is enormous'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->isDiffEnormous(); } diff --git a/src/applications/diffusion/herald/DiffusionCommitHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitHeraldField.php index 1dbfd37c34..30a77c802a 100644 --- a/src/applications/diffusion/herald/DiffusionCommitHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitHeraldField.php @@ -6,4 +6,8 @@ abstract class DiffusionCommitHeraldField extends HeraldField { return ($object instanceof PhabricatorRepositoryCommit); } + public function getFieldGroupKey() { + return DiffusionCommitHeraldFieldGroup::FIELDGROUPKEY; + } + } diff --git a/src/applications/diffusion/herald/DiffusionCommitHeraldFieldGroup.php b/src/applications/diffusion/herald/DiffusionCommitHeraldFieldGroup.php new file mode 100644 index 0000000000..34b781f8d8 --- /dev/null +++ b/src/applications/diffusion/herald/DiffusionCommitHeraldFieldGroup.php @@ -0,0 +1,15 @@ +getAdapter()->loadAuditNeededPackages(); if (!$packages) { diff --git a/src/applications/diffusion/herald/DiffusionCommitPackageHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitPackageHeraldField.php index 08e2fdee6d..e00024cfc6 100644 --- a/src/applications/diffusion/herald/DiffusionCommitPackageHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitPackageHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitPackageHeraldField return pht('Affected packages'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $packages = $this->getAdapter()->loadAffectedPackages(); return mpull($packages, 'getPHID'); diff --git a/src/applications/diffusion/herald/DiffusionCommitPackageOwnerHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitPackageOwnerHeraldField.php index c4dd341ee2..117794f518 100644 --- a/src/applications/diffusion/herald/DiffusionCommitPackageOwnerHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitPackageOwnerHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitPackageOwnerHeraldField return pht('Affected package owners'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $packages = $this->getAdapter()->loadAffectedPackages(); if (!$packages) { diff --git a/src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php index cb5b449989..10d9c29c92 100644 --- a/src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitRevisionAcceptedHeraldField return pht('Accepted Differential revision'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $revision = $this->getAdapter()->loadDifferentialRevision(); if (!$revision) { diff --git a/src/applications/diffusion/herald/DiffusionCommitRevisionHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitRevisionHeraldField.php index 5e51e86639..02ac8f124a 100644 --- a/src/applications/diffusion/herald/DiffusionCommitRevisionHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitRevisionHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitRevisionHeraldField return pht('Differential revision'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $revision = $this->getAdapter()->loadDifferentialRevision(); diff --git a/src/applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php index 91103a78fd..684f5d75d6 100644 --- a/src/applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitRevisionReviewersHeraldField return pht('Differential reviewers'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $revision = $this->getAdapter()->loadDifferentialRevision(); diff --git a/src/applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php index e873e6e74a..460f001dc0 100644 --- a/src/applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionCommitRevisionSubscribersHeraldField return pht('Differential subscribers'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $revision = $this->getAdapter()->loadDifferentialRevision(); diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentAffectedFilesHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentAffectedFilesHeraldField.php index bef87ce4ba..f73547ec93 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentAffectedFilesHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentAffectedFilesHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentAffectedFilesHeraldField return pht('Affected files'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->getDiffContent('name'); } diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentAddedHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentAddedHeraldField.php index 46b4a2c3c0..b07bc9f17e 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentAddedHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentAddedHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentDiffContentAddedHeraldField return pht('Added diff content'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->getDiffContent('+'); } diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentHeraldField.php index db33589acb..3a531c32f1 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentDiffContentHeraldField return pht('Diff content'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->getDiffContent('*'); } diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentRemovedHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentRemovedHeraldField.php index 1ae34c29c4..65e4c3db29 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentRemovedHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentDiffContentRemovedHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentDiffContentRemovedHeraldField return pht('Removed diff content'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->getDiffContent('-'); } diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentDiffEnormousHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentDiffEnormousHeraldField.php index d56018d73c..452add3104 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentDiffEnormousHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentDiffEnormousHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentDiffEnormousHeraldField return pht('Diff is enormous'); } + public function getFieldGroupKey() { + return DiffusionChangeHeraldFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return $this->getAdapter()->isDiffEnormous(); } diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentHeraldField.php index 0f323cc9c6..6e3d88a371 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentHeraldField.php @@ -14,4 +14,8 @@ abstract class DiffusionPreCommitContentHeraldField extends HeraldField { return true; } + public function getFieldGroupKey() { + return DiffusionCommitHeraldFieldGroup::FIELDGROUPKEY; + } + } diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php index 90b0b48b1c..864cc043af 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentRevisionAcceptedHeraldField return pht('Accepted Differential revision'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $revision = $this->getAdapter()->getRevision(); diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionHeraldField.php index 703c5aa95a..57fa4a9e32 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentRevisionHeraldField return pht('Differential revision'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $revision = $this->getAdapter()->getRevision(); diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionReviewersHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionReviewersHeraldField.php index bc494d22ba..bce6b5b517 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionReviewersHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionReviewersHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentRevisionReviewersHeraldField return pht('Differential reviewers'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $revision = $this->getAdapter()->getRevision(); diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionSubscribersHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionSubscribersHeraldField.php index b32757485a..b722793756 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionSubscribersHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionSubscribersHeraldField.php @@ -9,6 +9,10 @@ final class DiffusionPreCommitContentRevisionSubscribersHeraldField return pht('Differential subscribers'); } + public function getFieldGroupKey() { + return HeraldRelatedFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { $revision = $this->getAdapter()->getRevision(); diff --git a/src/applications/diffusion/herald/DiffusionPreCommitRefHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitRefHeraldField.php index 516027e6e3..42ebf8ad12 100644 --- a/src/applications/diffusion/herald/DiffusionPreCommitRefHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionPreCommitRefHeraldField.php @@ -14,4 +14,8 @@ abstract class DiffusionPreCommitRefHeraldField extends HeraldField { return true; } + public function getFieldGroupKey() { + return DiffusionPreCommitRefHeraldFieldGroup::FIELDGROUPKEY; + } + } diff --git a/src/applications/diffusion/herald/DiffusionPreCommitRefHeraldFieldGroup.php b/src/applications/diffusion/herald/DiffusionPreCommitRefHeraldFieldGroup.php new file mode 100644 index 0000000000..70028422c6 --- /dev/null +++ b/src/applications/diffusion/herald/DiffusionPreCommitRefHeraldFieldGroup.php @@ -0,0 +1,15 @@ +getFieldImplementationMap(), 'getHeraldFieldName'); } + public function getFieldGroupKey($field_key) { + $field = $this->getFieldImplementation($field_key); + + if (!$field) { + return null; + } + + return $field->getFieldGroupKey(); + } + /* -( Conditions )--------------------------------------------------------- */ diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php index bc1aab18c3..360fa4c181 100644 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -435,14 +435,43 @@ final class HeraldRuleController extends HeraldController { } } + $group_map = array(); + foreach ($field_map as $field_key => $field_name) { + $group_key = $adapter->getFieldGroupKey($field_key); + $group_map[$group_key][$field_key] = $field_name; + } + + $field_groups = HeraldFieldGroup::getAllFieldGroups(); + + $groups = array(); + foreach ($group_map as $group_key => $options) { + asort($options); + + $field_group = idx($field_groups, $group_key); + if ($field_group) { + $group_label = $field_group->getGroupLabel(); + $group_order = $field_group->getSortKey(); + } else { + $group_label = nonempty($group_key, pht('Other')); + $group_order = 'Z'; + } + + $groups[] = array( + 'label' => $group_label, + 'options' => $options, + 'order' => $group_order, + ); + } + + $groups = array_values(isort($groups, 'order')); $config_info = array(); - $config_info['fields'] = $field_map; + $config_info['fields'] = $groups; $config_info['conditions'] = $all_conditions; $config_info['actions'] = $action_map; $config_info['valueMap'] = array(); - foreach ($config_info['fields'] as $field => $name) { + foreach ($field_map as $field => $name) { try { $field_conditions = $adapter->getConditionsForField($field); } catch (Exception $ex) { @@ -451,7 +480,7 @@ final class HeraldRuleController extends HeraldController { $config_info['conditionMap'][$field] = $field_conditions; } - foreach ($config_info['fields'] as $field => $fname) { + foreach ($field_map as $field => $fname) { foreach ($config_info['conditionMap'][$field] as $condition) { $value_key = $adapter->getValueTypeForFieldAndCondition( $field, diff --git a/src/applications/herald/field/HeraldAlwaysField.php b/src/applications/herald/field/HeraldAlwaysField.php index 41d23d7816..13d3649ef2 100644 --- a/src/applications/herald/field/HeraldAlwaysField.php +++ b/src/applications/herald/field/HeraldAlwaysField.php @@ -8,6 +8,10 @@ final class HeraldAlwaysField extends HeraldField { return pht('Always'); } + public function getFieldGroupKey() { + return HeraldBasicFieldGroup::FIELDGROUPKEY; + } + public function getHeraldFieldValue($object) { return true; } diff --git a/src/applications/herald/field/HeraldAnotherRuleField.php b/src/applications/herald/field/HeraldAnotherRuleField.php index 3b5635e332..920d7e89e3 100644 --- a/src/applications/herald/field/HeraldAnotherRuleField.php +++ b/src/applications/herald/field/HeraldAnotherRuleField.php @@ -8,6 +8,10 @@ final class HeraldAnotherRuleField extends HeraldField { return pht('Another Herald rule'); } + public function getFieldGroupKey() { + return HeraldBasicFieldGroup::FIELDGROUPKEY; + } + public function supportsObject($object) { return true; } diff --git a/src/applications/herald/field/HeraldBasicFieldGroup.php b/src/applications/herald/field/HeraldBasicFieldGroup.php new file mode 100644 index 0000000000..966f585754 --- /dev/null +++ b/src/applications/herald/field/HeraldBasicFieldGroup.php @@ -0,0 +1,15 @@ +getAdapter()->getContentSource()->getSource(); } diff --git a/src/applications/herald/field/HeraldEditFieldGroup.php b/src/applications/herald/field/HeraldEditFieldGroup.php new file mode 100644 index 0000000000..baaa222057 --- /dev/null +++ b/src/applications/herald/field/HeraldEditFieldGroup.php @@ -0,0 +1,15 @@ +getConstant('FIELDGROUPKEY'); + if ($const === false) { + throw new Exception( + pht( + '"%s" class "%s" must define a "%s" property.', + __CLASS__, + get_class($this), + 'FIELDCONST')); + } + + return $const; + } + + public function getSortKey() { + return sprintf('A%08d%s', $this->getGroupOrder(), $this->getGroupLabel()); + } + + final public static function getAllFieldGroups() { + return id(new PhutilClassMapQuery()) + ->setAncestorClass(__CLASS__) + ->setUniqueMethod('getGroupKey') + ->setSortMethod('getSortKey') + ->execute(); + } +} diff --git a/src/applications/herald/field/HeraldNewObjectField.php b/src/applications/herald/field/HeraldNewObjectField.php index 48cc3cc465..4076bd717c 100644 --- a/src/applications/herald/field/HeraldNewObjectField.php +++ b/src/applications/herald/field/HeraldNewObjectField.php @@ -8,6 +8,10 @@ final class HeraldNewObjectField extends HeraldField { return pht('Is newly created'); } + public function getFieldGroupKey() { + return HeraldEditFieldGroup::FIELDGROUPKEY; + } + public function supportsObject($object) { return !$this->getAdapter()->isSingleEventAdapter(); } diff --git a/src/applications/herald/field/HeraldRelatedFieldGroup.php b/src/applications/herald/field/HeraldRelatedFieldGroup.php new file mode 100644 index 0000000000..af05b13745 --- /dev/null +++ b/src/applications/herald/field/HeraldRelatedFieldGroup.php @@ -0,0 +1,15 @@ +customField; } + public function getFieldGroupKey() { + return PhabricatorCustomFieldHeraldFieldGroup::FIELDGROUPKEY; + } + public function supportsObject($object) { return ($object instanceof PhabricatorCustomFieldInterface); } diff --git a/src/infrastructure/customfield/herald/PhabricatorCustomFieldHeraldFieldGroup.php b/src/infrastructure/customfield/herald/PhabricatorCustomFieldHeraldFieldGroup.php new file mode 100644 index 0000000000..7ee5b50cc4 --- /dev/null +++ b/src/infrastructure/customfield/herald/PhabricatorCustomFieldHeraldFieldGroup.php @@ -0,0 +1,15 @@ +