-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Activity state display for plans in Gantt and Time list views (#7370)
* Add activity states domain object and interceptor to auto create one * Add activity state inspector option * Only save status if we have a unique ids for activities * Include the id in the activity properties * Don't show activity state section in the inspector if multiple activities are selected * Display activity properties when an activity row is selected in the timelist * Use activity id as key if it is available * Ensure the correct option is selected for activity states * Add status label * Refactor activity selection. Display activity properties * Remove activity states plugin. Move the activity states interceptor to the plan plugin. * Change activity states interceptor parameters to options * Rename constants * Fix activity states test * Add e2e test for activity states feature. * Address review comments. Rename variables, documentation. * No shallow copy * Suppress lint warning for conditionals * Remove check for abort controller * Move classes to components * number primitive * Closes #7369 - WIP tweaks to simplify the Inspector view. * Ensure 'notStarted' is the default state for activities * Remove extra quotes * Closes #7369 - Mod to `s-selected` styling to allow selection visiblity on Time List rows. * Use generated key for vue * Fix e2e tests * Fix timelist test --------- Co-authored-by: Charles Hacskaylo <[email protected]> Co-authored-by: John Hill <[email protected]>
- Loading branch information
1 parent
60e1eeb
commit dc5a323
Showing
20 changed files
with
771 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/***************************************************************************** | ||
* Open MCT, Copyright (c) 2014-2024, United States Government | ||
* as represented by the Administrator of the National Aeronautics and Space | ||
* Administration. All rights reserved. | ||
* | ||
* Open MCT is licensed under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* Open MCT includes source code licensed under additional open source | ||
* licenses. See the Open Source Licenses file (LICENSES.md) included with | ||
* this source code distribution or the Licensing information page available | ||
* at runtime from the About dialog for additional information. | ||
*****************************************************************************/ | ||
|
||
import { ACTIVITY_STATES_KEY } from './createActivityStatesIdentifier.js'; | ||
|
||
/** | ||
* @typedef {object} ActivityStatesInterceptorOptions | ||
* @property {import('../../api/objects/ObjectAPI').Identifier} identifier the {namespace, key} to use for the activity states object. | ||
* @property {string} name The name of the activity states model. | ||
* @property {number} priority the priority of the interceptor. By default, it is low. | ||
*/ | ||
|
||
/** | ||
* Creates an activity states object in the persistence store. This is used to save plan activity states. | ||
* This will only get invoked when an attempt is made to save the state for an activity and no activity states object exists in the store. | ||
* @param {import('../../../openmct').OpenMCT} openmct | ||
* @param {ActivityStatesInterceptorOptions} options | ||
* @returns {object} | ||
*/ | ||
const ACTIVITY_STATES_TYPE = 'activity-states'; | ||
|
||
function activityStatesInterceptor(openmct, options) { | ||
const { identifier, name, priority = openmct.priority.LOW } = options; | ||
const activityStatesModel = { | ||
identifier, | ||
name, | ||
type: ACTIVITY_STATES_TYPE, | ||
activities: {}, | ||
location: null | ||
}; | ||
|
||
return { | ||
appliesTo: (identifierObject) => { | ||
return identifierObject.key === ACTIVITY_STATES_KEY; | ||
}, | ||
invoke: (identifierObject, object) => { | ||
if (!object || openmct.objects.isMissing(object)) { | ||
openmct.objects.save(activityStatesModel); | ||
|
||
return activityStatesModel; | ||
} | ||
|
||
return object; | ||
}, | ||
priority | ||
}; | ||
} | ||
|
||
export default activityStatesInterceptor; |
30 changes: 30 additions & 0 deletions
30
src/plugins/activityStates/createActivityStatesIdentifier.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/***************************************************************************** | ||
* Open MCT, Copyright (c) 2014-2024, United States Government | ||
* as represented by the Administrator of the National Aeronautics and Space | ||
* Administration. All rights reserved. | ||
* | ||
* Open MCT is licensed under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* Open MCT includes source code licensed under additional open source | ||
* licenses. See the Open Source Licenses file (LICENSES.md) included with | ||
* this source code distribution or the Licensing information page available | ||
* at runtime from the About dialog for additional information. | ||
*****************************************************************************/ | ||
|
||
export const ACTIVITY_STATES_KEY = 'activity-states'; | ||
|
||
export function createActivityStatesIdentifier(namespace = '') { | ||
return { | ||
key: ACTIVITY_STATES_KEY, | ||
namespace | ||
}; | ||
} |
Oops, something went wrong.