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

Add Expanded view for Time List #7378

Merged
merged 79 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
79 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
2e41753
Add compact view for timelist
shefalijoshi Jan 17, 2024
c6a6a18
Add inspector configuration for compact view
shefalijoshi Jan 18, 2024
a0ccc4e
Set colors based on time relation of activity
shefalijoshi Jan 18, 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
9ff31d5
Closes #7377
charlesh88 Jan 19, 2024
ad07174
Closes #7377
charlesh88 Jan 19, 2024
02c796a
Add status label
shefalijoshi Jan 19, 2024
44f4ac2
Rename to Expanded view and isExpanded as properties. Add display sty…
shefalijoshi Jan 19, 2024
b0a21d4
Refactor activity selection. Display activity properties
shefalijoshi Jan 19, 2024
3655ba9
Closes #7377
charlesh88 Jan 19, 2024
3365039
Merge remote-tracking branch 'origin/timelist-compact-view' into time…
charlesh88 Jan 19, 2024
5cbd0fd
Closes #7377
charlesh88 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
51e20ea
Addresses review comments making code more readable.
shefalijoshi Jan 19, 2024
95d7488
Closes #7377
charlesh88 Jan 22, 2024
585b60d
Closes #7377
charlesh88 Jan 22, 2024
15acbc9
Remove ExpandedView component and pull the ExpandedViewItem up to the…
shefalijoshi Jan 23, 2024
dcad88c
Merge branch 'master' into timelist-compact-view
shefalijoshi Jan 23, 2024
e209b00
Fix sorting for compact view.
shefalijoshi Jan 23, 2024
3bd09fc
Merge branch 'timelist-compact-view' of https://github.com/nasa/openm…
shefalijoshi Jan 23, 2024
5908f96
Merge branch 'master' into activity-state-display
shefalijoshi Jan 23, 2024
34c1f20
Closes #7377
charlesh88 Jan 23, 2024
e6fb968
Merge remote-tracking branch 'origin/timelist-compact-view' into time…
charlesh88 Jan 23, 2024
6682d00
Closes #7377
charlesh88 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
7931d4b
Merge branch 'master' of https://github.com/nasa/openmct into timelis…
shefalijoshi Jan 24, 2024
b5a73d3
Merge branch 'activity-state-display' of https://github.com/nasa/open…
shefalijoshi Jan 24, 2024
6ac08b0
Merge updates to activity-state
shefalijoshi Jan 25, 2024
8798aa1
Merge branch 'master' of https://github.com/nasa/openmct into timelis…
shefalijoshi Jan 25, 2024
6ae216d
Sync with activity states PR
shefalijoshi Jan 25, 2024
c51f828
Draft of progress-pie
shefalijoshi Jan 25, 2024
3e0342a
- Add `s-selected` styling for Expanded Time List elements.
charlesh88 Jan 25, 2024
21f6279
Add 2 new date formats
shefalijoshi Jan 26, 2024
6116662
Look and feel enhancements for pie, zero duration events and start an…
shefalijoshi Jan 26, 2024
e74be9b
Fix pie show/hide condition
shefalijoshi Jan 26, 2024
9ceb8a6
Merge branch 'timelist-compact-view' of github.com:nasa/openmct into …
charlesh88 Jan 26, 2024
9f7d931
Final touches to the pie and labels
shefalijoshi Jan 26, 2024
eb80bcb
Merge branch 'timelist-compact-view' of github.com:nasa/openmct into …
charlesh88 Jan 26, 2024
a0aa1c9
Refactor label logic
shefalijoshi Jan 26, 2024
d9a50b4
Merge branch 'timelist-compact-view' of github.com:nasa/openmct into …
charlesh88 Jan 26, 2024
884373e
Closes #7377
charlesh88 Jan 26, 2024
9e00836
Merge branch 'master' of https://github.com/nasa/openmct into timelis…
shefalijoshi Jan 29, 2024
a56931e
Remove use of ListView - no point passing arrays around since we are …
shefalijoshi Jan 29, 2024
bb74f21
We addded a new column for duration and changed the previous duration…
shefalijoshi Jan 29, 2024
905801c
Fix expanded view for timelist tests
shefalijoshi Jan 29, 2024
088b4b0
Closes #7377
charlesh88 Jan 29, 2024
91a2c62
Merge remote-tracking branch 'origin/timelist-compact-view' into time…
charlesh88 Jan 29, 2024
3ad4acf
Merge branch 'master' into timelist-compact-view
charlesh88 Jan 29, 2024
af161f9
Closes #7377
charlesh88 Jan 29, 2024
a9feb37
Optimize rendering of timelist activities
shefalijoshi Jan 30, 2024
32781e2
Remove focused test
shefalijoshi Jan 30, 2024
e248c78
Merge branch 'timelist-compact-view' of https://github.com/nasa/openm…
shefalijoshi Jan 30, 2024
a09522d
Merge branch 'master' of https://github.com/nasa/openmct into timelis…
shefalijoshi Jan 30, 2024
333b683
Address review comments
shefalijoshi Jan 30, 2024
1bf5a15
Remove reactive selection for plan activities
shefalijoshi Jan 30, 2024
004957d
destructure props into individual item properties for render performa…
shefalijoshi Jan 30, 2024
ac80da4
Merge remote-tracking branch 'origin' into timelist-compact-view
charlesh88 Jan 30, 2024
6026876
Merge branch 'timelist-compact-view' of https://github.com/nasa/openm…
shefalijoshi Jan 30, 2024
73c2e7e
Use local variables and remove JSON utility methods
shefalijoshi Jan 30, 2024
c03d7bb
Change cancelled to skipped
shefalijoshi Jan 30, 2024
c45c6a2
Focus the activity tab when shown
shefalijoshi Jan 30, 2024
f068090
Fix label updates
shefalijoshi Jan 30, 2024
14ede06
Merge branch 'master' into timelist-compact-view
shefalijoshi Jan 30, 2024
fbd271a
Add countup to cspell
shefalijoshi Jan 30, 2024
fb38cdb
Remove progress pie due to licensing unknowns
shefalijoshi Jan 31, 2024
5cfa222
Merge branch 'timelist-compact-view' of https://github.com/nasa/openm…
shefalijoshi Jan 31, 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
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default {
this.selectedActivities = [];
selection.forEach((selectionItem) => {
if (selectionItem[0].context.type === 'activity') {
const activity = selectionItem[0].context.activity;
const activity = { ...selectionItem[0].context.activity };
if (activity) {
activity.key = activity.id ?? activity.name;
this.selectedActivities.push(activity);
Expand Down
65 changes: 39 additions & 26 deletions src/plugins/timelist/ExpandedViewItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,47 +122,60 @@ const INFERRED_EXECUTION_STATES = {
export default {
inject: ['openmct', 'domainObject', 'path'],
props: {
item: {
type: Object,
required: true
name: {
type: String,
default: ''
},
start: {
type: Number,
default: 0
},
end: {
type: Number,
default: 0
},
duration: {
type: Number,
default: 0
},
countdown: {
type: Number,
default: 0
},
cssClass: {
type: String,
default: ''
Comment on lines +112 to +134
Copy link
Contributor

Choose a reason for hiding this comment

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

This is great! Do you think name, start, end, duration, and countdown, should be required props?

},
itemProperties: {
type: Array,
required: true
},
executionState: {
type: String,
default() {
return 'notStarted';
}
default: 'notStarted'
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

}
},
data() {
return {
timestamp: this.openmct.time.now()
};
},
computed: {
countdownClass() {
let cssClass = '';
if (this.item.countdown < 0) {
if (this.countdown < 0) {
cssClass = '--is-countup';
} else if (this.item.countdown > 0) {
} else if (this.countdown > 0) {
cssClass = '--is-countdown';
}
return `c-tli__time-hero-time ${cssClass}`;
},
styleClass() {
return { backgroundColor: ITEM_COLORS[this.item.cssClass] };
return { backgroundColor: ITEM_COLORS[this.cssClass] };
},
isInProgress() {
return this.executionState === 'in-progress';
},
eventHasDuration() {
return this.item.start !== this.item.end;
return this.start !== this.end;
},
listItemClass() {
const timeRelationClass = this.item.cssClass;
const timeRelationClass = this.cssClass;
const executionStateClass = `--is-${this.executionState}`;
return `c-tli ${timeRelationClass} ${executionStateClass}`;
},
Expand All @@ -177,14 +190,14 @@ export default {
}

let label;
if (this.item.start < this.timestamp) {
if (this.start < this.timestamp) {
// Start time is in the past
if (this.item.start === this.item.end) {
if (this.start === this.end) {
// - 'Occurred' : for Events with start < now datetime and 0 duration
label = INFERRED_EXECUTION_STATES.occurred;
}
// end time has not yet passed
else if (this.item.cssClass === CURRENT_CSS_SUFFIX) {
else if (this.cssClass === CURRENT_CSS_SUFFIX) {
if (executionStateIndex === 0) {
// - 'Overdue' : executionState.notStarted && start < now datetime
label = INFERRED_EXECUTION_STATES.overdue;
Expand All @@ -194,7 +207,7 @@ export default {
}
}
// end time is also in the past
else if (this.item.cssClass === PAST_CSS_SUFFIX) {
else if (this.cssClass === PAST_CSS_SUFFIX) {
if (executionStateIndex === 0) {
// - 'Incomplete' : executionState.notStarted && now > end datetime
label = INFERRED_EXECUTION_STATES.incomplete;
Expand All @@ -209,7 +222,7 @@ export default {
}
// Start time is in the future
else {
if (this.item.start === this.item.end) {
if (this.start === this.end) {
// - 'Occurs' : for Events with start > now datetime and 0 duration
label = INFERRED_EXECUTION_STATES.occurs;
} else {
Expand All @@ -222,15 +235,15 @@ export default {
},
formattedItem() {
let itemValue = {
title: this.item.name
title: this.name
};
this.itemProperties.forEach((itemProperty) => {
let value = this.item[itemProperty.key];
let value = this[itemProperty.key];
let formattedValue;
if (itemProperty.format) {
const itemStartDate = new Date(value).toDateString();
const timestampDate = new Date(this.timestamp).toDateString();
formattedValue = itemProperty.format(value, this.item, itemProperty.key, this.openmct, {
formattedValue = itemProperty.format(value, undefined, itemProperty.key, this.openmct, {
Copy link
Contributor

Choose a reason for hiding this comment

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

oh weird. where's this defined?

skipPrefix: true,
skipDateForToday: itemStartDate === timestampDate
});
Expand All @@ -248,7 +261,7 @@ export default {
);
}
},
mounted() {
created() {
this.updateTimestamp = _.throttle(this.updateTimestamp, 1000);
this.setTimeContext();
this.timestamp = this.timeContext.now();
Expand All @@ -271,7 +284,7 @@ export default {
this.timestamp = time;
const progressElement = this.$refs.progressElement;
if (this.isInProgress && progressElement) {
updateProgress(this.item.start, this.item.end, this.timestamp, progressElement);
updateProgress(this.start, this.end, this.timestamp, progressElement);
}
}
}
Expand Down
25 changes: 15 additions & 10 deletions src/plugins/timelist/TimelistComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
<expanded-view-item
v-for="item in sortedItems"
:key="item.key"
:item="item"
:name="item.name"
:start="item.start"
:end="item.end"
:duration="item.duration"
:countdown="item.countdown"
:css-class="item.cssClass"
:item-properties="itemProperties"
:execution-state="persistedActivityStates[item.id]"
@click.stop="setSelectionForActivity(item, $event.currentTarget)"
Expand Down Expand Up @@ -202,12 +207,15 @@ export default {
});
}
},
mounted() {
this.isEditing = this.openmct.editor.isEditing();
created() {
this.updateTimestamp = _.throttle(this.updateTimestamp, 1000);
this.deferAutoScroll = _.debounce(this.deferAutoScroll, 500);

this.setTimeContext();
this.timestamp = this.timeContext.now();
},
mounted() {
this.isEditing = this.openmct.editor.isEditing();

this.getPlanDataAndSetConfig(this.domainObject);
this.getActivityStates();
Expand All @@ -230,7 +238,6 @@ export default {

this.openmct.editor.on('isEditing', this.setEditState);

this.deferAutoScroll = _.debounce(this.deferAutoScroll, 500);
this.$el.parentElement.addEventListener('scroll', this.deferAutoScroll, true);

if (this.composition) {
Expand Down Expand Up @@ -298,10 +305,10 @@ export default {
});
},
async getActivityStates() {
this.activityStatesObject = await this.openmct.objects.get('activity-states');
this.setActivityStates(this.activityStatesObject);
const activityStatesObject = await this.openmct.objects.get('activity-states');
this.setActivityStates(activityStatesObject);
this.stopObservingActivityStatesObject = this.openmct.objects.observe(
this.activityStatesObject,
activityStatesObject,
'*',
this.setActivityStates
);
Expand Down Expand Up @@ -413,9 +420,7 @@ export default {
return;
}
// Create new objects so Vue 3 can detect any changes
this.planActivities = this.planActivities.concat(
JSON.parse(JSON.stringify(this.planData[key]))
);
this.planActivities.push(...this.planData[key]);
});
},

Expand Down
3 changes: 1 addition & 2 deletions src/styles/_constants-snow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ $colorTimeFixedBtnBg: pullForward($colorTimeFixed, 5%);
$colorTimeFixedBtnFg: $colorTimeFixedFgSubtle;
$colorTimeFixedBtnBgMajor: #a09375;
$colorTimeFixedBtnFgMajor: #fff;

$colorTimeRealtime: #6179d7;
$colorTimeRealtime: #445890;
$colorTimeRealtimeBg: $colorTimeRealtime;
$colorTimeRealtimeFg: #fff;
$colorTimeRealtimeFgSubtle: #eee;
Expand Down
Loading