-
Notifications
You must be signed in to change notification settings - Fork 705
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
Refactor tables in the AppView #1063
Conversation
case "Service": | ||
return <ServiceItem resource={resource.item} />; | ||
case "Secret": | ||
// TODO: Set double type |
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 need to change the type here
resourceRefs: ResourceRef[]; | ||
} | ||
|
||
class WorkloadTable extends React.Component<IWorkloadItemTableProps> { |
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.
ResourceTable
return <ServiceItem resource={resource.item} />; | ||
case "Secret": | ||
// TODO: Set double type | ||
const i = (resource.item as any) as ISecret; |
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.
hmm maybe SecretItem should just accept IResource and internally change it to ISecret?
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 would see it weird for the SecretItem
to accept a IResource
when it only works for an ISecret
. It's better to do the conversion before. It's actually the generic "TableItem" the one that can receive different types of resources.
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're right, I was just thinking this given that ServiceItem and other resources look like they accept IResources
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.
lgtm
Ref: #848
Refactor common code used by the different tables in the AppView: WorkloadTable, ServiceTable, SecretsTable and OtherResourcesTable.
Now everything is a
ResourceTable
and depending on the type of the resource (kind
) it renders a different type of row.