mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 13:43:09 +00:00
refactor: more method renaming
This commit is contained in:
parent
1c4b611fbb
commit
eece4d03d4
@ -114,23 +114,23 @@ export default class StatusAPI extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
setMissionStatusForRole(role, status) {
|
||||
setStatusForMissionRole(role, status) {
|
||||
const provider = this.#userAPI.getProvider();
|
||||
|
||||
if (provider.setMissionStatusForRole) {
|
||||
return provider.setMissionStatusForRole(role, status);
|
||||
if (provider.setStatusForMissionRole) {
|
||||
return provider.setStatusForMissionRole(role, status);
|
||||
} else {
|
||||
this.#userAPI.error('User provider does not support setting mission status');
|
||||
this.#userAPI.error('User provider does not support setting mission role status');
|
||||
}
|
||||
}
|
||||
|
||||
getMissionStatusForRole(role) {
|
||||
getStatusForMissionRole(role) {
|
||||
const provider = this.#userAPI.getProvider();
|
||||
|
||||
if (provider.getMissionStatusForRole) {
|
||||
return provider.getMissionStatusForRole(role);
|
||||
if (provider.getStatusForMissionRole) {
|
||||
return provider.getStatusForMissionRole(role);
|
||||
} else {
|
||||
this.#userAPI.error('User provider does not support getting mission status');
|
||||
this.#userAPI.error('User provider does not support getting mission role status');
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,11 +138,11 @@ export default class StatusAPI extends EventEmitter {
|
||||
* Fetch the list of possible mission status options
|
||||
* @returns {Promise<MissionStatusOption[]>} the current mission status
|
||||
*/
|
||||
async getPossibleMissionStatusOptions() {
|
||||
async getPossibleMissionRoleStatuses() {
|
||||
const provider = this.#userAPI.getProvider();
|
||||
|
||||
if (provider.getPossibleMissionStatusOptions) {
|
||||
const possibleOptions = await provider.getPossibleMissionStatusOptions();
|
||||
if (provider.getPossibleMissionRoleStatuses) {
|
||||
const possibleOptions = await provider.getPossibleMissionRoleStatuses();
|
||||
|
||||
return possibleOptions;
|
||||
} else {
|
||||
|
@ -48,17 +48,17 @@ export default {
|
||||
},
|
||||
async created() {
|
||||
try {
|
||||
// Fetch missionStatuses and missionStatusOptions simultaneously
|
||||
// Fetch missionStatuses and missionRoleStatuses simultaneously
|
||||
const [missionRoles, missionRoleStatusOptions] = await Promise.all([
|
||||
this.openmct.user.status.getPossibleMissionRoles(),
|
||||
this.openmct.user.status.getPossibleMissionStatusOptions()
|
||||
this.openmct.user.status.getPossibleMissionRoleStatuses()
|
||||
]);
|
||||
|
||||
this.missionRoles = missionRoles;
|
||||
this.missionRoleStatusOptions = missionRoleStatusOptions;
|
||||
|
||||
const statusPromises = missionRoles.map((status) =>
|
||||
this.openmct.user.status.getMissionStatusForRole(status)
|
||||
const statusPromises = missionRoles.map((role) =>
|
||||
this.openmct.user.status.getStatusForMissionRole(role)
|
||||
);
|
||||
|
||||
// Fetch all mission role statuses simultaneously
|
||||
@ -89,7 +89,7 @@ export default {
|
||||
if (this.missionRoleStatusMap !== undefined) {
|
||||
const statusObject = this.findOptionByKey(this.missionRoleStatusMap[status]);
|
||||
|
||||
const result = await this.openmct.user.status.setMissionStatusForRole(status, statusObject);
|
||||
const result = await this.openmct.user.status.setStatusForMissionRole(status, statusObject);
|
||||
if (result === true) {
|
||||
this.openmct.notifications.info('Successfully set mission status');
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user