Skip to content

Commit 524d400

Browse files
authored
Merge pull request #36742 from appsmithorg/release
08/10 Daily Promotion
2 parents 462db00 + 22ccab0 commit 524d400

File tree

5 files changed

+59
-4
lines changed

5 files changed

+59
-4
lines changed

app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/spec_utility.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,22 @@ export class OneClickBinding {
1212
column: Record<string, string> = {},
1313
) {
1414
agHelper.GetNClick(oneClickBindingLocator.datasourceDropdownSelector);
15-
15+
agHelper.GetElement("[role='menu']").then(($menu) => {
16+
if (
17+
$menu.find(oneClickBindingLocator.datasourceQuerySelector()).length > 0
18+
) {
19+
cy.wrap($menu)
20+
.find(oneClickBindingLocator.datasourceQuerySelector())
21+
.should("have.length.greaterThan", 0)
22+
.each(($item) => {
23+
cy.wrap($item)
24+
.find("img")
25+
.should(($img) => {
26+
expect($img).to.have.attr("src").and.not.be.empty;
27+
});
28+
});
29+
}
30+
});
1631
expandLoadMoreOptions();
1732

1833
agHelper.AssertElementAbsence(oneClickBindingLocator.connectData);

app/client/src/components/editorComponents/WidgetQueryGeneratorForm/CommonControls/DatasourceDropdown/useSource/useConnectToOptions.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ function useConnectToOptions(props: ConnectToOptionsProps) {
227227
// This is the path we bind to the sourceData field Ex: `{{Table1.selectedRow}}`
228228
const { widgetBindPath } =
229229
getOneClickBindingConnectableWidgetConfig(currWidget);
230+
const iconSVG =
231+
WidgetFactory.getConfig(currWidget.type)?.iconSVG ||
232+
currWidget.iconSVG;
230233

231234
return {
232235
id: widgetId,
@@ -237,7 +240,7 @@ function useConnectToOptions(props: ConnectToOptionsProps) {
237240
<DatasourceImage
238241
alt="widget-icon"
239242
className="dataSourceImage"
240-
src={currWidget.iconSVG}
243+
src={iconSVG}
241244
/>
242245
</ImageWrapper>
243246
),

app/client/src/components/editorComponents/WidgetQueryGeneratorForm/WidgetSpecificControls/OtherFields/Field/Dropdown/useDropdown.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,15 @@ export function useDropdown(props: OneClickDropdownFieldProps) {
8181
if (getOneClickBindingConnectableWidgetConfig) {
8282
const { message, widgetBindPath } =
8383
getOneClickBindingConnectableWidgetConfig(currWidget);
84+
const iconSVG =
85+
WidgetFactory.getConfig(currWidget.type)?.iconSVG ||
86+
currWidget.iconSVG;
8487

8588
return {
8689
id: currWidgetId,
8790
value: widgetBindPath,
8891
label: currWidget.widgetName,
89-
icon: <StyledImage alt="widget-icon" src={currWidget.iconSVG} />,
92+
icon: <StyledImage alt="widget-icon" src={iconSVG} />,
9093
data: {
9194
widgetType: currWidget.type,
9295
widgetName: currWidget.widgetName,

deploy/docker/fs/opt/appsmith/entrypoint.sh

+29
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ tlog "Running as: $(id)"
66

77
stacks_path=/appsmith-stacks
88

9+
export APPSMITH_PG_DATABASE="appsmith"
910
export SUPERVISORD_CONF_TARGET="$TMP/supervisor-conf.d/" # export for use in supervisord.conf
1011
export MONGODB_TMP_KEY_PATH="$TMP/mongodb-key" # export for use in supervisor process mongodb.conf
1112

@@ -432,6 +433,7 @@ init_postgres() {
432433
tlog "Initializing local Postgres data folder"
433434
su postgres -c "env PATH='$PATH' initdb -D $POSTGRES_DB_PATH"
434435
fi
436+
create_appsmith_pg_db "$POSTGRES_DB_PATH"
435437
else
436438
runEmbeddedPostgres=0
437439
fi
@@ -453,6 +455,33 @@ safe_init_postgres() {
453455
fi
454456
}
455457

458+
# Method to create a appsmith database in the postgres
459+
# Args:
460+
# POSTGRES_DB_PATH (string): Path to the postgres data directory
461+
# Returns:
462+
# None
463+
# Example:
464+
# create_appsmith_pg_db "/appsmith-stacks/data/postgres/main"
465+
create_appsmith_pg_db() {
466+
POSTGRES_DB_PATH=$1
467+
# Start the postgres , wait for it to be ready and create a appsmith db
468+
su postgres -c "env PATH='$PATH' pg_ctl -D $POSTGRES_DB_PATH -l $POSTGRES_DB_PATH/logfile start"
469+
echo "Waiting for Postgres to start"
470+
until su postgres -c "env PATH='$PATH' pg_isready -d postgres"; do
471+
tlog "Waiting for Postgres to be ready..."
472+
sleep 1
473+
done
474+
# Check if the appsmith DB is present
475+
DB_EXISTS=$(su postgres -c "env PATH='$PATH' psql -tAc \"SELECT 1 FROM pg_database WHERE datname='${APPSMITH_PG_DATABASE}'\"")
476+
477+
if [[ "$DB_EXISTS" != "1" ]]; then
478+
su postgres -c "env PATH='$PATH' psql -c \"CREATE DATABASE ${APPSMITH_PG_DATABASE}\""
479+
else
480+
echo "Database ${APPSMITH_PG_DATABASE} already exists."
481+
fi
482+
su postgres -c "env PATH='$PATH' pg_ctl -D $POSTGRES_DB_PATH stop"
483+
}
484+
456485
setup_caddy() {
457486
if [[ "$APPSMITH_RATE_LIMIT" == "disabled" ]]; then
458487
export _APPSMITH_CADDY="/opt/caddy/caddy_vanilla"

deploy/docker/fs/opt/appsmith/pg-utils.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,16 @@ init_pg_db() {
127127
echo "Schema 'appsmith' does not exist. Creating schema..."
128128
psql -h "$PG_DB_HOST" -p "$PG_DB_PORT" -U postgres -d "$PG_DB_NAME" -c "CREATE SCHEMA appsmith;"
129129
fi
130-
131130
USER=$PG_DB_USER SCHEMA="appsmith" DB=$PG_DB_NAME HOST=$PG_DB_HOST PORT=$PG_DB_PORT grant_permissions_for_schema
131+
132+
echo "Creating pg_trgm extension..."
133+
psql -h "$PG_DB_HOST" -p "$PG_DB_PORT" -U postgres -d "$PG_DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
132134
else
133135
echo "Remote PostgreSQL detected, running as current user."
134136
PGPASSWORD=$PG_DB_PASSWORD psql -h "$PG_DB_HOST" -p "$PG_DB_PORT" -U "$PG_DB_USER" -d "$PG_DB_NAME" -c "CREATE SCHEMA IF NOT EXISTS appsmith;"
137+
138+
echo "Creating pg_trgm extension..."
139+
psql -h "$PG_DB_HOST" -p "$PG_DB_PORT" -U "$PG_DB_USER" -d "$PG_DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
135140
fi
136141
137142
# Check if the schema creation was successful

0 commit comments

Comments
 (0)