Can now provide default app name, scope and redirect uris via query string when creating app
This commit is contained in:
parent
c8fcf1b0d9
commit
9c2351bad9
|
@ -77,17 +77,19 @@ import TranslationsMixin from "@/components/mixins/Translations"
|
||||||
export default {
|
export default {
|
||||||
mixins: [TranslationsMixin],
|
mixins: [TranslationsMixin],
|
||||||
props: {
|
props: {
|
||||||
app: {type: Object, required: false}
|
app: {type: Object, required: false},
|
||||||
|
defaults: {type: Object, required: false}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let app = this.app || {}
|
let app = this.app || {}
|
||||||
|
let defaults = this.defaults || {}
|
||||||
return {
|
return {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
errors: [],
|
errors: [],
|
||||||
fields: {
|
fields: {
|
||||||
name: app.name || '',
|
name: app.name || defaults.name || '',
|
||||||
redirect_uris: app.redirect_uris || 'urn:ietf:wg:oauth:2.0:oob',
|
redirect_uris: app.redirect_uris || defaults.redirect_uris || 'urn:ietf:wg:oauth:2.0:oob',
|
||||||
scopes: app.scopes || 'read'
|
scopes: app.scopes || defaults.scopes || 'read'
|
||||||
},
|
},
|
||||||
scopes: [
|
scopes: [
|
||||||
{id: "profile", icon: 'user'},
|
{id: "profile", icon: 'user'},
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<translate translate-context="Content/Applications/Title">Create a new application</translate>
|
<translate translate-context="Content/Applications/Title">Create a new application</translate>
|
||||||
</h2>
|
</h2>
|
||||||
<application-form
|
<application-form
|
||||||
|
:defaults="defaults"
|
||||||
@created="$router.push({name: 'settings.applications.edit', params: {id: $event.client_id}})" />
|
@created="$router.push({name: 'settings.applications.edit', params: {id: $event.client_id}})" />
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
import ApplicationForm from "@/components/auth/ApplicationForm"
|
import ApplicationForm from "@/components/auth/ApplicationForm"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
props: ['name', 'redirect_uris', 'scopes'],
|
||||||
components: {
|
components: {
|
||||||
ApplicationForm
|
ApplicationForm
|
||||||
},
|
},
|
||||||
|
@ -26,6 +28,11 @@ export default {
|
||||||
return {
|
return {
|
||||||
application: null,
|
application: null,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
defaults: {
|
||||||
|
name: this.name,
|
||||||
|
redirect_uris: this.redirect_uris,
|
||||||
|
scopes: this.scopes,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
@ -104,6 +104,11 @@ export default new Router({
|
||||||
{
|
{
|
||||||
path: '/settings/applications/new',
|
path: '/settings/applications/new',
|
||||||
name: 'settings.applications.new',
|
name: 'settings.applications.new',
|
||||||
|
props: (route) => ({
|
||||||
|
scopes: route.query.scopes,
|
||||||
|
name: route.query.name,
|
||||||
|
redirect_uris: route.query.redirect_uris,
|
||||||
|
}),
|
||||||
component: () =>
|
component: () =>
|
||||||
import(/* webpackChunkName: "core" */ "@/components/auth/ApplicationNew"),
|
import(/* webpackChunkName: "core" */ "@/components/auth/ApplicationNew"),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue