diff --git a/.env b/.env
index e8f0ecca3..e83268bfe 100644
--- a/.env
+++ b/.env
@@ -2,4 +2,5 @@ REACT_APP_BACKEND_URL=https://localhost:5001/api
REACT_APP_TEMPVAL=tempval
API_URL=https://best.api.ever.com
REACT_APP_GOOGLE_ANALYTICS=tempval
-RECAPTCHA_SITE_KEY="6LeUO3ApAAAAAOC7F4v0qTsSwIR9mZu33SWjAAtM"
\ No newline at end of file
+RECAPTCHA_SITE_KEY="6LeUO3ApAAAAAOC7F4v0qTsSwIR9mZu33SWjAAtM"
+VERSION=1.1.0
diff --git a/GITVERSION_PROPERTIES b/GITVERSION_PROPERTIES
new file mode 100644
index 000000000..1408ab8e3
--- /dev/null
+++ b/GITVERSION_PROPERTIES
@@ -0,0 +1,35 @@
+{
+ "Major": 1,
+ "Minor": 1,
+ "Patch": 0,
+ "PreReleaseTag": "beta.1",
+ "PreReleaseTagWithDash": "-beta.1",
+ "PreReleaseLabel": "beta",
+ "PreReleaseLabelWithDash": "-beta",
+ "PreReleaseNumber": 1,
+ "WeightedPreReleaseNumber": 30001,
+ "BuildMetaData": 47,
+ "BuildMetaDataPadded": "0047",
+ "FullBuildMetaData": "47.Branch.release-1.0.0.Sha.283d01e8424001490c227db838d965580c59935e",
+ "MajorMinorPatch": "1.0.0",
+ "SemVer": "1.0.0-beta.1",
+ "LegacySemVer": "1.0.0-beta1",
+ "LegacySemVerPadded": "1.0.0-beta0001",
+ "AssemblySemVer": "1.0.0.0",
+ "AssemblySemFileVer": "1.0.0.0",
+ "FullSemVer": "1.0.0-beta.1+47",
+ "InformationalVersion": "1.0.0-beta.1+47.Branch.release-1.0.0.Sha.283d01e8424001490c227db838d965580c59935e",
+ "BranchName": "release/1.0.0",
+ "EscapedBranchName": "release-1-0-0",
+ "Sha": "283d01e8424001490c227db838d965580c59935e",
+ "ShortSha": "283d01e",
+ "NuGetVersionV2": "1.0.0-beta0001",
+ "NuGetVersion": "1.0.0-beta0001",
+ "NuGetPreReleaseTagV2": "beta0001",
+ "NuGetPreReleaseTag": "beta0001",
+ "VersionSourceSha": "bd3aa573f4e0308049bbef8c6639abd2851495a0",
+ "CommitsSinceVersionSource": 47,
+ "CommitsSinceVersionSourcePadded": "0047",
+ "UncommittedChanges": 1,
+ "CommitDate": "2024-09-12"
+}
diff --git a/Jenkinsfile b/Jenkinsfile
index 118701c22..dbb63a6bd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -57,6 +57,7 @@ pipeline {
sh "cat version"
vers = readFile(file: 'version').trim()
sh "echo ${vers}"
+ env.vers="${vers}"
env.CODE_VERSION = readFile(file: 'version').trim()
echo "${env.CODE_VERSION}"
SEM_VERSION="${env.CODE_VERSION}"
@@ -234,14 +235,15 @@ pipeline {
}
steps {
script {
-
+ git branch: 'master', credentialsId: 'test_git_user', url: 'git@github.com:ita-social-projects/StreetCode_Client.git'
sh 'echo ${BRANCH_NAME}'
sh "git checkout master"
sh 'echo ${BRANCH_NAME}'
- sh "git merge release/${env.SEM_VERSION}"
- sh "npm version ${env.SEM_VERSION} -m 'Upgrade to %s as part of release'"
-
- sh "git push origin main"
+ sh 'git merge ${BRANCH_NAME}'
+ sh "npm version ${env.vers} --allow-same-version --no-git-tag-version"
+ sh "git add ."
+ sh "git commit -m 'Upgrade to %s as part of release'"
+ sh "git push origin master"
}
}
diff --git a/__mocks__/@stores/root-store.tsx b/__mocks__/@stores/root-store.tsx
index 193407898..021eb3058 100644
--- a/__mocks__/@stores/root-store.tsx
+++ b/__mocks__/@stores/root-store.tsx
@@ -25,6 +25,13 @@ export const useModalContext = () => ({
},
});
+export const useAudioContext = () => ({
+ audio: {
+ base64: 'base64Mock',
+ mimeType: 'audio/mpeg',
+ },
+});
+
export const useMobx = () => ({
newsStore: {
updateNews: mockUpdateNews,
diff --git a/config/webpack.dev.js b/config/webpack.dev.js
index 972ea2752..e44e562cb 100644
--- a/config/webpack.dev.js
+++ b/config/webpack.dev.js
@@ -38,53 +38,57 @@ module.exports = {
new Dotenv({
path: `./.env`,
}),
- // new GenerateSW({
- // skipWaiting: true,
- // clientsClaim: true,
- // maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
- // runtimeCaching: [
- // {
- // urlPattern: /\.(?:js|css)$/,
- // handler: 'CacheFirst',
- // options: {
- // cacheName: 'static-resources',
- // expiration: {
- // maxAgeSeconds: 60 * 60 * 24 * 7, // 1 week
- // },
- // },
- // },
- // {
- // urlPattern: /\.(?:png|jpg|jpeg|svg|gif)$/,
- // handler: 'CacheFirst',
- // options: {
- // cacheName: 'image-resources',
- // expiration: {
- // maxAgeSeconds: 60 * 60 * 24 * 7, // 1 week
- // },
- // },
- // },
- // {
- // urlPattern: /\.(?:woff|woff2|ttf|otf)$/,
- // handler:'CacheFirst',
- // options: {
- // cacheName: 'font-resources',
- // expiration: {
- // maxAgeSeconds: 60 * 60 * 24 * 90, // 3 months
- // },
- // },
- // },
- // {
- // urlPattern: /^https?.*/,
- // handler: 'NetworkFirst',
- // options: {
- // cacheName: 'external-resources',
- // expiration: {
- // maxEntries: 260
- // },
- // },
- // },
- // ],
- // }),
+ new GenerateSW({
+ skipWaiting: true,
+ clientsClaim: true,
+ maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
+ runtimeCaching: [
+ {
+ urlPattern: /env-config\.js$/,
+ handler: 'NetworkOnly'
+ },
+ {
+ urlPattern: /\.(?:js|css)$/,
+ handler: 'CacheFirst',
+ options: {
+ cacheName: 'static-resources',
+ expiration: {
+ maxAgeSeconds: 60 * 60 * 24 * 7, // 1 week
+ },
+ },
+ },
+ {
+ urlPattern: /\.(?:png|jpg|jpeg|svg|gif)$/,
+ handler: 'CacheFirst',
+ options: {
+ cacheName: 'image-resources',
+ expiration: {
+ maxAgeSeconds: 60 * 60 * 24 * 7, // 1 week
+ },
+ },
+ },
+ {
+ urlPattern: /\.(?:woff|woff2|ttf|otf)$/,
+ handler:'CacheFirst',
+ options: {
+ cacheName: 'font-resources',
+ expiration: {
+ maxAgeSeconds: 60 * 60 * 24 * 90, // 3 months
+ },
+ },
+ },
+ {
+ urlPattern: /^https?.*/,
+ handler: 'NetworkFirst',
+ options: {
+ cacheName: 'external-resources',
+ expiration: {
+ maxEntries: 260
+ },
+ },
+ },
+ ],
+ }),
],
optimization: {
splitChunks: {
diff --git a/config/webpack.prod.js b/config/webpack.prod.js
index 31219862d..c39d6c22b 100644
--- a/config/webpack.prod.js
+++ b/config/webpack.prod.js
@@ -52,9 +52,13 @@ module.exports = {
clientsClaim: true,
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
runtimeCaching: [
+ {
+ urlPattern: /env-config\.js$/,
+ handler: 'NetworkOnly'
+ },
{
urlPattern: /\.(?:js|css)$/,
- handler: 'CacheFirst',
+ handler: 'NetworkFirst',
options: {
cacheName: 'static-resources',
expiration: {
@@ -65,7 +69,7 @@ module.exports = {
},
{
urlPattern: /\.(?:png|jpg|jpeg|svg|gif)$/,
- handler: 'CacheFirst',
+ handler: 'StaleWhileRevalidate',
options: {
cacheName: 'image-resources',
expiration: {
@@ -75,7 +79,7 @@ module.exports = {
},
{
urlPattern: /\.(?:woff|woff2|ttf|otf)$/,
- handler:'CacheFirst',
+ handler:'StaleWhileRevalidate',
options: {
cacheName: 'font-resources',
expiration: {
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index 378a94bf1..de24fbde7 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -4,6 +4,9 @@ server {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
+ location ~ ^/(index.html|main.bundle.js){
+ add_header Cache-Control "private, no-store, no-cache";
+ }
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
diff --git a/package-lock.json b/package-lock.json
index 895a7a8ba..33396d25a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "streetcode",
- "version": "0.1.0",
+ "version": "1.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
diff --git a/package.json b/package.json
index e28a8690a..551e61be0 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "streetcode",
"author": "SoftServe IT Academy (https://career.softserveinc.com/uk-ua/)",
"license": "MIT",
- "version": "0.1.0",
+ "version": "1.1.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.8.0",
diff --git a/public/env-config.js b/public/env-config.js
index 111a97b97..afa332a89 100644
--- a/public/env-config.js
+++ b/public/env-config.js
@@ -3,4 +3,5 @@ window._env_ = {
API_URL: "https://stageback.streetcode.com.ua/api",
REACT_APP_GOOGLE_ANALYTICS: "REACT_APP_GOOGLE_ANALYTICS_VALUE",
RECAPTCHA_SITE_KEY: "6LeUO3ApAAAAAOC7F4v0qTsSwIR9mZu33SWjAAtM",
+ VERSION: "1.1.0"
}
diff --git a/src/app/common/components/ArtGallery/ArtGalleryBlock.component.tsx b/src/app/common/components/ArtGallery/ArtGalleryBlock.component.tsx
index 12e43ea33..3f2ccc3e7 100644
--- a/src/app/common/components/ArtGallery/ArtGalleryBlock.component.tsx
+++ b/src/app/common/components/ArtGallery/ArtGalleryBlock.component.tsx
@@ -90,13 +90,14 @@ const ArtGallery = ({
if (streetcodeIdValidAndFetchingRequired()) {
secondRender.current = true;
if (isFillArtsStore) {
- await fetchAllToDefaultTemplate(getStreetCodeId !== -1 ? getStreetCodeId : parseId);
+ let currStreetcodeId = getStreetCodeId !== -1 ? getStreetCodeId : parseId;
+ const startingSlide = await fetchAllToDefaultTemplate(currStreetcodeId);
- let currentSlide = 0;
+ let currentSlide = startingSlide ?? 0;
while (currentSlide < MAX_SLIDES_AMOUNT) {
try {
// eslint-disable-next-line no-await-in-loop
- await fetchAllArtSlidesByStreetcodeId(getStreetCodeId !== -1 ? getStreetCodeId : parseId, currentSlide);
+ await fetchAllArtSlidesByStreetcodeId(currStreetcodeId, currentSlide);
currentSlide += amountOfSlides;
} catch (error: unknown) {
@@ -340,4 +341,4 @@ const ArtGallery = ({
);
};
-export default observer(ArtGallery);
\ No newline at end of file
+export default observer(ArtGallery);
diff --git a/src/app/common/components/AudioPlayer/AudioPlayer.component.spec.tsx b/src/app/common/components/AudioPlayer/AudioPlayer.component.spec.tsx
new file mode 100644
index 000000000..553685e13
--- /dev/null
+++ b/src/app/common/components/AudioPlayer/AudioPlayer.component.spec.tsx
@@ -0,0 +1,121 @@
+import { act } from 'react-dom/test-utils';
+import {
+ fireEvent,
+ render,
+ screen,
+} from '@testing-library/react';
+import user from '@testing-library/user-event';
+
+import '@testing-library/jest-dom';
+
+import { AudioPlayer } from './AudioPlayer.component';
+
+Object.defineProperty(window, 'matchMedia', {
+ writable: true,
+ value: (query: unknown) => ({
+ matches: false,
+ media: query,
+ onchange: null,
+ addListener: () => {},
+ removeListener: () => {},
+ addEventListener: () => {},
+ removeEventListener: () => {},
+ dispatchEvent: () => {},
+ }),
+});
+
+jest.mock('@images/audio-player/PauseBtn.webp', () => 'test-file-stub');
+jest.mock('@images/audio-player/PlayBtn.webp', () => 'test-file-stub');
+
+global.HTMLMediaElement.prototype.play = jest.fn();
+global.HTMLMediaElement.prototype.pause = jest.fn();
+global.HTMLMediaElement.prototype.addEventListener = jest.fn((event, callback) => {
+ if (event === 'ended') {
+ setTimeout(() => {
+ if (typeof callback === 'function') {
+ callback(new Event('ended'));
+ }
+ }, 0);
+ }
+});
+
+describe('AudioPlayer test', () => {
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+
+ it('should be rendered', async () => {
+ const { container } = await render(
- Введіть правильне посилання для збереження назви посилання. + Введіть правильне посилання для збереження назви посилання.
)} @@ -391,19 +404,15 @@ const PartnerModal: React.FC< {{link.targetUrl}
+{link.targetUrl}