-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/docker/onecx/docker-spa-base-1.4.0
- Loading branch information
Showing
42 changed files
with
5,814 additions
and
3,126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
|
||
# relative paths to values.yaml and Chart.yaml | ||
values_file="helm/values.yaml" | ||
chart_file="helm/Chart.yaml" | ||
|
||
array=() | ||
|
||
if [ ! -f "$values_file" ]; then | ||
echo "\"$values_file\" cannot be found - execute this script from product root directory" | ||
exit 1 | ||
fi | ||
if [ ! -f "$chart_file" ]; then | ||
echo "\"$chart_file\" cannot be found - execute this script from product root directory" | ||
exit 1 | ||
fi | ||
|
||
extract_app_id_and_product_name() { | ||
app_id=$(sed -n '2 s/^name: \([^ ]*\).*/\1/p' "$chart_file") | ||
app_name=$(sed -n '4 s/description: //p' "$chart_file") | ||
product_name=$(echo "$app_id" | sed 's/-ui$//') | ||
echo "=> app id: $app_id" | ||
echo "=> app name: $app_name" | ||
echo "=> product name: $product_name" | ||
} | ||
|
||
find_permissions() { | ||
while IFS= read -r line; do | ||
if [[ "$line" == *"permissions:"* ]]; then | ||
permissions_spaces=$(echo "$line" | grep -oE '^[[:space:]]*' | wc -c) | ||
|
||
while IFS= read -r next_line; do | ||
next_spaces=$(echo "$next_line" | grep -oE '^[[:space:]]*' | wc -c) | ||
|
||
if (( next_spaces <= permissions_spaces )); then | ||
break | ||
fi | ||
if (( next_spaces == permissions_spaces + 2 )); then | ||
current_key=$(echo "$next_line" | tr -d ':' | tr -d ' ') | ||
elif (( next_spaces == permissions_spaces + 4 )); then | ||
value=$(echo "$next_line" | awk -F ':' '{print $1}' | tr -d ' ') | ||
description=$(echo "$next_line" | awk -F ':' '{$1=""; print $0}' | sed 's/^ *//') | ||
echo -e "Key: $current_key \t Value: $value \t Description: $description" | ||
array+=( "{\"resource\":\"$current_key\",\"action\":\"$value\",\"description\":\"$description\"}" ) | ||
fi | ||
done < <(sed -n "/permissions:/,/^$/p" "$values_file" | tail -n +2) | ||
break | ||
fi | ||
done < "$values_file" | ||
} | ||
|
||
create_json() { | ||
permissions_json="{" | ||
permissions_json+="\"name\": \"$app_name\"," | ||
permissions_json+="\"description\": \"local permission import\"," | ||
permissions_json+="\"permissions\":[" | ||
|
||
for ((i = 0; i < ${#array[@]}; i++)); do | ||
permissions_json+="${array[i]}" | ||
if ((i < ${#array[@]} - 1)); then | ||
permissions_json+="," | ||
fi | ||
done | ||
|
||
permissions_json+="]" | ||
permissions_json+="}" | ||
} | ||
|
||
send_permission_to_svc() { | ||
echo "=> send permissions to service" | ||
curl -v -X PUT -H "Content-Type: application/json" -d "$permissions_json" \ | ||
http://onecx-permission-svc/operator/v1/$product_name/$app_id | ||
} | ||
|
||
extract_app_id_and_product_name | ||
find_permissions | ||
create_json | ||
send_permission_to_svc | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
// disable preset of opacity in form: not readable | ||
@mixin make-disabled-form-readable-input { | ||
:host ::ng-deep { | ||
.p-inputtext.p-component:disabled { | ||
opacity: unset; | ||
} | ||
} | ||
} | ||
|
||
@mixin make-disabled-form-readable-dropdown { | ||
:host ::ng-deep { | ||
.p-dropdown.p-component.p-disabled { | ||
opacity: unset; | ||
} | ||
} | ||
} | ||
|
||
@mixin prepare-inputgroup { | ||
:host ::ng-deep { | ||
.inputgroup-dropdown-with-link { | ||
border-right: none; | ||
border-top-right-radius: 0; | ||
border-bottom-right-radius: 0; | ||
} | ||
.input-field-correction .p-inputtext { | ||
padding-top: 1rem !important; | ||
padding-bottom: 0.5rem !important; | ||
} | ||
.pseudo-button:hover { | ||
background: var(--button-hover-bg) !important; | ||
cursor: pointer; | ||
* { | ||
background: var(--button-hover-bg) !important; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@mixin card-badges { | ||
:host ::ng-deep { | ||
.card-badge-right { | ||
display: inline-block; | ||
position: absolute; | ||
right: 3px; | ||
&.badge-1 { | ||
top: 3px; | ||
} | ||
&.badge-2 { | ||
top: 35px; | ||
} | ||
} | ||
.card-badge-left { | ||
display: inline-block; | ||
position: absolute; | ||
left: 3px; | ||
&.badge-1 { | ||
top: 3px; | ||
} | ||
&.badge-2 { | ||
top: 35px; | ||
} | ||
} | ||
.pseudo-button-link { | ||
border-radius: var(--border-radius); | ||
&:hover { | ||
color: var(--primary-color-text); | ||
background: var(--button-hover-bg); | ||
cursor: pointer; | ||
padding: 5px !important; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@mixin correct-data-view-control { | ||
:host ::ng-deep { | ||
.data-view-control, | ||
.data-view-control * { | ||
color: var(--emphasis-medium); | ||
} | ||
// correction for data-view-control component | ||
.data-view-control-border { | ||
border: var(--toggle-button-border); | ||
&.p-dropdown { | ||
.p-inputtext { | ||
color: var(--emphasis-medium); | ||
opacity: 0.9; | ||
} | ||
&:last-of-type { | ||
border-top-left-radius: var(--border-radius); | ||
border-bottom-left-radius: var(--border-radius); | ||
} | ||
} | ||
&.p-inputtext:hover, | ||
&.p-dropdown:hover { | ||
border-color: rgb(0 0 0 / 30%) !important; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@mixin correct-search-criteria { | ||
:host ::ng-deep { | ||
.search-criteria-container > div { | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-content: center; | ||
row-gap: 0.5rem; | ||
column-gap: 3rem; | ||
.search-criteria-buttons { | ||
flex-wrap: wrap; | ||
align-content: center; | ||
margin-left: 0.5rem; | ||
margin-top: unset; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@mixin search-criteria-select-button-slim { | ||
:host ::ng-deep { | ||
.slim-selectbutton { | ||
display: flex; | ||
flex-wrap: wrap; | ||
flex-direction: column; | ||
row-gap: 0.1rem; | ||
align-items: center; | ||
|
||
.p-selectbutton .p-button { | ||
text-align: center; | ||
display: inline-block; | ||
color: var(--emphasis-medium); | ||
font-weight: var(--font-weight); | ||
padding: 0.3rem 0.8rem; | ||
border: var(--input-border); | ||
} | ||
.p-selectbutton-subtitle { | ||
color: var(--emphasis-medium); | ||
font-size: 0.8rem; | ||
} | ||
} | ||
} | ||
} | ||
@mixin search-criteria-select-button-filter { | ||
:host ::ng-deep { | ||
.filter-selectbutton { | ||
.p-selectbutton .p-button { | ||
opacity: 0.9 !important; | ||
border: var(--toggle-button-border); | ||
&.p-highlight { | ||
background: var(--toggle-button-active-bg); | ||
border-color: var(--toggle-button-active-border-color); | ||
} | ||
&:not(.p-disabled):not(.p-highlight):hover { | ||
color: var(--text-color); | ||
border-color: var(--toggle-button-hover-border-color); | ||
background-color: var(--toggle-button-hover-bg); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
@mixin search-criteria-select-button { | ||
:host ::ng-deep { | ||
.p-selectbutton-title { | ||
width: 2rem; | ||
text-align: right; | ||
} | ||
.search-criteria-selectbutton { | ||
.p-selectbutton .p-button { | ||
&.p-highlight { | ||
color: var(--primary-text-color); | ||
border-color: var(--toggle-button-hover-border-color); | ||
background-color: var(--primary-color); | ||
} | ||
&:not(.p-disabled):not(.p-highlight):hover { | ||
color: var(--primary-text-color); | ||
border-color: var(--toggle-button-hover-border-color); | ||
background-color: var(--button-hover-bg); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
@mixin table-inline-buttons { | ||
:host ::ng-deep { | ||
// reduce the size of buttons used inside a table row | ||
th button.p-button, | ||
td button.p-button { | ||
&.p-button-icon-only { | ||
width: unset !important; | ||
} | ||
&.p-button-rounded { | ||
height: unset !important; | ||
} | ||
&:disabled { | ||
opacity: 0.38 !important; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.