Skip to content

Commit a5e6fc9

Browse files
authored
Merge pull request #2697 from bluewave-labs/develop-saas
Merge develop-saas into master-saas (15 Nov)
2 parents 82be571 + 6e97ac2 commit a5e6fc9

File tree

18 files changed

+713
-393
lines changed

18 files changed

+713
-393
lines changed

Clients/.dockerignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
node_modules
2+
dist
3+
.git
4+
.gitignore
5+
.env
6+
.env.local
7+
.env.*.local
8+
*.log
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
coverage
13+
.DS_Store
14+
.vscode
15+
.idea
16+
*.md
17+
!README.md
18+
.dockerignore
19+
Dockerfile*
20+
docker-compose*.yml

Clients/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# Step 1: Use a Node.js base image
22
FROM node:20-alpine AS build
33

4+
# Increase Node.js memory limit for the build
5+
ENV NODE_OPTIONS="--max_old_space_size=4096"
6+
47
# Step 2: Set the working directory
58
WORKDIR /app
69

710
# Step 3: Copy package.json and package-lock.json
811
COPY package.json package-lock.json ./
912

10-
# Step 4: Install dependencies
11-
RUN npm install
13+
# Step 4: Install dependencies with optimizations for cross-platform builds
14+
RUN npm config set fetch-timeout 600000 && \
15+
npm config set fetch-retries 5 && \
16+
npm ci --prefer-offline --no-audit --legacy-peer-deps || npm install --legacy-peer-deps
1217

1318
# Step 5: Copy the rest of the application files
1419
COPY . .

Clients/Dockerfile.optimized

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Step 1: Use a Node.js base image with more memory
2+
FROM node:20-alpine AS build
3+
4+
# Increase Node.js memory limit for the build
5+
ENV NODE_OPTIONS="--max_old_space_size=4096"
6+
7+
# Step 2: Set the working directory
8+
WORKDIR /app
9+
10+
# Step 3: Copy package files
11+
COPY package.json package-lock.json ./
12+
13+
# Step 4: Install dependencies with optimizations
14+
RUN npm config set fetch-timeout 600000 && \
15+
npm config set fetch-retries 5 && \
16+
npm ci --prefer-offline --no-audit --legacy-peer-deps || npm install --legacy-peer-deps
17+
18+
# Step 5: Copy the rest of the application files
19+
COPY . .
20+
21+
# Step 6: Accept env variables for Vite
22+
ARG VITE_GOOGLE_CLIENT_ID
23+
ENV VITE_GOOGLE_CLIENT_ID=$VITE_GOOGLE_CLIENT_ID
24+
25+
ARG VITE_SLACK_CLIENT_ID
26+
ENV VITE_SLACK_CLIENT_ID=$VITE_SLACK_CLIENT_ID
27+
28+
ARG VITE_APP_VERSION
29+
ENV VITE_APP_VERSION=$VITE_APP_VERSION
30+
31+
# Step 7: Build the application
32+
RUN npm run build
33+
34+
# Step 8: Use a lightweight web server for production
35+
FROM nginx:1.25-alpine
36+
37+
# Step 9: Copy the build output to NGINX's default public directory
38+
COPY --from=build /app/dist /usr/share/nginx/html
39+
40+
# Step 10: Copy the custom NGINX configuration
41+
COPY nginx.conf /etc/nginx/conf.d/default.conf
42+
43+
# Step 11: Expose port 80
44+
EXPOSE 80
45+
46+
# Step 12: Start NGINX server
47+
CMD ["nginx", "-g", "daemon off;"]

Clients/src/presentation/components/EmptyState/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const EmptyState: React.FC<EmptyStateProps> = ({
3434
showHalo = false,
3535
showBorder = false,
3636
}) => {
37-
3837
return (
3938
<Stack
4039
alignItems="center"
@@ -44,20 +43,22 @@ const EmptyState: React.FC<EmptyStateProps> = ({
4443
borderRadius: "4px",
4544
backgroundColor: "#FFFFFF",
4645
}),
47-
pt: '75px',
46+
pt: "75px",
4847
pb: 16,
4948
}}
5049
role="img"
5150
aria-label={imageAlt}
5251
>
53-
<Box sx={{ mb: '20px' }}>
52+
<Box sx={{ mb: "20px" }}>
5453
<SkeletonCard showHalo={showHalo} />
5554
</Box>
56-
<Typography sx={{ fontSize: 13, color: "#9CA3AF", fontWeight: 400 }}>
55+
<Typography
56+
sx={{ fontSize: 13, color: "#9CA3AF", fontWeight: 400, paddingX: 10 }}
57+
>
5758
{message}
5859
</Typography>
5960
</Stack>
6061
);
6162
};
6263

63-
export default EmptyState;
64+
export default EmptyState;

Clients/src/presentation/components/Inputs/Datepicker/index.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,25 @@ const DatePicker = ({
2121
}: DatePickerProps) => {
2222
const theme = useTheme();
2323

24+
// Extract width, flexGrow, minWidth, maxWidth from sx prop to apply to wrapper Stack
25+
const extractedLayoutProps = sx && typeof sx === 'object' && !Array.isArray(sx)
26+
? {
27+
width: (sx as any).width,
28+
flexGrow: (sx as any).flexGrow,
29+
minWidth: (sx as any).minWidth,
30+
maxWidth: (sx as any).maxWidth,
31+
}
32+
: {};
33+
34+
// Create a copy of sx without layout props to pass to MuiDatePicker
35+
const sxWithoutLayoutProps = sx && typeof sx === 'object' && !Array.isArray(sx)
36+
? Object.fromEntries(Object.entries(sx).filter(([key]) => !['width', 'flexGrow', 'minWidth', 'maxWidth'].includes(key)))
37+
: sx;
38+
2439
return (
2540
<Stack
2641
gap={theme.spacing(2)}
42+
sx={extractedLayoutProps}
2743
>
2844
{label && (
2945
<Typography
@@ -70,7 +86,7 @@ const DatePicker = ({
7086
'& .MuiInputBase-root': {
7187
cursor: 'pointer',
7288
},
73-
...sx,
89+
...sxWithoutLayoutProps,
7490
}}
7591
value={date ? dayjs(date) : null}
7692
onChange={(value) => handleDateChange(value)}

Clients/src/presentation/components/Inputs/Dropdowns/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ const DropDowns: React.FC<DropDownsProps> = ({
122122
<Stack
123123
id={elementId}
124124
style={{
125-
gap: theme.spacing(8),
125+
gap: theme.spacing(6),
126126
}}
127127
>
128128
<Stack
129129
display="flex"
130130
flexDirection="row"
131131
justifyContent="space-between"
132-
alignItems="center"
133-
gap={theme.spacing(15)}
132+
alignItems="flex-end"
133+
gap={theme.spacing(4)}
134134
>
135135
<Select
136136
id="status"
@@ -182,8 +182,8 @@ const DropDowns: React.FC<DropDownsProps> = ({
182182
display="flex"
183183
flexDirection="row"
184184
justifyContent="space-between"
185-
alignItems="center"
186-
gap={theme.spacing(15)}
185+
alignItems="flex-end"
186+
gap={theme.spacing(4)}
187187
>
188188
<Select
189189
id="Owner"
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const inputStyles = {
2-
minWidth: 200,
3-
maxWidth: 400,
4-
flexGrow: 1,
2+
width: "calc((100% - 64px) / 3)", // Account for gap between 3 fields
3+
flexShrink: 0,
54
height: 34,
65
};

Clients/src/presentation/components/Inputs/Select/index.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,19 @@ const Select: React.FC<SelectProps> = ({
5050
margin: theme.spacing(2),
5151
};
5252

53-
// Extract width from sx prop to apply to wrapper Stack
54-
const extractedWidth = sx && typeof sx === 'object' && !Array.isArray(sx)
55-
? (sx as any).width
56-
: undefined;
53+
// Extract width, flexGrow, minWidth, maxWidth from sx prop to apply to wrapper Stack
54+
const extractedLayoutProps = sx && typeof sx === 'object' && !Array.isArray(sx)
55+
? {
56+
width: (sx as any).width,
57+
flexGrow: (sx as any).flexGrow,
58+
minWidth: (sx as any).minWidth,
59+
maxWidth: (sx as any).maxWidth,
60+
}
61+
: {};
5762

58-
// Create a copy of sx without width to pass to MuiSelect
59-
const sxWithoutWidth = sx && typeof sx === 'object' && !Array.isArray(sx)
60-
? Object.fromEntries(Object.entries(sx).filter(([key]) => key !== 'width'))
63+
// Create a copy of sx without layout props to pass to MuiSelect
64+
const sxWithoutLayoutProps = sx && typeof sx === 'object' && !Array.isArray(sx)
65+
? Object.fromEntries(Object.entries(sx).filter(([key]) => !['width', 'flexGrow', 'minWidth', 'maxWidth'].includes(key)))
6166
: sx;
6267

6368
const renderValue = (value: unknown) => {
@@ -96,9 +101,7 @@ const Select: React.FC<SelectProps> = ({
96101
<Stack
97102
gap={theme.spacing(2)}
98103
className="select-wrapper"
99-
sx={{
100-
width: extractedWidth,
101-
}}
104+
sx={extractedLayoutProps}
102105
>
103106
{label && (
104107
<Typography
@@ -181,7 +184,7 @@ const Select: React.FC<SelectProps> = ({
181184
position: "relative",
182185
cursor: "pointer",
183186
...getSelectStyles(theme, { hasError: !!error }),
184-
...sxWithoutWidth,
187+
...sxWithoutLayoutProps,
185188
}}
186189
>
187190
{items.map(

0 commit comments

Comments
 (0)