Skip to content

Commit 2601b41

Browse files
committed
2 parents bd1a70c + 33ab05f commit 2601b41

File tree

5 files changed

+47
-30
lines changed

5 files changed

+47
-30
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
VITE_UI_SERVER_URL = 'https://alpha.judge.softuni.org'
22
VITE_ADMINISTRATION_URL = 'https://admin.alpha.judge.softuni.org'
33
VITE_PLATFORM_URL = 'https://platform.softuni.bg'
4-
VITE_YOUTUBE_VIDEO_ID = 'EjQlqgTbvsE'
4+
VITE_YOUTUBE_VIDEO_ID = 'EjQlqgTbvsE'
5+
UNMINIFIED=true
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
VITE_UI_SERVER_URL = 'https://dev.alpha.judge.softuni.org'
22
VITE_ADMINISTRATION_URL = 'https://admin.dev.alpha.judge.softuni.org'
33
VITE_PLATFORM_URL = 'https://dev.platform.softuni.bg'
4-
VITE_YOUTUBE_VIDEO_ID = 'EjQlqgTbvsE'
4+
VITE_YOUTUBE_VIDEO_ID = 'EjQlqgTbvsE'
5+
UNMINIFIED=true

Servers/UI/OJS.Servers.Ui/ClientApp/src/components/guidelines/lists/List.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const List = <TValue, >({
8585

8686
const renderItems = useCallback(
8787
() => {
88-
if (isNil(values) || isEmpty(values)) {
88+
if (isNil(values) || isEmpty(values) || !Array.isArray(values)) {
8989
return null;
9090
}
9191

Servers/UI/OJS.Servers.Ui/ClientApp/src/pages/contests/ContestsPage.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ const ContestsPage = () => {
102102
return <div style={{ ...flexCenterObjectStyles }}><SpinningLoader /></div>;
103103
}
104104

105+
if (!Array.isArray(contests?.items)) {
106+
console.log('The value of the contests is:');
107+
console.log(contests);
108+
return (
109+
<Heading type={HeadingType.secondary} className={`${textColorClassName} ${styles.contestHeading}`}>
110+
The contests could not be loaded. If this problem persists, please contact an administrator.
111+
</Heading>
112+
);
113+
}
114+
105115
if (!contests?.items?.length) {
106116
return (
107117
<Heading type={HeadingType.secondary} className={`${textColorClassName} ${styles.contestHeading}`}>

Servers/UI/OJS.Servers.Ui/ClientApp/vite.config.js

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,38 @@ const forwardToAdmin = () => {
2222
}
2323
}
2424

25-
export default defineConfig(({ mode }) => ({
26-
appType: 'mpa', // Multi Page Application
27-
build: {
28-
sourcemap: mode === 'staging',
29-
rollupOptions: {
30-
input: {
31-
main: resolve(__dirname, 'index.html'),
32-
admin: resolve(__dirname, 'admin.html')
33-
},
34-
onwarn(warning, warn) {
35-
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
36-
return
25+
export default defineConfig(({ mode }) => {
26+
const isUnminified = process.env.UNMINIFIED === 'true';
27+
28+
return ({
29+
appType: 'mpa', // Multi Page Application
30+
build: {
31+
minify: isUnminified ? false : 'esbuild',
32+
sourcemap: isUnminified,
33+
rollupOptions: {
34+
input: {
35+
main: resolve(__dirname, 'index.html'),
36+
admin: resolve(__dirname, 'admin.html')
37+
},
38+
onwarn(warning, warn) {
39+
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
40+
return
41+
}
42+
warn(warning)
3743
}
38-
warn(warning)
39-
}
44+
},
4045
},
41-
},
42-
plugins: [
43-
react(),
44-
svgr(),
45-
forwardToAdmin(),
46-
visualizer({open: true, filename: 'bundle-analysis.html'}),
47-
],
48-
server: {port: 5002},
49-
resolve: {
50-
alias: {
51-
'src': resolve(__dirname, 'src'),
46+
plugins: [
47+
react(),
48+
svgr(),
49+
forwardToAdmin(),
50+
visualizer({open: true, filename: 'bundle-analysis.html'}),
51+
],
52+
server: {port: 5002},
53+
resolve: {
54+
alias: {
55+
'src': resolve(__dirname, 'src'),
56+
},
5257
},
53-
},
54-
}));
58+
});
59+
});

0 commit comments

Comments
 (0)