-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activity state display for plans in Gantt and Time list views #7370
Merged
Merged
Changes from 31 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
7003f00
Add activity states domain object and interceptor to auto create one
shefalijoshi 92a30a3
Add activity state inspector option
shefalijoshi 4d4f83e
Only save status if we have a unique ids for activities
shefalijoshi 02edb99
Include the id in the activity properties
shefalijoshi e47bfed
Don't show activity state section in the inspector if multiple activi…
shefalijoshi 3c14025
Display activity properties when an activity row is selected in the t…
shefalijoshi 65a7e7e
Use activity id as key if it is available
shefalijoshi 176d344
Ensure the correct option is selected for activity states
shefalijoshi 02c796a
Add status label
shefalijoshi b0a21d4
Refactor activity selection. Display activity properties
shefalijoshi dc1def5
Remove activity states plugin. Move the activity states interceptor t…
shefalijoshi b413a9b
Change activity states interceptor parameters to options
shefalijoshi bbf5454
Rename constants
shefalijoshi 6def4c2
Fix activity states test
shefalijoshi 9b85252
Merge branch 'master' of https://github.com/nasa/openmct into activit…
shefalijoshi 5908f96
Merge branch 'master' into activity-state-display
shefalijoshi 78f2852
Add e2e test for activity states feature.
shefalijoshi 5c6a733
Address review comments. Rename variables, documentation.
shefalijoshi 42ed592
No shallow copy
shefalijoshi 122c84b
Suppress lint warning for conditionals
shefalijoshi 6ee3177
Remove check for abort controller
shefalijoshi 8e53866
Move classes to components
shefalijoshi 619e253
number primitive
shefalijoshi 6a7ea35
Closes #7369
charlesh88 6abfac7
Ensure 'notStarted' is the default state for activities
shefalijoshi fc64682
Remove extra quotes
shefalijoshi 6d3242b
Closes #7369
charlesh88 795b35f
Merge remote-tracking branch 'origin/activity-state-display' into act…
charlesh88 875edd9
Merge branch 'master' into activity-state-display
shefalijoshi a5abc32
Merge branch 'activity-state-display' of https://github.com/nasa/open…
shefalijoshi 2839246
Use generated key for vue
shefalijoshi e79b99e
Fix e2e tests
shefalijoshi 4f6a792
Fix timelist test
shefalijoshi a494a24
Merge branch 'master' into activity-state-display
shefalijoshi e8637b1
Merge branch 'master' into activity-state-display
unlikelyzero f404116
Merge branch 'master' of https://github.com/nasa/openmct into activit…
shefalijoshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. excellent |
||
* @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'; | ||
shefalijoshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export function createActivityStatesIdentifier(namespace = '') { | ||
return { | ||
key: ACTIVITY_STATES_KEY, | ||
namespace | ||
}; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice use of
test.step
!