Skip to content

Commit 8018155

Browse files
authored
Merge branch 'develop' into refactor/themeprovider
2 parents da26b2b + 8980fe5 commit 8018155

File tree

11 files changed

+39
-49
lines changed

11 files changed

+39
-49
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Issues and Pull Requests categorized under the PATCH or MINOR Release Milestones
3838

3939
We will aim to deploy on a 1-2 month basis. Here are some dates we’re working towards:
4040

41-
2.11.0 MINOR Release: By January 16, 2023
41+
2.12.0 MINOR Release: By February 27, 2024
4242

4343
[You can read more about Semantic Versioning and the differences between a MINOR and PATCH release](https://semver.org/).
4444

Diff for: client/constants.js

-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ export const SET_SORT_PARAMS = 'SET_SORT_PARAMS';
137137
export const SET_SEARCH_TERM = 'SET_SEARCH_TERM';
138138
export const CLOSE_SKETCHLIST_MODAL = 'CLOSE_SKETCHLIST_MODAL';
139139

140-
export const START_LOADING = 'START_LOADING';
141-
export const STOP_LOADING = 'STOP_LOADING';
142-
143140
export const START_SAVING_PROJECT = 'START_SAVING_PROJECT';
144141
export const END_SAVING_PROJECT = 'END_SAVING_PROJECT';
145142

Diff for: client/modules/IDE/actions/assets.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import apiClient from '../../../utils/apiClient';
22
import * as ActionTypes from '../../../constants';
3-
import { startLoader, stopLoader } from './loader';
3+
import { startLoader, stopLoader } from '../reducers/loading';
44
import { assetsActions } from '../reducers/assets';
55

66
const { setAssets, deleteAsset } = assetsActions;

Diff for: client/modules/IDE/actions/collections.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import browserHistory from '../../../browserHistory';
22
import apiClient from '../../../utils/apiClient';
33
import * as ActionTypes from '../../../constants';
4-
import { startLoader, stopLoader } from './loader';
4+
import { startLoader, stopLoader } from '../reducers/loading';
55
import { setToastText, showToast } from './toast';
66

77
const TOAST_DISPLAY_TIME_MS = 1500;
@@ -80,7 +80,7 @@ export function addToCollection(collectionId, projectId) {
8080

8181
const collectionName = response.data.name;
8282

83-
dispatch(setToastText(`Added to "${collectionName}`));
83+
dispatch(setToastText(`Added to "${collectionName}"`));
8484
dispatch(showToast(TOAST_DISPLAY_TIME_MS));
8585

8686
return response.data;
@@ -110,7 +110,7 @@ export function removeFromCollection(collectionId, projectId) {
110110

111111
const collectionName = response.data.name;
112112

113-
dispatch(setToastText(`Removed from "${collectionName}`));
113+
dispatch(setToastText(`Removed from "${collectionName}"`));
114114
dispatch(showToast(TOAST_DISPLAY_TIME_MS));
115115

116116
return response.data;

Diff for: client/modules/IDE/actions/loader.js

-9
This file was deleted.

Diff for: client/modules/IDE/actions/projects.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import apiClient from '../../../utils/apiClient';
22
import * as ActionTypes from '../../../constants';
3-
import { startLoader, stopLoader } from './loader';
3+
import { startLoader, stopLoader } from '../reducers/loading';
44

55
// eslint-disable-next-line
66
export function getProjects(username) {

Diff for: client/modules/IDE/actions/projects.unit.test.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { rest } from 'msw';
55

66
import * as ProjectActions from './projects';
77
import * as ActionTypes from '../../../constants';
8+
import { startLoader, stopLoader } from '../reducers/loading';
89
import {
910
initialTestState,
1011
mockProjects
@@ -33,9 +34,9 @@ describe('projects action creator tests', () => {
3334
store = mockStore(initialTestState);
3435

3536
const expectedActions = [
36-
{ type: ActionTypes.START_LOADING },
37+
{ type: startLoader.type },
3738
{ type: ActionTypes.SET_PROJECTS, projects: mockProjects },
38-
{ type: ActionTypes.STOP_LOADING }
39+
{ type: stopLoader.type }
3940
];
4041

4142
return store

Diff for: client/modules/IDE/reducers/loading.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import * as ActionTypes from '../../../constants';
1+
import { createSlice } from '@reduxjs/toolkit';
22

3-
const loading = (state = false, action) => {
4-
switch (action.type) {
5-
case ActionTypes.START_LOADING:
6-
return true;
7-
case ActionTypes.STOP_LOADING:
8-
return false;
9-
default:
10-
return state;
3+
const loadingSlice = createSlice({
4+
name: 'loading',
5+
initialState: false,
6+
reducers: {
7+
startLoader: () => true,
8+
stopLoader: () => false
119
}
12-
};
10+
});
1311

14-
export default loading;
12+
export const { startLoader, stopLoader } = loadingSlice.actions;
13+
export default loadingSlice.reducer;

Diff for: client/styles/components/_editor.scss

+9-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pre.CodeMirror-line {
9191
position: fixed;
9292
top: 0;
9393
left: 50%;
94-
margin-left: math.div(552 * 0.5, $base-font-size);
94+
margin-left: #{math.div(-552 * 0.5, $base-font-size)}rem;
9595

9696
@media (max-width: 770px) {
9797
left: 0;
@@ -100,7 +100,7 @@ pre.CodeMirror-line {
100100
margin-left: 0;
101101
}
102102

103-
z-index: 1;
103+
z-index: 10;
104104

105105
width: 580px;
106106
font-family: Montserrat, sans-serif;
@@ -139,8 +139,11 @@ pre.CodeMirror-line {
139139
}
140140

141141
.CodeMirror-find-controls {
142+
width: 100%;
142143
display: flex;
143144
align-items: center;
145+
justify-content: space-between;
146+
height: #{math.div(35, $base-font-size)}rem;
144147
}
145148
.CodeMirror-search-inputs {
146149
width: 30%;
@@ -152,9 +155,11 @@ pre.CodeMirror-line {
152155
align-items: center;
153156
}
154157
.CodeMirror-search-controls {
158+
width: 60%;
155159
display: flex;
156-
align-items: center;
157-
justify-content: end;
160+
flex-wrap: wrap-reverse;
161+
justify-content: flex-start;
162+
align-items: flex-end;
158163
}
159164
.CodeMirror-replace-controls {
160165
display: flex;

Diff for: server/config/passport.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ passport.use(
123123
User.findOne({ github: profile.id }, (findByGithubErr, existingUser) => {
124124
if (existingUser) {
125125
if (req.user && req.user.email !== existingUser.email) {
126-
done(
127-
new Error('GitHub account is already linked to another account.')
128-
);
126+
done(null, false, {
127+
msg: 'GitHub account is already linked to another account.'
128+
});
129129
return;
130130
} else if (existingUser.banned) {
131-
done(new Error(accountSuspensionMessage));
131+
done(null, false, { msg: accountSuspensionMessage });
132132
return;
133133
}
134134
done(null, existingUser);
@@ -159,7 +159,7 @@ passport.use(
159159
[existingEmailUser] = existingEmailUsers;
160160
}
161161
if (existingEmailUser.banned) {
162-
done(new Error(accountSuspensionMessage));
162+
done(null, false, { msg: accountSuspensionMessage });
163163
return;
164164
}
165165
existingEmailUser.email = existingEmailUser.email || primaryEmail;
@@ -218,14 +218,12 @@ passport.use(
218218
(findByGoogleErr, existingUser) => {
219219
if (existingUser) {
220220
if (req.user && req.user.email !== existingUser.email) {
221-
done(
222-
new Error(
223-
'Google account is already linked to another account.'
224-
)
225-
);
221+
done(null, false, {
222+
msg: 'Google account is already linked to another account.'
223+
});
226224
return;
227225
} else if (existingUser.banned) {
228-
done(new Error(accountSuspensionMessage));
226+
done(null, false, { msg: accountSuspensionMessage });
229227
return;
230228
}
231229
done(null, existingUser);
@@ -256,7 +254,7 @@ passport.use(
256254
// then, append a random friendly word?
257255
if (existingEmailUser) {
258256
if (existingEmailUser.banned) {
259-
done(new Error(accountSuspensionMessage));
257+
done(null, false, { msg: accountSuspensionMessage });
260258
return;
261259
}
262260
existingEmailUser.email =

Diff for: server/controllers/user.controller.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ const random = (done) => {
3030
};
3131

3232
export function createUser(req, res, next) {
33-
const { username, email } = req.body;
34-
const { password } = req.body;
33+
const { username, email, password } = req.body;
3534
const emailLowerCase = email.toLowerCase();
3635
const EMAIL_VERIFY_TOKEN_EXPIRY_TIME = Date.now() + 3600000 * 24; // 24 hours
3736
random((tokenError, token) => {

0 commit comments

Comments
 (0)