From 1031034bc4fc44c66ce4a4c87a87d29fb19bbf20 Mon Sep 17 00:00:00 2001 From: Joxit Date: Tue, 30 May 2023 07:49:18 +0200 Subject: [PATCH] feat(branching): add configuration for catalog arborescence --- bin/90-docker-registry-ui.sh | 2 ++ src/components/catalog/catalog-element.riot | 7 ++++ src/components/catalog/catalog.riot | 39 ++++++++++++--------- src/components/docker-registry-ui.riot | 32 +++++++++-------- src/components/error-page.riot | 4 +++ src/components/tag-history/tag-history.riot | 1 - src/index.html | 4 +++ src/scripts/error.js | 3 +- src/scripts/repositories.js | 17 +++++++-- src/style.scss | 13 +++---- test/repositories.test.js | 1 + 11 files changed, 80 insertions(+), 43 deletions(-) diff --git a/bin/90-docker-registry-ui.sh b/bin/90-docker-registry-ui.sh index c9c732f..94fd0ab 100755 --- a/bin/90-docker-registry-ui.sh +++ b/bin/90-docker-registry-ui.sh @@ -13,6 +13,8 @@ sed -i "s~\${HISTORY_CUSTOM_LABELS}~${HISTORY_CUSTOM_LABELS}~" index.html sed -i "s~\${USE_CONTROL_CACHE_HEADER}~${USE_CONTROL_CACHE_HEADER}~" index.html sed -i "s~\${TAGLIST_ORDER}~${TAGLIST_ORDER}~" index.html sed -i "s~\${CATALOG_DEFAULT_EXPANDED}~${CATALOG_DEFAULT_EXPANDED}~" index.html +sed -i "s~\${CATALOG_MIN_BRANCHES}~${CATALOG_MIN_BRANCHES}~" index.html +sed -i "s~\${CATALOG_MAX_BRANCHES}~${CATALOG_MAX_BRANCHES}~" index.html grep -o 'THEME[A-Z_]*' index.html | while read e; do sed -i "s~\${$e}~$(printenv $e)~" index.html diff --git a/src/components/catalog/catalog-element.riot b/src/components/catalog/catalog-element.riot index 788ae9b..b235056 100644 --- a/src/components/catalog/catalog-element.riot +++ b/src/components/catalog/catalog-element.riot @@ -52,6 +52,7 @@ along with this program. If not, see . show-catalog-nb-tags="{ props.showCatalogNbTags }" class="animated {!state.expanded && !props.filterResults ? 'hide' : ''} {state.expanding ? 'expanding' : ''}" each="{item in state.images}" + z-index="{ props.zIndex - 1 }" item="{ item }" > @@ -76,6 +77,12 @@ along with this program. If not, see . this.getNbTags(props, state); } }, + onMounted(props, state) { + const materialCard = this.$('material-card'); + if (materialCard) { + materialCard.style['z-index'] = props.zIndex; + } + }, onBeforeUpdate(props, state) { if (props.filterResults && state.images) { state.nImages = state.images.filter((image) => matchSearch(props.filterResults, image)).length; diff --git a/src/components/catalog/catalog.riot b/src/components/catalog/catalog.riot index 91aea31..3365a2f 100644 --- a/src/components/catalog/catalog.riot +++ b/src/components/catalog/catalog.riot @@ -35,10 +35,12 @@ along with this program. If not, see . on-authentication="{ props.onAuthentication }" show-catalog-nb-tags="{ props.showCatalogNbTags }" catalog-default-expanded="{ props.catalogDefaultExpanded || state.nRepositories === 1 }" + z-index="{ props.catalogMaxBranches - props.catalogMinBranches + 2 }" > + diff --git a/src/components/docker-registry-ui.riot b/src/components/docker-registry-ui.riot index 5f39d37..1ea7032 100644 --- a/src/components/docker-registry-ui.riot +++ b/src/components/docker-registry-ui.riot @@ -31,6 +31,21 @@ along with this program. If not, see .
+ + . on-authentication="{ onAuthentication }" show-catalog-nb-tags="{ truthy(props.showCatalogNbTags) }" catalog-default-expanded="{ truthy(props.catalogDefaultExpanded) }" + catalog-min-branches="{ props.catalogMinBranches }" + catalog-max-branches="{ props.catalogMaxBranches }" > @@ -82,21 +99,6 @@ along with this program. If not, see . on-authenticated="{ state.onAuthenticated }" opened="{ state.authenticationDialogOpened }" > - -