From 71d8ffdd803ebbb21f845945cbe668f29287a919 Mon Sep 17 00:00:00 2001 From: Michael Rogers Date: Tue, 20 Jun 2023 17:41:12 -0500 Subject: [PATCH] More flight like status role names and parameter names --- example/exampleUser/ExampleUserProvider.js | 6 +++--- example/exampleUser/plugin.js | 2 +- src/plugins/userIndicator/components/UserIndicator.vue | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example/exampleUser/ExampleUserProvider.js b/example/exampleUser/ExampleUserProvider.js index a229bad2ca..29fc467cd3 100644 --- a/example/exampleUser/ExampleUserProvider.js +++ b/example/exampleUser/ExampleUserProvider.js @@ -67,8 +67,8 @@ export default class ExampleUserProvider extends EventEmitter { this.user = undefined; this.loggedIn = false; this.autoLoginUser = undefined; - this.statusRoleValues = statusRoles.map(x => ({ - role: x, + this.statusRoleValues = statusRoles.map(role => ({ + role: role, status: STATUSES[0] })); this.pollQuestion = undefined; @@ -183,7 +183,7 @@ export default class ExampleUserProvider extends EventEmitter { // for testing purposes, this will skip the form, this wouldn't be used in // a normal authentication process if (this.autoLoginUser) { - this.user = new this.ExampleUser(id, this.autoLoginUser, ['test-role-1', 'test-role-2', 'test-role-3', 'test-role-4']); + this.user = new this.ExampleUser(id, this.autoLoginUser, ['flight', 'driver', 'observer']); this.loggedIn = true; return Promise.resolve(); diff --git a/example/exampleUser/plugin.js b/example/exampleUser/plugin.js index f3726591f0..f0b80a20ed 100644 --- a/example/exampleUser/plugin.js +++ b/example/exampleUser/plugin.js @@ -22,7 +22,7 @@ import ExampleUserProvider from './ExampleUserProvider'; const AUTO_LOGIN_USER = 'guest'; -const STATUS_ROLES = ['test-role-1', 'test-role-2', 'test-role-3']; +const STATUS_ROLES = ['flight', 'driver']; export default function ExampleUserPlugin({autoLoginUser, statusRoles} = { autoLoginUser: AUTO_LOGIN_USER, diff --git a/src/plugins/userIndicator/components/UserIndicator.vue b/src/plugins/userIndicator/components/UserIndicator.vue index ab9f835344..31086b9c23 100644 --- a/src/plugins/userIndicator/components/UserIndicator.vue +++ b/src/plugins/userIndicator/components/UserIndicator.vue @@ -71,9 +71,9 @@ export default { }, promptForRoleSelection() { const allRoles = this.openmct.user.getPossibleRoles(); - const selectionOptions = allRoles.map(x => ({ - key: x, - name: x + const selectionOptions = allRoles.map(role => ({ + key: role, + name: role })).filter(this.openmct.user.canProvideStatusForRole); const dialog = this.openmct.overlays.selection({