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

Refactor tables in the AppView #1063

Merged
merged 2 commits into from
Jun 25, 2019

Conversation

andresmgot
Copy link
Contributor

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.

case "Service":
return <ServiceItem resource={resource.item} />;
case "Secret":
// TODO: Set double type
Copy link
Contributor Author

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> {
Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

@prydonius prydonius left a comment

Choose a reason for hiding this comment

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

lgtm

@andresmgot andresmgot merged commit 562d88b into vmware-tanzu:master Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants