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
Added expand and upgrade activities in persistent storage dashboard #4021
Conversation
import ActivityItem from '@console/shared/src/components/dashboard/activity-card/ActivityItem'; | ||
import { K8sResourceKind } from '@console/internal/module/k8s'; | ||
|
||
export const ClusterExpandActivity: React.FC = () => ( |
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.
We can reuse this too, but may be in future we want to modify the look and feel, hence keeping separate
...in/src/components/dashboard-page/storage-dashboard/activity-card/cluster-expand-activity.tsx
Show resolved
Hide resolved
import { SubscriptionState } from '@console/operator-lifecycle-manager'; | ||
import { K8sResourceKind } from '@console/internal/module/k8s'; | ||
|
||
export const isOCSUpgradeActivity = (subscription: K8sResourceKind): boolean => { |
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.
@andybraren overview dashboard detects upgrade activity for every operator in status card. Do we want to have this as activity in storage dashboard ? Should we, for the future, consider including this to storage cluster status instead of activity ?
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.
I agree, to align with the recent change in Cluster Overview the Storage
status in the storage dashboard's status card should probably become "Upgrading" in the future (FYI @yuvalgalanti). For now though (if this is merging before Friday) including it as an activity seems okay.
}; | ||
|
||
export const getOCSSubscription = (subscriptions: FirehoseResult): K8sResourceKind => { | ||
const itemsData: K8sResourceKind[] = _.get(subscriptions, 'data'); |
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.
you can use TS 3.7 optional chaining - applies for all usages of _.get
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.
I am looking for all instances now, to nail down with the hammer :D
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.
bdb9c44
to
ba01bb5
Compare
e6763bb
to
25cf286
Compare
if (isClusterExpandActivity(ocsCluster)) { | ||
resourceActivities.push({ | ||
resource: ocsCluster, | ||
timestamp: null, |
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.
you dont have to specify timestamp: null
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.
cant you use status.lastUpdated
as timestamp ?
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.
There is not any lastUpdated field in this type of CRD. Only creationtimestamp is present.
...orage-plugin/src/components/dashboard-page/storage-dashboard/activity-card/activity-card.tsx
Outdated
Show resolved
Hide resolved
...orage-plugin/src/components/dashboard-page/storage-dashboard/activity-card/activity-card.tsx
Outdated
Show resolved
Hide resolved
...orage-plugin/src/components/dashboard-page/storage-dashboard/activity-card/activity-card.tsx
Outdated
Show resolved
Hide resolved
...orage-plugin/src/components/dashboard-page/storage-dashboard/activity-card/activity-card.tsx
Outdated
Show resolved
Hide resolved
...orage-plugin/src/components/dashboard-page/storage-dashboard/activity-card/activity-card.tsx
Outdated
Show resolved
Hide resolved
...orage-plugin/src/components/dashboard-page/storage-dashboard/activity-card/activity-card.tsx
Outdated
Show resolved
Hide resolved
...lugin/src/components/dashboard-page/storage-dashboard/activity-card/ocs-upgrade-activity.tsx
Outdated
Show resolved
Hide resolved
...in/src/components/dashboard-page/storage-dashboard/activity-card/cluster-expand-activity.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Afreen Rahman <afrahman@redhat.com>
25cf286
to
97444db
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afreen23, rawagner The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Upgrade Activity
Expand Activity