Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-preview-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: public-dir
path: ./public-dir.zip
path: public-dir.zip
retention-days: 1
- name: Trigger Inner workflow
run: echo "triggering inner workflow"
9 changes: 6 additions & 3 deletions .github/workflows/preview-site.yml
Comment thread
SplinterSword marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:

jobs:
deploy-preview:
if: github.repository == 'meshery-extensions/shape-builder'
if: >
github.repository == 'meshery-extensions/shape-builder' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-24.04
steps:
- name: Checkout code
Expand All @@ -24,8 +26,9 @@ jobs:

- name: Unzip Site
run: |
rm -rf ./docs/_site
unzip public-dir.zip
rm -rf docs/_site
mkdir -p docs/_site
unzip public-dir.zip -d docs/_site
rm -f public-dir.zip

- name: Deploy to Netlify
Expand Down
24 changes: 19 additions & 5 deletions script.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#! /usr/bin/env bash
#!/usr/bin/env bash
set -e

if [ -f public-dir.zip ]; then
rm -rf public-dir.zip
ZIP_NAME="public-dir.zip"
BUILD_DIR="site/public"

# Ensure build output exists and is not empty
if [ ! -d "$BUILD_DIR" ] || [ -z "$(ls -A "$BUILD_DIR")" ]; then
echo "Build output missing or empty at $BUILD_DIR"
exit 1
fi
mkdir -p public
zip -r public-dir.zip . -i ./public

rm -f "$ZIP_NAME"

# Zip ONLY the contents of the built site
(
cd "$BUILD_DIR"
zip -r "../../$ZIP_NAME" .
)

echo "Zipped site contents into $ZIP_NAME"
14 changes: 7 additions & 7 deletions site/src/components/ShapeBuilder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const ShapeBuilder = () => {

const points = getPlottedPoints(poly);
if (!points || points.length === 0) return;

if (!basePointsRef.current) {
basePointsRef.current = points;
}
Expand All @@ -92,10 +92,10 @@ const ShapeBuilder = () => {
const handleScaleChange = (newScale) => {
const clampedScale = Math.max(MIN_SCALE, Math.min(MAX_SCALE, newScale));
setScale(clampedScale);

const matchingPreset = SCALE_PRESETS.find(p => Math.abs(p - clampedScale) < 0.01);
setCurrentPreset(matchingPreset || clampedScale);

applyScale(clampedScale);
};

Expand Down Expand Up @@ -250,7 +250,7 @@ const ShapeBuilder = () => {
<Box sx={{ display: "flex", justifyContent: "center", alignItems: "center", gap: 2, mt: 3, mb: 3, flexWrap: "wrap" }}>
<Button variant="contained" onClick={clearShape}>Clear</Button>
<Button variant="contained" onClick={closeShape}>Close Shape</Button>

<Box sx={{ display: "flex", alignItems: "center", gap: 1.5, ml: 2 }}>
<FormControl size="small" sx={{ minWidth: 80 }}>
<Select
Expand All @@ -260,9 +260,9 @@ const ShapeBuilder = () => {
displayEmpty
aria-label="Scale preset"
sx={{
color: '#fff',
'& .MuiSelect-icon': {
color: '#fff'
color: "#fff",
"& .MuiSelect-icon": {
color: "#fff"
}
}}
>
Expand Down