Merge pull request #915 from mattermost/plt-300
PLT-300 Update allow/deny oauth page UI, and add ouath as reserved word.
Этот коммит содержится в:
@@ -163,6 +163,7 @@ var reservedName = []string{
|
|||||||
"post",
|
"post",
|
||||||
"cluster",
|
"cluster",
|
||||||
"api",
|
"api",
|
||||||
|
"oauth",
|
||||||
}
|
}
|
||||||
|
|
||||||
var wwwStart = regexp.MustCompile(`^www`)
|
var wwwStart = regexp.MustCompile(`^www`)
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
|
|
||||||
var Authorize = require('../components/authorize.jsx');
|
var Authorize = require('../components/authorize.jsx');
|
||||||
|
|
||||||
function setupAuthorizePage(teamName, appName, responseType, clientId, redirectUri, scope, state) {
|
function setupAuthorizePage(props) {
|
||||||
React.render(
|
React.render(
|
||||||
<Authorize
|
<Authorize
|
||||||
teamName={teamName}
|
teamName={props.TeamName}
|
||||||
appName={appName}
|
appName={props.AppName}
|
||||||
responseType={responseType}
|
responseType={props.ResponseType}
|
||||||
clientId={clientId}
|
clientId={props.ClientId}
|
||||||
redirectUri={redirectUri}
|
redirectUri={props.RedirectUri}
|
||||||
scope={scope}
|
scope={props.Scope}
|
||||||
state={state}
|
state={props.State}
|
||||||
/>,
|
/>,
|
||||||
document.getElementById('authorize')
|
document.getElementById('authorize')
|
||||||
);
|
);
|
||||||
|
|||||||
31
web/sass-files/sass/partials/_oauth.scss
Обычный файл
31
web/sass-files/sass/partials/_oauth.scss
Обычный файл
@@ -0,0 +1,31 @@
|
|||||||
|
.oauth-prompt {
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
padding: 1em 2em 0;
|
||||||
|
margin: 50px auto;
|
||||||
|
max-width: 90%;
|
||||||
|
width: 600px;
|
||||||
|
.prompt__heading {
|
||||||
|
font-size: em(20px);
|
||||||
|
line-height: normal;
|
||||||
|
margin: 1em 0;
|
||||||
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
> div {
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.prompt__allow {
|
||||||
|
margin: 1em 0;
|
||||||
|
font-size: em(24px);
|
||||||
|
}
|
||||||
|
.prompt__buttons {
|
||||||
|
text-align: right;
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
padding: 1.5em 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -41,3 +41,6 @@
|
|||||||
|
|
||||||
// Responsive Css
|
// Responsive Css
|
||||||
@import "partials/responsive";
|
@import "partials/responsive";
|
||||||
|
|
||||||
|
// Standalone Css
|
||||||
|
@import "partials/oauth";
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
{{define "authorize"}}
|
{{define "authorize"}}
|
||||||
<html>
|
<html>
|
||||||
{{template "head" . }}
|
{{template "head" . }}
|
||||||
<body class="white">
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="inner__wrap">
|
<div class="oauth-prompt">
|
||||||
<div class="row content">
|
<div class="prompt__heading">
|
||||||
<div class="signup-header">
|
<div class="prompt__app-icon">
|
||||||
{{.Props.TeamName}}
|
<img src="/static/images/icon50x50.gif" width="50" height="50" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12">
|
<div class="text">An application would like to connect to your {{.Props.TeamName}} account.</div>
|
||||||
<div id="authorize"></div>
|
</div>
|
||||||
</div>
|
<p>The app <strong>{{.Props.AppName}}</strong> would like the ability to access Mattermost on your behalf.</p>
|
||||||
<div class="footer-push"></div>
|
<h2 class="prompt__allow">Allow <strong>{{.Props.AppName}}</strong> access?</h2>
|
||||||
</div>
|
<div class="prompt__buttons">
|
||||||
<div class="row footer">
|
<input type="button" class="btn btn-link" value="Deny">
|
||||||
{{template "footer" . }}
|
<input type="button" class="btn btn-primary" value="Allow">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
window.setup_authorize_page('{{ .Props.TeamName }}', '{{ .Props.AppName }}', '{{ .Props.ResponseType }}', '{{ .Props.ClientId }}', '{{ .Props.RedirectUri }}', '{{ .Props.Scope }}', '{{ .Props.State }}' );
|
window.setup_authorize_page('{{.Props}}');
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user