diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 365b256326..d558032906 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => 'aee99781', + 'core.pkg.css' => 'ee3f9253', 'core.pkg.js' => '1d376fa9', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '3fb7f532', @@ -163,7 +163,7 @@ return array( 'rsrc/css/phui/workboards/phui-workboard.css' => 'bda3ef58', 'rsrc/css/phui/workboards/phui-workcard.css' => '0c62d7c5', 'rsrc/css/phui/workboards/phui-workpanel.css' => '92197373', - 'rsrc/css/sprite-login.css' => '60e8560e', + 'rsrc/css/sprite-login.css' => '6dbbbd97', 'rsrc/css/sprite-tokens.css' => '9cdfd599', 'rsrc/css/syntax/syntax-default.css' => '9923583c', 'rsrc/externals/d3/d3.min.js' => 'a11a5ff2', @@ -342,8 +342,8 @@ return array( 'rsrc/image/phrequent_active.png' => 'a466a8ed', 'rsrc/image/phrequent_inactive.png' => 'bfc15a69', 'rsrc/image/resize.png' => 'fd476de4', - 'rsrc/image/sprite-login-X2.png' => 'e3991e37', - 'rsrc/image/sprite-login.png' => '03d5af29', + 'rsrc/image/sprite-login-X2.png' => '4abee916', + 'rsrc/image/sprite-login.png' => '2b9663fd', 'rsrc/image/sprite-tokens-X2.png' => '804a5232', 'rsrc/image/sprite-tokens.png' => 'b41d03da', 'rsrc/image/texture/card-gradient.png' => '815f26e8', @@ -890,7 +890,7 @@ return array( 'releeph-request-differential-create-dialog' => '8d8b92cd', 'releeph-request-typeahead-css' => '667a48ae', 'setup-issue-css' => 'f794cfc3', - 'sprite-login-css' => '60e8560e', + 'sprite-login-css' => '6dbbbd97', 'sprite-tokens-css' => '9cdfd599', 'syntax-default-css' => '9923583c', 'syntax-highlighting-css' => '769d3498', diff --git a/resources/sprite/login_1x/Slack.png b/resources/sprite/login_1x/Slack.png new file mode 100644 index 0000000000..411bf73c13 Binary files /dev/null and b/resources/sprite/login_1x/Slack.png differ diff --git a/resources/sprite/login_2x/Slack.png b/resources/sprite/login_2x/Slack.png new file mode 100644 index 0000000000..163d96cea0 Binary files /dev/null and b/resources/sprite/login_2x/Slack.png differ diff --git a/resources/sprite/manifest/login.json b/resources/sprite/manifest/login.json index a75d2fa69e..f62a0a8ea0 100644 --- a/resources/sprite/manifest/login.json +++ b/resources/sprite/manifest/login.json @@ -91,6 +91,11 @@ "rule": ".login-Phabricator", "hash": "d0f830803593bbcc025d7d5a29ee3ecd" }, + "login-Slack": { + "name": "login-Slack", + "rule": ".login-Slack", + "hash": "fe0df2df040032b949aa05948b6bd986" + }, "login-Stripe": { "name": "login-Stripe", "rule": ".login-Stripe", diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 390ce83a9c..82dacf6c70 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3587,6 +3587,7 @@ phutil_register_library_map(array( 'PhabricatorShowFiletreeSetting' => 'applications/settings/setting/PhabricatorShowFiletreeSetting.php', 'PhabricatorSimpleEditType' => 'applications/transactions/edittype/PhabricatorSimpleEditType.php', 'PhabricatorSite' => 'aphront/site/PhabricatorSite.php', + 'PhabricatorSlackAuthProvider' => 'applications/auth/provider/PhabricatorSlackAuthProvider.php', 'PhabricatorSlowvoteApplication' => 'applications/slowvote/application/PhabricatorSlowvoteApplication.php', 'PhabricatorSlowvoteChoice' => 'applications/slowvote/storage/PhabricatorSlowvoteChoice.php', 'PhabricatorSlowvoteCloseController' => 'applications/slowvote/controller/PhabricatorSlowvoteCloseController.php', @@ -8590,6 +8591,7 @@ phutil_register_library_map(array( 'PhabricatorShowFiletreeSetting' => 'PhabricatorSelectSetting', 'PhabricatorSimpleEditType' => 'PhabricatorEditType', 'PhabricatorSite' => 'AphrontSite', + 'PhabricatorSlackAuthProvider' => 'PhabricatorOAuth2AuthProvider', 'PhabricatorSlowvoteApplication' => 'PhabricatorApplication', 'PhabricatorSlowvoteChoice' => 'PhabricatorSlowvoteDAO', 'PhabricatorSlowvoteCloseController' => 'PhabricatorSlowvoteController', diff --git a/src/applications/auth/provider/PhabricatorSlackAuthProvider.php b/src/applications/auth/provider/PhabricatorSlackAuthProvider.php new file mode 100644 index 0000000000..f1e607d757 --- /dev/null +++ b/src/applications/auth/provider/PhabricatorSlackAuthProvider.php @@ -0,0 +1,36 @@ +getLoginURI()); + + return pht( + "To configure Slack OAuth, create a new application here:". + "\n\n". + "https://api.slack.com/docs/sign-in-with-slack#create_slack_app". + "\n\n". + "When creating your application, use these settings:". + "\n\n". + " - **Redirect URI:** Set this to: `%s`". + "\n\n". + "After completing configuration, copy the **Client ID** and ". + "**Client Secret** to the fields above. (You may need to generate the ". + "client secret by clicking 'New Secret' first.)", + $login_uri); + } + + protected function newOAuthAdapter() { + return new PhutilSlackAuthAdapter(); + } + + protected function getLoginIcon() { + return 'Slack'; + } + +} diff --git a/webroot/rsrc/css/sprite-login.css b/webroot/rsrc/css/sprite-login.css index 8ee1bfadf6..173213922d 100644 --- a/webroot/rsrc/css/sprite-login.css +++ b/webroot/rsrc/css/sprite-login.css @@ -14,7 +14,7 @@ only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 1.5dppx) { .sprite-login { background-image: url(/rsrc/image/sprite-login-X2.png); - background-size: 145px 145px; + background-size: 145px 174px; } } @@ -91,30 +91,34 @@ only screen and (min-resolution: 1.5dppx) { background-position: -58px -87px; } -.login-Stripe { +.login-Slack { background-position: -87px -87px; } -.login-TestPayment { +.login-Stripe { background-position: -116px -87px; } -.login-TwitchTV { +.login-TestPayment { background-position: 0px -116px; } -.login-Twitter { +.login-TwitchTV { background-position: -29px -116px; } -.login-WePay { +.login-Twitter { background-position: -58px -116px; } -.login-WordPressCOM { +.login-WePay { background-position: -87px -116px; } -.login-Yahoo { +.login-WordPressCOM { background-position: -116px -116px; } + +.login-Yahoo { + background-position: 0px -145px; +} diff --git a/webroot/rsrc/image/sprite-login-X2.png b/webroot/rsrc/image/sprite-login-X2.png index 3a75a1890a..78a044ee72 100644 Binary files a/webroot/rsrc/image/sprite-login-X2.png and b/webroot/rsrc/image/sprite-login-X2.png differ diff --git a/webroot/rsrc/image/sprite-login.png b/webroot/rsrc/image/sprite-login.png index 830cc28dc4..a877ad3754 100644 Binary files a/webroot/rsrc/image/sprite-login.png and b/webroot/rsrc/image/sprite-login.png differ