Skip to content

Commit

Permalink
Merge pull request #35106 from appsmithorg/release
Browse files Browse the repository at this point in the history
23rd July, 2024 - Daily Promotion
  • Loading branch information
yatinappsmith authored Jul 23, 2024
2 parents 6168e1f + 5127005 commit f4073fc
Show file tree
Hide file tree
Showing 241 changed files with 3,828 additions and 1,448 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/on-demand-build-docker-image-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_CLOUD_USERNAME }}
password: ${{ secrets.DOCKER_HUB_CLOUD_ACCESS_TOKEN }}
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set base image tag
id: set_base_tag
Expand All @@ -192,18 +192,10 @@ jobs:
fi
echo "base_tag=$base_tag" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: "lab:latest"
driver: cloud
endpoint: "appsmith/appsmith-builder"

- name: Push to Docker Hub
uses: docker/build-push-action@v6
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
pull: true
push: true
cache-from: ${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:release
Expand Down
29 changes: 19 additions & 10 deletions app/client/.husky/check-staged-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,33 @@ is_client_change=$(git diff --cached --name-only | grep -c "app/client")

is_merge_commit=$(git rev-parse -q --verify MERGE_HEAD)

# Function to apply Spotless and only commit staged files
apply_spotless_and_commit_staged_files() {
staged_server_files=$(git diff --cached --name-only | grep "app/server"| sed 's|app/server/||')
mvn spotless:apply
# Check if Spotless succeeded
if [ $? -ne 0 ]; then
echo "Spotless apply failed, Please run mvn spotless:apply"
exit 1
fi
echo "$staged_server_files" | xargs git add
echo "✔ Spotless applied successfully to server files"
}

if [ "$is_merge_commit" ]; then
echo "Skipping server and client checks for merge commit"
else
if [ "$is_server_change" -ge 1 ]; then
echo "Running Spotless check ..."
echo "Applying Spotless to server files..."
pushd app/server > /dev/null
if (mvn spotless:check 1> /dev/null && popd > /dev/null) then
popd
else
echo "Spotless check failed, please run mvn spotless:apply"
exit 1
fi
apply_spotless_and_commit_staged_files
popd > /dev/null
else
echo "Skipping server side check..."
echo "Skipping server side check..."
fi

if [ "$is_client_change" -ge 1 ]; then
echo "Running client check ..."
if [ "$is_client_change" -ge 1 ]; then
echo "Running client check..."
npx lint-staged --cwd app/client
else
echo "Skipping client side check..."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { ANVIL_EDITOR_TEST } from "../../../../../support/Constants";
import {
agHelper,
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
`${ANVIL_EDITOR_TEST}: Anvil tests for App Theming`,
{ tags: ["@tag.Anvil"] },
() => {
before(() => {
agHelper.AddDsl("anvilAppTheming");
});

it("1. Theme - Light and Dark Mode", () => {
anvilSnapshot.matchSnapshotForCanvasMode("AppTheming");
anvilSnapshot.matchSnapshotForPreviewMode("AppTheming");
anvilSnapshot.matchSnapshotForDeployMode("AppTheming");

anvilSnapshot.setTheme("dark");

anvilSnapshot.matchSnapshotForCanvasMode("AppTheming", "dark");
anvilSnapshot.matchSnapshotForPreviewMode("AppTheming", "dark");
anvilSnapshot.matchSnapshotForDeployMode("AppTheming", "dark");

anvilSnapshot.setTheme("light");
});

it("2. Theme - Accent Color", () => {
anvilSnapshot.setAccentColor("#d54137");

anvilSnapshot.matchSnapshotForCanvasMode("AppThemingCustomAccent");
anvilSnapshot.matchSnapshotForPreviewMode("AppThemingCustomAccent");
anvilSnapshot.matchSnapshotForDeployMode("AppThemingCustomAccent");

anvilSnapshot.setAccentColor("#0080ff");
});

it("3. Typography", () => {
anvilSnapshot.setTypography("Inter");

anvilSnapshot.matchSnapshotForCanvasMode("AppThemingTypography");
anvilSnapshot.matchSnapshotForPreviewMode("AppThemingTypography");
anvilSnapshot.matchSnapshotForDeployMode("AppThemingTypography");

anvilSnapshot.setTypography("System Default");
});

it("4. Density", () => {
["Tight", "Regular", "Loose"].forEach((density) => {
anvilSnapshot.setDensity(density);

anvilSnapshot.matchSnapshotForCanvasMode(`AppThemingDensity${density}`);
anvilSnapshot.matchSnapshotForPreviewMode(
`AppThemingDensity${density}`,
);
anvilSnapshot.matchSnapshotForDeployMode(`AppThemingDensity${density}`);
});
});

it("5. Sizing", () => {
["Small", "Regular", "Big"].forEach((size) => {
anvilSnapshot.setSizing(size);

anvilSnapshot.matchSnapshotForCanvasMode(`AppThemingSizing${size}`);
anvilSnapshot.matchSnapshotForPreviewMode(`AppThemingSizing${size}`);
anvilSnapshot.matchSnapshotForDeployMode(`AppThemingSizing${size}`);
});
});

it("6. Corners", () => {
["0px", "6px", "20px"].forEach((corner) => {
anvilSnapshot.setCorners(corner);

anvilSnapshot.matchSnapshotForCanvasMode(`AppThemingCorner${corner}`);
anvilSnapshot.matchSnapshotForPreviewMode(`AppThemingCorner${corner}`);
anvilSnapshot.matchSnapshotForDeployMode(`AppThemingCorner${corner}`);
});
});

it("7. Icon Style", () => {
["Filled", "Outlined"].forEach((iconStyle) => {
anvilSnapshot.setIconStyle(iconStyle);

anvilSnapshot.matchSnapshotForCanvasMode(`AppThemingIcon${iconStyle}`);
anvilSnapshot.matchSnapshotForPreviewMode(`AppThemingIcon${iconStyle}`);
anvilSnapshot.matchSnapshotForDeployMode(`AppThemingIcon${iconStyle}`);
});
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ describe(
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("ButtonWidget");
anvilSnapshot.matchSnapshotForCanvasMode("ButtonWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("ButtonWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("ButtonWidget");
anvilSnapshot.matchSnapshotForPreviewMode("ButtonWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("ButtonWidget");
anvilSnapshot.matchSnapshotForDeployMode("ButtonWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ describe(

it("1. Canvas Mode", () => {
anvilSnapshot.triggerCheckboxGroupInvalidState();
anvilSnapshot.verifyCanvasMode("CheckboxGroupWidget");
anvilSnapshot.matchSnapshotForCanvasMode("CheckboxGroupWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("CheckboxGroupWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("CheckboxGroupWidget");
anvilSnapshot.matchSnapshotForCanvasMode("CheckboxGroupWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("CheckboxGroupWidget");
anvilSnapshot.matchSnapshotForDeployMode("CheckboxGroupWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ describe(
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("CheckboxWidget");
anvilSnapshot.matchSnapshotForCanvasMode("CheckboxWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("CheckboxWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("CheckboxWidget");
anvilSnapshot.matchSnapshotForPreviewMode("CheckboxWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("CheckboxWidget");
anvilSnapshot.matchSnapshotForDeployMode("CheckboxWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ describe(

it("1. Canvas Mode", () => {
anvilSnapshot.triggerInputInvalidState();
anvilSnapshot.verifyCanvasMode("CurrencyInputWidget");
anvilSnapshot.matchSnapshotForCanvasMode("CurrencyInputWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("CurrencyInputWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("CurrencyInputWidget");
anvilSnapshot.matchSnapshotForPreviewMode("CurrencyInputWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("CurrencyInputWidget");
anvilSnapshot.matchSnapshotForDeployMode("CurrencyInputWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ describe(
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("HeadingWidget");
anvilSnapshot.matchSnapshotForCanvasMode("HeadingWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("HeadingWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("HeadingWidget");
anvilSnapshot.matchSnapshotForPreviewMode("HeadingWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("HeadingWidget");
anvilSnapshot.matchSnapshotForDeployMode("HeadingWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ describe(
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("IconButtonWidget");
anvilSnapshot.matchSnapshotForCanvasMode("IconButtonWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("IconButtonWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("IconButtonWidget");
anvilSnapshot.matchSnapshotForPreviewMode("IconButtonWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("IconButtonWidget");
anvilSnapshot.matchSnapshotForDeployMode("IconButtonWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ describe(
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("InlineButtonWidget");
anvilSnapshot.matchSnapshotForCanvasMode("InlineButtonWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("InlineButtonWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("InlineButtonWidget");
anvilSnapshot.matchSnapshotForPreviewMode("InlineButtonWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("InlineButtonWidget");
anvilSnapshot.matchSnapshotForDeployMode("InlineButtonWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ describe(

it("1. Canvas Mode", () => {
anvilSnapshot.triggerInputInvalidState();
anvilSnapshot.verifyCanvasMode("InputWidget");
anvilSnapshot.matchSnapshotForCanvasMode("InputWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("InputWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("InputWidget");
anvilSnapshot.matchSnapshotForPreviewMode("InputWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("InputWidget");
anvilSnapshot.matchSnapshotForDeployMode("InputWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ describe(
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("ParagraphWidget");
anvilSnapshot.matchSnapshotForCanvasMode("ParagraphWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("ParagraphWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("ParagraphWidget");
anvilSnapshot.matchSnapshotForPreviewMode("ParagraphWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("ParagraphWidget");
anvilSnapshot.matchSnapshotForDeployMode("ParagraphWidget");
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ describe(

it("1. Canvas Mode", () => {
anvilSnapshot.triggerInputInvalidState();
anvilSnapshot.verifyCanvasMode("PhoneInputWidget");
anvilSnapshot.matchSnapshotForCanvasMode("PhoneInputWidget");
anvilSnapshot.setTheme("dark");
anvilSnapshot.matchSnapshotForCanvasMode("PhoneInputWidget", "dark");
anvilSnapshot.setTheme("light");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("PhoneInputWidget");
anvilSnapshot.matchSnapshotForPreviewMode("PhoneInputWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("PhoneInputWidget");
anvilSnapshot.matchSnapshotForDeployMode("PhoneInputWidget");
});
},
);
Loading

0 comments on commit f4073fc

Please sign in to comment.