mirror of
https://github.com/nasa/openmct.git
synced 2024-12-27 16:38:51 +00:00
RoleChannelProvider to RoleChannel
This commit is contained in:
parent
aba026ffd2
commit
06f71412a6
@ -30,7 +30,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import RoleChannelProvider from '../../../api/user/RoleChannel';
|
import RoleChannel from '../../../api/user/RoleChannel';
|
||||||
export default {
|
export default {
|
||||||
inject: ['openmct'],
|
inject: ['openmct'],
|
||||||
data() {
|
data() {
|
||||||
@ -38,20 +38,20 @@ export default {
|
|||||||
userName: undefined,
|
userName: undefined,
|
||||||
role: undefined,
|
role: undefined,
|
||||||
loggedIn: false,
|
loggedIn: false,
|
||||||
roleChannelProvider: undefined,
|
roleChannel: undefined,
|
||||||
inputRoleSelection: undefined
|
inputRoleSelection: undefined
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
this.roleChannelProvider = new RoleChannelProvider(this.openmct);
|
this.roleChannel = new RoleChannel(this.openmct);
|
||||||
this.roleChannelProvider.createRoleChannel();
|
this.roleChannel.createRoleChannel();
|
||||||
this.roleChannelProvider.subscribeToRole(this.setRoleSelection);
|
this.roleChannel.subscribeToRole(this.setRoleSelection);
|
||||||
await this.fetchOrPromptForRole();
|
await this.fetchOrPromptForRole();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.roleChannelProvider.unsubscribeToRole();
|
this.roleChannel.unsubscribeToRole();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getUserInfo() {
|
async getUserInfo() {
|
||||||
@ -106,7 +106,7 @@ export default {
|
|||||||
this.setRoleSelection(role);
|
this.setRoleSelection(role);
|
||||||
this.openmct.user.setActiveRole(role);
|
this.openmct.user.setActiveRole(role);
|
||||||
// update other tabs through broadcast channel
|
// update other tabs through broadcast channel
|
||||||
this.roleChannelProvider.broadcastNewRole(role);
|
this.roleChannel.broadcastNewRole(role);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user