Skip to content

Commit 06012b8

Browse files
authored
Merge branch 'develop' into feature/remove-array-spread
2 parents 3e4568a + a2022b2 commit 06012b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+276
-578
lines changed

.docker/vhost.conf

+10
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,14 @@ server {
88
proxy_set_header Host $http_host;
99
proxy_pass http://node:3000;
1010
}
11+
12+
location /ws {
13+
proxy_set_header X-Forwarded-For $remote_addr;
14+
proxy_set_header Host $http_host;
15+
proxy_pass http://node:3000;
16+
proxy_http_version 1.1;
17+
proxy_set_header Upgrade $http_upgrade;
18+
proxy_set_header Connection "Upgrade";
19+
proxy_set_header X-Real-IP $remote_addr;
20+
}
1121
}

.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"allowImportExportEverywhere": true
1414
},
1515
"rules": {
16+
"react/require-default-props": "off",
1617
"react/jsx-filename-extension": [
1718
"warn",
1819
{

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
## [Unreleased]
66

77
- Removed array spread.
8+
- Fixed HMR setup.
9+
- Upgraded @fortawesome/react-fontawesome, react-quill, react-toastify.
10+
- Removed unused react-dayjs.
11+
- Remove default props from the project.
812

913
- [#244](https://github.com/aroskanalen/display-admin-client/pull/1)
1014
- Migrate from Cypress to playwright

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"@amcharts/amcharts4": "^4.10.21",
88
"@fortawesome/fontawesome-svg-core": "^1.2.35",
99
"@fortawesome/free-solid-svg-icons": "^5.15.3",
10-
"@fortawesome/react-fontawesome": "^0.1.14",
10+
"@fortawesome/react-fontawesome": "^0.2.2",
1111
"@hello-pangea/dnd": "^16.0.0",
1212
"@paciolan/remote-component": "^2.11.0",
13+
"@popperjs/core": "^2.11.8",
1314
"@reduxjs/toolkit": "^1.6.1",
1415
"@vitejs/plugin-react": "^4.3.0",
1516
"bootstrap": "^5.0.2",
@@ -26,20 +27,19 @@
2627
"react": "^18.2.0",
2728
"react-bootstrap": "^1.6.1",
2829
"react-color-palette": "^6.1.0",
29-
"react-dayjs": "^0.3.2",
3030
"react-dom": "^18.2.0",
3131
"react-dropzone": "^11.4.2",
3232
"react-i18next": "^11.16.1",
3333
"react-images-uploading": "^3.1.2",
3434
"react-multi-select-component": "^4.1.12",
3535
"react-paginate": "^8.1.3",
36-
"react-quill": "^1.3.5",
36+
"react-quill": "^2.0.0",
3737
"react-redux": "^7.2.5",
3838
"react-router": "^5.2.0",
3939
"react-router-dom": "^6.2.1",
4040
"react-select": "^5.2.2",
4141
"react-table": "^7.7.0",
42-
"react-toastify": "^8.1.0",
42+
"react-toastify": "^10.0.0",
4343
"rrule": "^2.7.2",
4444
"typescript": "^4.4.2",
4545
"ulid": "^2.3.0",
@@ -75,14 +75,14 @@
7575
]
7676
},
7777
"devDependencies": {
78-
"eslint": "7.32.0",
79-
"eslint-plugin-jsdoc": "^35.4.3",
8078
"@playwright/test": "^1.44.1",
8179
"@types/node": "^20.12.13",
8280
"babel-eslint": "^10.1.0",
81+
"eslint": "7.32.0",
8382
"eslint-config-airbnb": "^18.2.1",
8483
"eslint-config-prettier": "8.3.0",
8584
"eslint-plugin-import": "^2.23.4",
85+
"eslint-plugin-jsdoc": "^35.4.3",
8686
"eslint-plugin-jsx-a11y": "^6.4.1",
8787
"eslint-plugin-only-warn": "^1.0.2",
8888
"eslint-plugin-prettier": "3.4.0",

src/components/activation-code/activation-code-form.jsx

+4-15
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ import RadioButtons from "../util/forms/radio-buttons";
2323
* @returns {object} The user form.
2424
*/
2525
function ActivationCodeForm({
26-
activationCode,
2726
handleInput,
2827
handleSubmit,
2928
headerText,
30-
isLoading,
31-
loadingMessage,
29+
isLoading = false,
30+
loadingMessage = "",
31+
activationCode,
3232
}) {
3333
const { t } = useTranslation("common", { keyPrefix: "activation-code-form" });
3434
const navigate = useNavigate();
@@ -44,8 +44,6 @@ function ActivationCodeForm({
4444
},
4545
];
4646

47-
// 123
48-
4947
return (
5048
<>
5149
<LoadingComponent isLoading={isLoading} loadingMessage={loadingMessage} />
@@ -107,20 +105,11 @@ function ActivationCodeForm({
107105
);
108106
}
109107

110-
ActivationCodeForm.defaultProps = {
111-
isLoading: false,
112-
loadingMessage: "",
113-
activationCode: PropTypes.shape({
114-
displayName: "",
115-
role: "",
116-
}),
117-
};
118-
119108
ActivationCodeForm.propTypes = {
120109
activationCode: PropTypes.shape({
121110
displayName: PropTypes.string.isRequired,
122111
role: PropTypes.string.isRequired,
123-
}),
112+
}).isRequired,
124113
handleInput: PropTypes.func.isRequired,
125114
handleSubmit: PropTypes.func.isRequired,
126115
headerText: PropTypes.string.isRequired,

src/components/groups/group-form.jsx

+6-12
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ import FormInput from "../util/forms/form-input";
2222
* @returns {object} The group form.
2323
*/
2424
function GroupForm({
25-
group,
2625
handleInput,
2726
handleSubmit,
2827
headerText,
29-
isLoading,
30-
loadingMessage,
28+
isLoading = false,
29+
loadingMessage = "",
30+
group = {
31+
description: "",
32+
title: "",
33+
},
3134
}) {
3235
const { t } = useTranslation("common");
3336
const navigate = useNavigate();
@@ -82,15 +85,6 @@ function GroupForm({
8285
);
8386
}
8487

85-
GroupForm.defaultProps = {
86-
isLoading: false,
87-
loadingMessage: "",
88-
group: PropTypes.shape({
89-
description: "",
90-
title: "",
91-
}),
92-
};
93-
9488
GroupForm.propTypes = {
9589
group: PropTypes.shape({
9690
description: PropTypes.string.isRequired,

src/components/media/image-list.jsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import ListLoading from "../util/loading-component/list-loading";
1414
* @param {boolean} props.multiple Whether the image list allows for multiselect
1515
* @returns {object} The image list page.
1616
*/
17-
function ImageList({ media, multiple }) {
17+
function ImageList({ media = [], multiple }) {
1818
const { selected, setSelected } = useModal();
1919

2020
/**
@@ -76,10 +76,6 @@ function ImageList({ media, multiple }) {
7676
);
7777
}
7878

79-
ImageList.defaultProps = {
80-
media: [],
81-
};
82-
8379
ImageList.propTypes = {
8480
multiple: PropTypes.bool.isRequired,
8581
media: PropTypes.arrayOf(

src/components/media/media-form.jsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ function MediaForm({
2828
handleSubmit,
2929
headerText,
3030
errors,
31-
isLoading,
32-
loadingMessage,
31+
isLoading = false,
32+
loadingMessage = "",
3333
}) {
3434
const { t } = useTranslation("common");
3535
const navigate = useNavigate();
@@ -84,11 +84,6 @@ function MediaForm({
8484
);
8585
}
8686

87-
MediaForm.defaultProps = {
88-
isLoading: false,
89-
loadingMessage: "",
90-
};
91-
9287
MediaForm.propTypes = {
9388
media: PropTypes.arrayOf(
9489
PropTypes.shape({

src/components/media/media-list.jsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import "./media-list.scss";
3030
* @param {boolean} props.multiple Whether the image list allows for multiselect
3131
* @returns {object} The media list.
3232
*/
33-
function MediaList({ fromModal, multiple }) {
33+
function MediaList({ fromModal = false, multiple = true }) {
3434
// Translations
3535
const { t } = useTranslation("common", { keyPrefix: "media-list" });
3636
// Selected data
@@ -237,11 +237,6 @@ function MediaList({ fromModal, multiple }) {
237237
);
238238
}
239239

240-
MediaList.defaultProps = {
241-
fromModal: false,
242-
multiple: true,
243-
};
244-
245240
MediaList.propTypes = {
246241
fromModal: PropTypes.bool,
247242
multiple: PropTypes.bool,

src/components/playlist/campaign-form.jsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SelectGroupsTable from "../util/multi-and-table/select-groups-table";
1515
* @param {Function} props.handleInput Handles form input.
1616
* @returns {object} The campaign form.
1717
*/
18-
function CampaignForm({ campaign, handleInput }) {
18+
function CampaignForm({ campaign = null, handleInput }) {
1919
const { t } = useTranslation("common");
2020

2121
return (
@@ -46,10 +46,6 @@ function CampaignForm({ campaign, handleInput }) {
4646
);
4747
}
4848

49-
CampaignForm.defaultProps = {
50-
campaign: null,
51-
};
52-
5349
CampaignForm.propTypes = {
5450
campaign: PropTypes.shape({
5551
"@id": PropTypes.string,

src/components/playlist/playlist-campaign-form.jsx

+5-13
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ import LoadingComponent from "../util/loading-component/loading-component";
2727
* @returns {object} The form shared by campaigns and playlists.
2828
*/
2929
function PlaylistCampaignForm({
30-
playlist,
3130
handleInput,
3231
handleSubmit,
3332
headerText,
34-
slideId,
35-
isLoading,
36-
loadingMessage,
37-
isCampaign,
3833
location,
3934
children,
35+
slideId = "",
36+
isLoading = false,
37+
loadingMessage = "",
38+
isCampaign = false,
39+
playlist = null,
4040
}) {
4141
const { t } = useTranslation("common");
4242
const navigate = useNavigate();
@@ -154,14 +154,6 @@ function PlaylistCampaignForm({
154154
);
155155
}
156156

157-
PlaylistCampaignForm.defaultProps = {
158-
slideId: "",
159-
isLoading: false,
160-
loadingMessage: "",
161-
isCampaign: false,
162-
playlist: null,
163-
};
164-
165157
PlaylistCampaignForm.propTypes = {
166158
playlist: PropTypes.shape({
167159
description: PropTypes.string,

src/components/playlist/playlist-campaign-manager.jsx

+5-13
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ import {
3333
* @returns {object} The shared manager, shared by campaign and playlists.
3434
*/
3535
function PlaylistCampaignManager({
36-
initialState,
3736
saveMethod,
38-
id,
39-
isLoading,
40-
loadingError,
41-
slideId,
4237
location,
38+
id = null,
39+
isLoading = false,
40+
loadingError = null,
41+
initialState = null,
42+
slideId = "",
4343
}) {
4444
const dispatch = useDispatch();
4545
const { t } = useTranslation("common", {
@@ -361,14 +361,6 @@ function PlaylistCampaignManager({
361361
);
362362
}
363363

364-
PlaylistCampaignManager.defaultProps = {
365-
id: null,
366-
isLoading: false,
367-
loadingError: null,
368-
initialState: null,
369-
slideId: "",
370-
};
371-
372364
PlaylistCampaignManager.propTypes = {
373365
initialState: PropTypes.shape({
374366
feed: PropTypes.shape({

src/components/playlist/playlist-form.jsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ import TenantsDropdown from "../util/forms/multiselect-dropdown/tenants/tenants-
1818
* shared info
1919
* @returns {object} The playlist form.
2020
*/
21-
function PlaylistForm({ playlist, handleInput, highlightSharedSection }) {
21+
function PlaylistForm({
22+
handleInput,
23+
highlightSharedSection = false,
24+
playlist = null,
25+
}) {
2226
const { t } = useTranslation("common");
2327
const context = useContext(UserContext);
2428

@@ -62,11 +66,6 @@ function PlaylistForm({ playlist, handleInput, highlightSharedSection }) {
6266
);
6367
}
6468

65-
PlaylistForm.defaultProps = {
66-
highlightSharedSection: false,
67-
playlist: null,
68-
};
69-
7069
PlaylistForm.propTypes = {
7170
playlist: PropTypes.shape({
7271
schedules: PropTypes.arrayOf(

src/components/screen/screen-form.jsx

+4-11
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ import "./screen-form.scss";
3737
* @returns {object} The screen form.
3838
*/
3939
function ScreenForm({
40-
screen,
4140
handleInput,
4241
handleSubmit,
4342
headerText,
44-
groupId,
45-
isLoading,
46-
loadingMessage,
4743
orientationOptions,
4844
resolutionOptions,
45+
groupId = "",
46+
isLoading = false,
47+
loadingMessage = "",
48+
screen = null,
4949
}) {
5050
const { t } = useTranslation("common", { keyPrefix: "screen-form" });
5151
const navigate = useNavigate();
@@ -331,13 +331,6 @@ function ScreenForm({
331331
);
332332
}
333333

334-
ScreenForm.defaultProps = {
335-
groupId: "",
336-
isLoading: false,
337-
loadingMessage: "",
338-
screen: null,
339-
};
340-
341334
ScreenForm.propTypes = {
342335
screen: PropTypes.shape({
343336
resolution: PropTypes.string,

0 commit comments

Comments
 (0)