Select new role when creating screen with a different role than the selected one
This commit is contained in:
parent
48a1932bc3
commit
8022fc1230
|
@ -10,6 +10,7 @@ import {
|
||||||
currentAsset,
|
currentAsset,
|
||||||
mainLayout,
|
mainLayout,
|
||||||
selectedComponent,
|
selectedComponent,
|
||||||
|
selectedAccessRole,
|
||||||
} from "builderStore"
|
} from "builderStore"
|
||||||
import { fetchComponentLibDefinitions } from "../loadComponentLibraries"
|
import { fetchComponentLibDefinitions } from "../loadComponentLibraries"
|
||||||
import api from "../api"
|
import api from "../api"
|
||||||
|
@ -88,6 +89,11 @@ export const getFrontendStore = () => {
|
||||||
let screen =
|
let screen =
|
||||||
screens.find(screen => screen._id === screenId) || screens[0]
|
screens.find(screen => screen._id === screenId) || screens[0]
|
||||||
if (!screen) return state
|
if (!screen) return state
|
||||||
|
|
||||||
|
// Update role to the screen's role setting so that it will always
|
||||||
|
// be visible
|
||||||
|
selectedAccessRole.set(screen.routing.roleId)
|
||||||
|
|
||||||
state.currentFrontEndType = FrontendTypes.SCREEN
|
state.currentFrontEndType = FrontendTypes.SCREEN
|
||||||
state.currentAssetId = screen._id
|
state.currentAssetId = screen._id
|
||||||
state.currentView = "detail"
|
state.currentView = "detail"
|
||||||
|
|
Loading…
Reference in New Issue