Skip to content
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 36 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 Jan 10, 2024
92a30a3
Add activity state inspector option
shefalijoshi Jan 10, 2024
4d4f83e
Only save status if we have a unique ids for activities
shefalijoshi Jan 10, 2024
02edb99
Include the id in the activity properties
shefalijoshi Jan 10, 2024
e47bfed
Don't show activity state section in the inspector if multiple activi…
shefalijoshi Jan 10, 2024
3c14025
Display activity properties when an activity row is selected in the t…
shefalijoshi Jan 10, 2024
65a7e7e
Use activity id as key if it is available
shefalijoshi Jan 18, 2024
176d344
Ensure the correct option is selected for activity states
shefalijoshi Jan 18, 2024
02c796a
Add status label
shefalijoshi Jan 19, 2024
b0a21d4
Refactor activity selection. Display activity properties
shefalijoshi Jan 19, 2024
dc1def5
Remove activity states plugin. Move the activity states interceptor t…
shefalijoshi Jan 19, 2024
b413a9b
Change activity states interceptor parameters to options
shefalijoshi Jan 19, 2024
bbf5454
Rename constants
shefalijoshi Jan 19, 2024
6def4c2
Fix activity states test
shefalijoshi Jan 19, 2024
9b85252
Merge branch 'master' of https://github.com/nasa/openmct into activit…
shefalijoshi Jan 19, 2024
5908f96
Merge branch 'master' into activity-state-display
shefalijoshi Jan 23, 2024
78f2852
Add e2e test for activity states feature.
shefalijoshi Jan 23, 2024
5c6a733
Address review comments. Rename variables, documentation.
shefalijoshi Jan 23, 2024
42ed592
No shallow copy
shefalijoshi Jan 23, 2024
122c84b
Suppress lint warning for conditionals
shefalijoshi Jan 25, 2024
6ee3177
Remove check for abort controller
shefalijoshi Jan 25, 2024
8e53866
Move classes to components
shefalijoshi Jan 25, 2024
619e253
number primitive
shefalijoshi Jan 25, 2024
6a7ea35
Closes #7369
charlesh88 Jan 25, 2024
6abfac7
Ensure 'notStarted' is the default state for activities
shefalijoshi Jan 25, 2024
fc64682
Remove extra quotes
shefalijoshi Jan 25, 2024
6d3242b
Closes #7369
charlesh88 Jan 25, 2024
795b35f
Merge remote-tracking branch 'origin/activity-state-display' into act…
charlesh88 Jan 25, 2024
875edd9
Merge branch 'master' into activity-state-display
shefalijoshi Jan 25, 2024
a5abc32
Merge branch 'activity-state-display' of https://github.com/nasa/open…
shefalijoshi Jan 25, 2024
2839246
Use generated key for vue
shefalijoshi Jan 25, 2024
e79b99e
Fix e2e tests
shefalijoshi Jan 25, 2024
4f6a792
Fix timelist test
shefalijoshi Jan 26, 2024
a494a24
Merge branch 'master' into activity-state-display
shefalijoshi Jan 26, 2024
e8637b1
Merge branch 'master' into activity-state-display
unlikelyzero Jan 26, 2024
f404116
Merge branch 'master' of https://github.com/nasa/openmct into activit…
shefalijoshi Jan 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change activity states interceptor parameters to options
  • Loading branch information
shefalijoshi committed Jan 19, 2024
commit b413a9b55826e1110a648f785ac9f39419fa2b39
30 changes: 22 additions & 8 deletions src/plugins/activityStates/activityStatesInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,36 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/

import { ACTIVITYSTATES_KEY, ACTIVITYSTATES_TYPE } from './createActivityStatesIdentifier.js';
import { ACTIVITY_STATES_KEY, ACTIVITY_STATES_TYPE } from './createActivityStatesIdentifier.js';
/**
* @typedef {object} ActivityStatesInterceptorOptions
* @property {object} identifier the {namespace, key} to use for the activity states object.
* @property {string} name The name of the activity states model.
* @property {string} priority the priority of the interceptor. By default, it is low.
*/

function activityStatesInterceptor(openmct, identifierObject, name) {
/**
* 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 openmct
* @param {ActivityStatesInterceptorOptions} options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent

* @returns {{appliesTo: (function(*): boolean), invoke: ((function(*, *): ({identifier, activities: {}, name, location: null, type: string}))|*), priority: (*|number|string)}}
*/
function activityStatesInterceptor(openmct, options) {
const { identifier, name, priority = openmct.priority.LOW } = options;
const activityStatesModel = {
identifier: identifierObject,
identifier,
name,
type: ACTIVITYSTATES_TYPE,
type: ACTIVITY_STATES_TYPE,
activities: {},
location: null
};

return {
appliesTo: (identifier) => {
return identifier.key === ACTIVITYSTATES_KEY;
appliesTo: (identifierObject) => {
return identifierObject.key === ACTIVITY_STATES_KEY;
},
invoke: (identifier, object) => {
invoke: (identifierObject, object) => {
if (!object || openmct.objects.isMissing(object)) {
openmct.objects.save(activityStatesModel);

Expand All @@ -44,7 +58,7 @@ function activityStatesInterceptor(openmct, identifierObject, name) {

return object;
},
priority: openmct.priority.HIGH
priority
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/activityStates/createActivityStatesIdentifier.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const ACTIVITYSTATES_KEY = 'activity-states';
export const ACTIVITYSTATES_TYPE = 'activity-states';
export const ACTIVITY_STATES_KEY = 'activity-states';
export const ACTIVITY_STATES_TYPE = 'activity-states';

export function createActivityStatesIdentifier(namespace = '') {
return {
key: ACTIVITYSTATES_KEY,
key: ACTIVITY_STATES_KEY,
namespace
};
}