weave-gitops icon indicating copy to clipboard operation
weave-gitops copied to clipboard

Add listObjects, make sources table use it

Open ozamosi opened this issue 1 year ago • 0 comments

This means that the list view and the detail view for sources is driven by the same code. To make it happen, I had to:

  • Add type directly as a property. My hacks to transform KindKustomization to Kustomization using a spread operator came back to haunt me when this made the object be not-the-right-object. But we can just add it on the object.
  • Make sourceRef actually return undefined when it's not set. We actually use ?. intentionally here and I was breaking it.
  • Add UIDs - they're needed by #2649.

listObjects is really just copied from one of the many existing list methods, and then changed to use the same type converter as getObject.

This means that to add new kinds - e.g. for notifications - the only backend change we should need is to put them in core/server/primarykinds.go and listing, getting, and getting events should all work.

ozamosi avatar Aug 25 '22 13:08 ozamosi