Namespace, my namespaces merge (#396) (#427)
* namespaceBreadcrumb: move the "Namespaces" vs "Partners" logic to a helper export
and switch from string computation to having strings for both terms
* Remove My Namespaces from menu, breadcrumb and tests
edit-namespace: use namespaceBreadcrumb
menu: remove My Namespaces
tests: don't expect My Namespaces in menu
* namespace-detail: use MyNamespaceAPI to determine showControls, not url
before:
ManageNamespace = NamespaceDetail with showControls=true
PartnerDetail = NamespaceDetail with showControls=false
after:
both removed, route changed to use NamespaceDetail directly
NamespaceDetail - move showControls from props to state, set from MyNamespaceAPI
* LinkTabs: move CollectionHeader tabs to separate component
that's the only tab component we have that supports links in tabs,
switching to that one, so moving into a LinkTabs component
* namespace-list: merge MyNamespaces & Partners list screens
before:
MyNamespaces = NamespaceList with filterOwner true, title, and namespacePath myCollectionsByRepo
Partners = NamespaceList with filterOwner false, title, and namespacePath namespaceByRepo
after:
the same, except title is always the same,
the Create button only depends on permissions, not filterOwner anymore
and added tabs to switch between
* NamespaceList - unify conditions for Create button ; LinkTabs - export props type
the original logic used filterOwner + rights for the toolbar Create button,
and filterOwner + a constant for the empty state Create button
now, we're using isStandalone + rights for both
* Toolbar (wrapper): call updateParams with page:1 in the new state
so that searching always goes to the first page
* NamespaceList - drop isStandalone, Create uses rights, adjust EmptyState messages
dropping the "No managed namespaces" title altogether, in favor of "No namespaces yet",
changing the logic for both Create buttons to just use the `add_namespace` user permission
and the "Namespaces will appear once created" vs "This accound is not set up to manage any namespaces" changes from standalone vs cloud to namespaces vs my namespaces tab.
(cherry picked from commit 25f72e2ce297aa782029e70c9139bf64c5a5f261)
Co-authored-by: Martin Hradil <[email protected]>