mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Namespace details tree view (#7080)
* Initial tests for <NamespaceTreeView /> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Introduce <NamespaceTreeView/> Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Render namespace children Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Render a child subnamespace Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Remove unused lodash import Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Render subnamespace badge after name Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Testing rendering 2 levels deep Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Add tree view to namespace details Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Expand all nodes by default Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Add links to the tree items Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Initial label styling Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Label and group styling Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Remove fontSize attr from SvgIcon Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Styling subnamespace badge Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Expand and collapse tree nodes Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Testing clicking plus icon Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Restyling subnamespace badge Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding tooltip for subnamespace badge Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Linter fixes Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Fix linter harder Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Replace CloseIcon with semi-transparent MinusIcon Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Styling TreeView inside scss module Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Move isSubnamespace method inside API Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Extract nodeId to avoid repeating Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Rename Icon components Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Clean up tests from boilderplate Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Subnamespace badge style fixes Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Linter fix Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Use font-size: x-small instead of rem units Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Move subnamespace badge show check to parent Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Use prevDefault util Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Refactor: move tree build logic to store Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Linter fixes Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Refactor hierarchicalNamespacesInjectable Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Add tests for getNamespaceTree() function Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Use Subnamespace badge in namespace list (#7132) Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> --------- Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
5d21db9fc2
commit
0719293b11
13 files changed
+1706
-1
No files matched your search
@@ -33,6 +33,20 @@ export class Namespace extends KubeObject<
|
||||
getStatus() {
|
||||
return this.status?.phase ?? "-";
|
||||
}
|
||||
|
||||
isSubnamespace() {
|
||||
return this.getAnnotations().find(annotation => annotation.includes("hnc.x-k8s.io/subnamespace-of"));
|
||||
}
|
||||
|
||||
isChildOf(parentName: string) {
|
||||
return this.getLabels().find(label => label === `${parentName}.tree.hnc.x-k8s.io/depth=1`);
|
||||
}
|
||||
|
||||
isControlledByHNC() {
|
||||
const hierarchicalNamesaceControllerLabel = "hnc.x-k8s.io/included-namespace=true";
|
||||
|
||||
return this.getLabels().find(label => label === hierarchicalNamesaceControllerLabel);
|
||||
}
|
||||
}
|
||||
|
||||
export class NamespaceApi extends KubeApi<Namespace> {
|
||||
|
||||
Reference in new issue
Block a user