Skip to content

Commit 24b3faa

Browse files
committed
fixed bug
1 parent 374e971 commit 24b3faa

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

Dockerfile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16.14.2 AS base
1+
FROM node:16.20.2 AS base
22
ENV APP_HOME=/usr/src/app \
33
TERM=xterm
44
RUN mkdir -p $APP_HOME
@@ -9,22 +9,18 @@ EXPOSE 8002
99
FROM base AS development
1010
ENV NODE_ENV development
1111
COPY package.json package-lock.json ./
12-
RUN npm install
12+
13+
# ✅ Only increase timeout configs, don’t install latest npm
14+
RUN npm config set fetch-retries 5 && \
15+
npm config set fetch-retry-mintimeout 20000 && \
16+
npm config set fetch-retry-maxtimeout 120000 && \
17+
npm config set timeout 60000 && \
18+
npm install --legacy-peer-deps
19+
1320
COPY .babelrc index.js nodemon.json ./
1421
COPY ./webpack ./webpack
1522
COPY client ./client
1623
COPY server ./server
1724
COPY translations/locales ./translations/locales
1825
COPY public ./public
1926
CMD ["npm", "start"]
20-
21-
FROM development AS build
22-
ENV NODE_ENV production
23-
RUN npm run build
24-
25-
FROM base AS production
26-
ENV NODE_ENV=production
27-
COPY package.json package-lock.json index.js ./
28-
RUN npm install --production
29-
COPY --from=build $APP_HOME/dist ./dist
30-
CMD ["npm", "run", "start:prod"]

client/modules/IDE/actions/project.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export function setProject(project) {
2424
type: ActionTypes.SET_PROJECT,
2525
project,
2626
files: project.files,
27-
owner: project.user
27+
owner: project.user,
28+
visibility: project.visibility
2829
};
2930
}
3031

@@ -418,7 +419,7 @@ export function changeVisibility(projectId, projectName, visibility) {
418419
.patch('/project/visibility', { projectId, visibility })
419420
.then((response) => {
420421
if (response.status === 200) {
421-
const { visibility: newVisibility } = response.data;
422+
const { visibility: newVisibility, updatedAt } = response.data;
422423

423424
dispatch({
424425
type: ActionTypes.CHANGE_VISIBILITY,
@@ -431,17 +432,22 @@ export function changeVisibility(projectId, projectName, visibility) {
431432
if (state.project.id === response.data.id) {
432433
dispatch({
433434
type: ActionTypes.SET_PROJECT_VISIBILITY,
434-
visibility: newVisibility
435+
visibility: newVisibility,
436+
updatedAt
435437
});
438+
436439
dispatch({
437440
type: ActionTypes.SET_PROJECT_NAME,
438441
name: response.data.name
439442
});
443+
444+
dispatch(
445+
setToastText(
446+
`${projectName} is now ${newVisibility.toLowerCase()}`
447+
)
448+
);
449+
dispatch(showToast(2000));
440450
}
441-
dispatch(
442-
setToastText(`${projectName} is now ${newVisibility.toLowerCase()}`)
443-
);
444-
dispatch(showToast(2000));
445451
}
446452
})
447453
.catch((error) => {

client/modules/IDE/components/SketchList.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ const SketchList = ({
6060

6161
const renderEmptyTable = () => {
6262
if (!isLoading() && sketches.length === 0) {
63-
return <p className="sketches-table">{t('SketchList.NoSketches')}</p>;
63+
return (
64+
<p className="sketches-table__empty">{t('SketchList.NoSketches')}</p>
65+
);
6466
}
6567
return null;
6668
};

client/modules/IDE/reducers/project.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ const project = (state, action) => {
2121
case ActionTypes.SET_PROJECT_NAME:
2222
return Object.assign({}, { ...state }, { name: action.name });
2323
case ActionTypes.SET_PROJECT_VISIBILITY:
24-
return Object.assign({}, { ...state }, { visibility: action.visibility });
24+
return Object.assign(
25+
{},
26+
{ ...state },
27+
{ visibility: action.visibility, updatedAt: action.updatedAt }
28+
);
2529
case ActionTypes.NEW_PROJECT:
2630
return {
2731
id: action.project.id,

server/controllers/project.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export async function getProject(req, res) {
104104
export function getProjectsForUserId(userId) {
105105
return Project.find({ user: userId })
106106
.sort('-createdAt')
107-
.select('name files id createdAt updatedAt')
107+
.select('name files id createdAt updatedAt visibility')
108108
.exec();
109109
}
110110

0 commit comments

Comments
 (0)