User landingPages connect per role permission.
This commit is contained in:
+21
@@ -30,6 +30,7 @@ const app = new Vue({
|
||||
form: new Form('user'),
|
||||
bulk_action: new BulkAction('users'),
|
||||
show_password: false,
|
||||
landing_pages: null,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -51,5 +52,25 @@ const app = new Vue({
|
||||
this.show_password = false;
|
||||
}
|
||||
},
|
||||
|
||||
onChangeRole(role_id) {
|
||||
if (! role_id) {
|
||||
return;
|
||||
}
|
||||
|
||||
let role_promise = Promise.resolve(window.axios.get(url + '/auth/users/landingpages', {
|
||||
params: {
|
||||
role_id: role_id
|
||||
}
|
||||
}));
|
||||
|
||||
role_promise.then(response => {
|
||||
if (response.data.success) {
|
||||
this.landing_pages = response.data.data;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
@endcan
|
||||
|
||||
@role('admin|manager')
|
||||
<x-form.group.select name="roles" label="{{ trans_choice('general.roles', 1) }}" :options="$roles" />
|
||||
<x-form.group.select name="roles" label="{{ trans_choice('general.roles', 1) }}" :options="$roles" change="onChangeRole" />
|
||||
@endrole
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
@@ -56,7 +56,7 @@
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<x-form.group.select name="landing_page" label="{!! trans('auth.landing_page') !!}" :options="$landing_pages" selected="dashboard" />
|
||||
<x-form.group.select name="landing_page" label="{!! trans('auth.landing_page') !!}" :options="$landing_pages" dynamicOptions="landing_pages" selected="dashboard" />
|
||||
|
||||
<x-form.group.locale />
|
||||
</x-slot>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
@endcan
|
||||
|
||||
@role('admin|manager')
|
||||
<x-form.group.select name="roles" label="{{ trans_choice('general.roles', 1) }}" :options="$roles" selected-key="roles.id" />
|
||||
<x-form.group.select name="roles" label="{{ trans_choice('general.roles', 1) }}" :options="$roles" change="onChangeRole" selected-key="roles.id" />
|
||||
@endrole
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
@@ -62,7 +62,7 @@
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<x-form.group.select name="landing_page" label="{{ trans('auth.landing_page') }}" :options="$landing_pages" />
|
||||
<x-form.group.select name="landing_page" label="{{ trans('auth.landing_page') }}" :options="$landing_pages" dynamicOptions="landing_pages" />
|
||||
|
||||
<x-form.group.locale />
|
||||
</x-slot>
|
||||
|
||||
Reference in New Issue
Block a user