(
- {`Total price: ${total}`}
- )}
- />
-
-
- );
- });
- }, [invoices]);
-
- return (
-
- {invoiceElements && (
- {invoiceElements}
- )}
-
- );
-};
-
-export { MyInvoicesPage };
diff --git a/media-store/app/src/pages/PersonPage.js b/media-store/app/src/pages/PersonPage.js
deleted file mode 100644
index e941c4a6..00000000
--- a/media-store/app/src/pages/PersonPage.js
+++ /dev/null
@@ -1,108 +0,0 @@
-import React, { useState } from "react";
-import { Form, Button, message, Input } from "antd";
-import { omit, map } from "lodash";
-import { fetchPerson, confirmPerson } from "../api/calls";
-import { useErrors } from "../hooks/useErrors";
-import { useAppState } from "../hooks/useAppState";
-import { MESSAGE_TIMEOUT } from "../util/constants";
-import { useAbortableEffect } from "../hooks/useAbortableEffect";
-
-const PERSON_PROP = {
- address: "Address ",
- city: "City ",
- country: "Country ",
- fax: "Fax: ",
- firstName: "First name: ",
- lastName: "Last name: ",
- phone: "Phone: ",
- postalCode: "Postal code: ",
- state: "State",
- email: "email",
- company: "Company: ",
-};
-
-const PersonPage = () => {
- const { setLoading } = useAppState();
- const { handleError } = useErrors();
- const [form] = Form.useForm();
- const [person, setPerson] = useState({
- lastName: "",
- firstName: "",
- city: "",
- state: "",
- address: "",
- country: "",
- phone: "",
- postalCode: "",
- fax: "",
- email: "",
- company: "",
- });
-
- useAbortableEffect((status) => {
- setLoading(true);
-
- fetchPerson()
- .then(({ data: personData }) => {
- personData = omit(personData, "@odata.context", "ID");
- if (!status.aborted) {
- setPerson(personData);
- }
- })
- .catch(handleError)
- .finally(() => setLoading(false));
- }, []);
-
- const onConfirmChanges = (newPerson) => {
- setLoading(true);
- confirmPerson(newPerson)
- .then(() => {
- message.success("Person successfully updated", MESSAGE_TIMEOUT);
- })
- .catch(handleError)
- .finally(() => setLoading(false));
- };
-
- const personProperties = map(Object.keys(person), (currentKey) => (
-
-
-
-
-
- ));
-
- return (
- <>
- {person.lastName !== "" && (
-
-
-
-
- )}
- >
- );
-};
-
-export { PersonPage };
diff --git a/media-store/app/src/pages/TracksPage.css b/media-store/app/src/pages/TracksPage.css
deleted file mode 100644
index c3855497..00000000
--- a/media-store/app/src/pages/TracksPage.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.ant-select > div.ant-select-selector {
- padding: 5px;
- min-width: 300px;
-}
diff --git a/media-store/app/src/pages/TracksPage.js b/media-store/app/src/pages/TracksPage.js
deleted file mode 100644
index f3842535..00000000
--- a/media-store/app/src/pages/TracksPage.js
+++ /dev/null
@@ -1,219 +0,0 @@
-import React, { useState } from "react";
-import { debounce } from "lodash";
-import { Input, Col, Row, Select, Pagination } from "antd";
-import { Track } from "./tracks/Track";
-import { ManagedTrack } from "./tracks/ManagedTrack";
-import { useAppState } from "../hooks/useAppState";
-import { useErrors } from "../hooks/useErrors";
-import { fetchTacks, countTracks, fetchGenres } from "../api/calls";
-import { useAbortableEffect } from "../hooks/useAbortableEffect";
-import { requireEmployee } from "../util/constants";
-import "./TracksPage.css";
-
-const { Search } = Input;
-const { Option } = Select;
-
-const DEBOUNCE_TIMER = 500;
-const DEBOUNCE_OPTIONS = {
- leading: true,
- trailing: false,
-};
-
-const renderGenres = (genres) =>
- genres.map(({ ID, name }) => (
-
- ));
-
-const TracksContainer = () => {
- const { setLoading, user } = useAppState();
- const { handleError } = useErrors();
- const [state, setState] = useState({
- tracks: [],
- genres: [],
- pagination: {
- currentPage: 1,
- totalItems: 0,
- pageSize: 20,
- },
- searchOptions: {
- substr: "",
- genreIds: [],
- },
- });
-
- useAbortableEffect((status) => {
- setLoading(true);
-
- const countTracksReq = countTracks();
- const getTracksRequest = fetchTacks();
- const getGenresReq = fetchGenres();
-
- Promise.all([countTracksReq, getTracksRequest, getGenresReq])
- .then(
- ([
- { data: totalItems },
- {
- data: { value: tracks },
- },
- {
- data: { value: genres },
- },
- ]) => {
- if (!status.aborted) {
- setState({
- ...state,
- tracks,
- genres,
- pagination: { ...state.pagination, totalItems },
- });
- }
- }
- )
- .catch(handleError)
- .finally(() => setLoading(false));
- }, []);
-
- const onSearch = debounce(
- () => {
- setLoading(true);
- const options = {
- $top: state.pagination.pageSize,
- substr: state.searchOptions.substr,
- genreIds: state.searchOptions.genreIds,
- };
-
- Promise.all([
- fetchTacks(options),
- countTracks({
- substr: options.substr,
- genreIds: options.genreIds,
- }),
- ])
- .then(([{ data: { value: tracks } }, { data: totalItems }]) =>
- setState({
- ...state,
- tracks,
- pagination: { ...state.pagination, totalItems },
- })
- )
- .catch(handleError)
- .finally(() => setLoading(false));
- },
- DEBOUNCE_TIMER,
- DEBOUNCE_OPTIONS
- );
- const onSelectChange = (genres) => {
- setState({
- ...state,
- searchOptions: {
- ...state.searchOptions,
- genreIds: genres.map((value) => parseInt(value, 10)),
- },
- });
- };
- const onSearchChange = (event) => {
- setState({
- ...state,
- searchOptions: { ...state.searchOptions, substr: event.target.value },
- });
- };
- const onChangePage = (pageNumber) => {
- document
- .querySelector("section.ant-layout")
- .scrollTo({ top: 0, left: 0, behavior: "smooth" });
- setLoading(true);
-
- const options = {
- $top: state.pagination.pageSize,
- substr: state.searchOptions.substr,
- genreIds: state.searchOptions.genreIds,
- $skip: (pageNumber - 1) * state.pagination.pageSize,
- };
- fetchTacks(options)
- .then((response) =>
- setState({
- ...state,
- tracks: response.data.value,
- pagination: { ...state.pagination, currentPage: pageNumber },
- })
- )
- .catch(handleError)
- .finally(() => setLoading(false));
- };
- const deleteTrack = (ID) => {
- setState({
- ...state,
- tracks: state.tracks.filter(({ ID: curID }) => curID !== ID),
- });
- };
- const renderTracks = (tracks) => {
- const isEmployee = requireEmployee(user);
- const TrackComponent = isEmployee ? ManagedTrack : Track;
- return tracks.map((track) => {
- const isAlreadyOrdered = !isEmployee && track.alreadyOrdered;
- const onDeleteTrack = isEmployee && ((ID) => deleteTrack(ID));
- return (
-
-
-
- );
- });
- };
-
- const trackElements = renderTracks(state.tracks);
- const genreElements = renderGenres(state.genres);
-
- return (
- <>
-
-
-
-
-
-
- {trackElements}
-
-
-
- >
- );
-};
-
-export { TracksContainer };
diff --git a/media-store/app/src/pages/manage-store/AddAlbumForm.js b/media-store/app/src/pages/manage-store/AddAlbumForm.js
deleted file mode 100644
index 2aa219ac..00000000
--- a/media-store/app/src/pages/manage-store/AddAlbumForm.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import React, { useEffect } from "react";
-import { Form, Input, Select } from "antd";
-import { useSearch } from "@umijs/hooks";
-import { useErrors } from "../../hooks/useErrors";
-import { fetchArtistsByName } from "../../api/calls";
-
-const REQUIRED = [
- {
- required: true,
- message: "This filed is required!",
- },
-];
-const ARTISTS_LIMIT = 10;
-
-const getArtists = function (value) {
- return fetchArtistsByName(value, ARTISTS_LIMIT)
- .then((response) => response.data.value)
- .catch(this.handleError);
-};
-
-const AddAlbumForm = () => {
- const { handleError } = useErrors();
- const {
- data: artists,
- loading: isArtistsLoading,
- onChange: onChangeArtistInput,
- cancel: onArtistCancel,
- } = useSearch(getArtists.bind({ handleError }));
-
- useEffect(() => {
- onChangeArtistInput();
- }, []);
-
- return (
- <>
- Add album
-
-
-
-
-
-
- >
- );
-};
-
-export { AddAlbumForm };
diff --git a/media-store/app/src/pages/manage-store/AddArtistForm.js b/media-store/app/src/pages/manage-store/AddArtistForm.js
deleted file mode 100644
index ed31f9d6..00000000
--- a/media-store/app/src/pages/manage-store/AddArtistForm.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from "react";
-import { Form, Input } from "antd";
-
-const REQUIRED = [
- {
- required: true,
- message: "This filed is required!",
- },
-];
-
-const AddArtistForm = () => {
- return (
- <>
- Add artist
-
-
-
- >
- );
-};
-
-export { AddArtistForm };
diff --git a/media-store/app/src/pages/manage-store/TrackForm.js b/media-store/app/src/pages/manage-store/TrackForm.js
deleted file mode 100644
index 3724dc85..00000000
--- a/media-store/app/src/pages/manage-store/TrackForm.js
+++ /dev/null
@@ -1,93 +0,0 @@
-import React, { useEffect, useState } from "react";
-import { Form, Input, Select, InputNumber } from "antd";
-import { head } from "lodash";
-import { useSearch } from "@umijs/hooks";
-import { useAppState } from "../../hooks/useAppState";
-import { fetchAlbumsByName, fetchGenres } from "../../api/calls";
-import { useErrors } from "../../hooks/useErrors";
-
-const ALBUMS_LIMIT = 10;
-const REQUIRED = [
- {
- required: true,
- message: "This filed is required!",
- },
-];
-
-const getAlbums = function (value) {
- return fetchAlbumsByName(value, ALBUMS_LIMIT)
- .then((response) => response.data.value)
- .catch(this.handleError);
-};
-
-const TrackForm = ({ initialAlbumTitle }) => {
- const { handleError } = useErrors();
- const {
- data: albums,
- loading: isAlbumsLoading,
- onChange: onChangeAlbumInput,
- cancel: onAlbumCancel,
- } = useSearch(getAlbums.bind({ handleError }));
- const { setLoading } = useAppState();
- const [genres, setGenres] = useState([]);
-
- useEffect(() => {
- setLoading(true);
- Promise.all([fetchGenres(), onChangeAlbumInput(initialAlbumTitle)])
- .then((responses) => setGenres(head(responses).data.value))
- .catch(handleError)
- .finally(() => setLoading(false));
- }, []);
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- value.replace(/\$\s?|(,*)/g, "")}
- />
-
-
- );
-};
-
-export { TrackForm };
diff --git a/media-store/app/src/pages/tracks/DeleteAction.js b/media-store/app/src/pages/tracks/DeleteAction.js
deleted file mode 100644
index 34e8cd33..00000000
--- a/media-store/app/src/pages/tracks/DeleteAction.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React, { useState } from "react";
-import { Modal, message } from "antd";
-import { DeleteOutlined } from "@ant-design/icons";
-import { deleteTrack } from "../../api/calls";
-import { useErrors } from "../../hooks/useErrors";
-import { MESSAGE_TIMEOUT } from "../../util/constants";
-
-const DeleteAction = ({ ID, onDeleteTrack }) => {
- const [modalVisible, setModalVisible] = useState(false);
- const { handleError } = useErrors();
-
- const onOk = () => {
- setModalVisible(false);
- deleteTrack(ID)
- .then(() => {
- onDeleteTrack();
- setModalVisible(false);
- message.success("Track successfully deleted!", MESSAGE_TIMEOUT);
- })
- .catch(handleError);
- };
-
- const onCancel = () => setModalVisible(false);
- const onOpenModal = () => {
- setModalVisible(true);
- };
-
- return (
- <>
- Delete
-
- Are You really want to delete this track?
-
- >
- );
-};
-
-export { DeleteAction };
diff --git a/media-store/app/src/pages/tracks/EditAction.js b/media-store/app/src/pages/tracks/EditAction.js
deleted file mode 100644
index a469c018..00000000
--- a/media-store/app/src/pages/tracks/EditAction.js
+++ /dev/null
@@ -1,119 +0,0 @@
-import React from "react";
-import { Button, Modal, Form, message } from "antd";
-import { EditOutlined, LoadingOutlined } from "@ant-design/icons";
-import { useErrors } from "../../hooks/useErrors";
-import { TrackForm } from "../manage-store/TrackForm";
-import { updateTrack, getTrack } from "../../api/calls";
-import { MESSAGE_TIMEOUT } from "../../util/constants";
-
-const EditAction = ({
- ID,
- name,
- composer,
- genre,
- unitPrice,
- album,
- afterTrackUpdate,
-}) => {
- const [visible, setVisible] = React.useState(false);
- const [confirmLoading, setConfirmLoading] = React.useState(false);
- const [updateLoading, setUpdateLoading] = React.useState(false);
- const [form] = Form.useForm();
- const { handleError } = useErrors();
-
- const onShowModal = () => {
- setVisible(true);
- };
-
- const onFinish = (value) => {
- setConfirmLoading(true);
- updateTrack({
- ID,
- name: value.name,
- composer: value.composer,
- album: { ID: value.albumID },
- genre: { ID: value.genreID },
- unitPrice: value.unitPrice.toString(),
- })
- .then(() => {
- message.success("Track successfully updated!", MESSAGE_TIMEOUT);
- setConfirmLoading(false);
- setVisible(false);
- afterCloseModal();
- })
- .catch(handleError);
- };
-
- const handleOk = () => {
- form.submit();
- };
-
- const handleCancel = () => {
- setVisible(false);
- };
-
- const afterCloseModal = () => {
- setUpdateLoading(true);
- getTrack(ID)
- .then((response) => {
- afterTrackUpdate(response.data);
- setUpdateLoading(false);
- })
- .catch(handleError);
- };
-
- return (
- <>
- {updateLoading ? (
-
- ) : (
-
- )}
-
- Cancel
- ,
- ,
- ]}
- >
-
-
- >
- );
-};
-
-export { EditAction };
diff --git a/media-store/app/src/pages/tracks/ManagedTrack.css b/media-store/app/src/pages/tracks/ManagedTrack.css
deleted file mode 100644
index e2107b16..00000000
--- a/media-store/app/src/pages/tracks/ManagedTrack.css
+++ /dev/null
@@ -1,7 +0,0 @@
-span > span.anticon.anticon-delete:hover {
- color: #ff4d4f;
-}
-
-.card-element {
- transition: opacity 0.5s ease-in-out;
-}
diff --git a/media-store/app/src/pages/tracks/ManagedTrack.js b/media-store/app/src/pages/tracks/ManagedTrack.js
deleted file mode 100644
index 8beaa37c..00000000
--- a/media-store/app/src/pages/tracks/ManagedTrack.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import React, { useState, useRef } from "react";
-import { Card } from "antd";
-import { EditAction } from "./EditAction";
-import { DeleteAction } from "./DeleteAction";
-import { TrackCardBody } from "./TrackCardBody";
-import "./ManagedTrack.css";
-
-const ManagedTrack = ({ initialTrack, onDeleteTrack }) => {
- const trackElement = useRef();
- const [track, setTrack] = useState(initialTrack);
-
- return (
-
- {
- trackElement.current.style.opacity = 0;
- setTimeout(() => onDeleteTrack(track.ID), 500);
- }}
- />,
- setTrack(value)}
- />,
- ]}
- title={track.name}
- bordered={false}
- >
-
-
-
- );
-};
-
-export { ManagedTrack };
diff --git a/media-store/app/src/pages/tracks/Track.js b/media-store/app/src/pages/tracks/Track.js
deleted file mode 100644
index ff88e565..00000000
--- a/media-store/app/src/pages/tracks/Track.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import React, { useState, useRef } from "react";
-import { Card, Button } from "antd";
-import { PlusOutlined, MinusOutlined } from "@ant-design/icons";
-import { useAppState } from "../../hooks/useAppState";
-import { TrackCardBody } from "./TrackCardBody";
-
-const Track = ({ initialTrack, isAlreadyOrdered }) => {
- const trackElement = useRef();
- const { setInvoicedItems, invoicedItems } = useAppState();
- const [isJustInvoiced, setIsJustInvoiced] = useState(
- invoicedItems.find((curTrack) => curTrack.ID === initialTrack.ID)
- );
-
- const onChangedStatus = () => {
- const newIsJustInvoiced = !isJustInvoiced;
- if (newIsJustInvoiced) {
- setInvoicedItems([
- ...invoicedItems,
- {
- ID: initialTrack.ID,
- name: initialTrack.name,
- artist: initialTrack.album.artist.name,
- albumTitle: initialTrack.album.title,
- unitPrice: initialTrack.unitPrice,
- },
- ]);
- } else {
- setInvoicedItems(
- invoicedItems.filter(({ ID: curID }) => curID !== initialTrack.ID)
- );
- }
- setIsJustInvoiced(newIsJustInvoiced);
- };
-
- return (
-
-
- {!isAlreadyOrdered && (
-
- )}
- >,
- ]}
- title={initialTrack.name}
- bordered={false}
- >
-
-
-
- );
-};
-
-export { Track };
diff --git a/media-store/app/src/pages/tracks/TrackCardBody.js b/media-store/app/src/pages/tracks/TrackCardBody.js
deleted file mode 100644
index d3174e2f..00000000
--- a/media-store/app/src/pages/tracks/TrackCardBody.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from "react";
-
-const TrackCardBody = ({ track }) => {
- return (
- <>
-
- Artist:{" "}
- {track.album.artist.name}
-
-
- Album: {track.album.title}
-
-
- Genre: {track.genre.name}
-
-
- {track.composer && (
-
- Compositor:{" "}
- {track.composer}
-
- )}
-
-
-
- Price: {track.unitPrice}
-
-
- >
- );
-};
-
-export { TrackCardBody };
diff --git a/media-store/app/src/serviceWorker.js b/media-store/app/src/serviceWorker.js
deleted file mode 100644
index b04b771a..00000000
--- a/media-store/app/src/serviceWorker.js
+++ /dev/null
@@ -1,141 +0,0 @@
-// This optional code is used to register a service worker.
-// register() is not called by default.
-
-// This lets the app load faster on subsequent visits in production, and gives
-// it offline capabilities. However, it also means that developers (and users)
-// will only see deployed updates on subsequent visits to a page, after all the
-// existing tabs open on the page have been closed, since previously cached
-// resources are updated in the background.
-
-// To learn more about the benefits of this model and instructions on how to
-// opt-in, read https://bit.ly/CRA-PWA
-
-const isLocalhost = Boolean(
- window.location.hostname === 'localhost' ||
- // [::1] is the IPv6 localhost address.
- window.location.hostname === '[::1]' ||
- // 127.0.0.0/8 are considered localhost for IPv4.
- window.location.hostname.match(
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
- )
-);
-
-export function register(config) {
- if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
- // The URL constructor is available in all browsers that support SW.
- const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
- if (publicUrl.origin !== window.location.origin) {
- // Our service worker won't work if PUBLIC_URL is on a different origin
- // from what our page is served on. This might happen if a CDN is used to
- // serve assets; see https://github.com/facebook/create-react-app/issues/2374
- return;
- }
-
- window.addEventListener('load', () => {
- const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
-
- if (isLocalhost) {
- // This is running on localhost. Let's check if a service worker still exists or not.
- checkValidServiceWorker(swUrl, config);
-
- // Add some additional logging to localhost, pointing developers to the
- // service worker/PWA documentation.
- navigator.serviceWorker.ready.then(() => {
- console.log(
- 'This web app is being served cache-first by a service ' +
- 'worker. To learn more, visit https://bit.ly/CRA-PWA'
- );
- });
- } else {
- // Is not localhost. Just register service worker
- registerValidSW(swUrl, config);
- }
- });
- }
-}
-
-function registerValidSW(swUrl, config) {
- navigator.serviceWorker
- .register(swUrl)
- .then(registration => {
- registration.onupdatefound = () => {
- const installingWorker = registration.installing;
- if (installingWorker == null) {
- return;
- }
- installingWorker.onstatechange = () => {
- if (installingWorker.state === 'installed') {
- if (navigator.serviceWorker.controller) {
- // At this point, the updated precached content has been fetched,
- // but the previous service worker will still serve the older
- // content until all client tabs are closed.
- console.log(
- 'New content is available and will be used when all ' +
- 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
- );
-
- // Execute callback
- if (config && config.onUpdate) {
- config.onUpdate(registration);
- }
- } else {
- // At this point, everything has been precached.
- // It's the perfect time to display a
- // "Content is cached for offline use." message.
- console.log('Content is cached for offline use.');
-
- // Execute callback
- if (config && config.onSuccess) {
- config.onSuccess(registration);
- }
- }
- }
- };
- };
- })
- .catch(error => {
- console.error('Error during service worker registration:', error);
- });
-}
-
-function checkValidServiceWorker(swUrl, config) {
- // Check if the service worker can be found. If it can't reload the page.
- fetch(swUrl, {
- headers: { 'Service-Worker': 'script' },
- })
- .then(response => {
- // Ensure service worker exists, and that we really are getting a JS file.
- const contentType = response.headers.get('content-type');
- if (
- response.status === 404 ||
- (contentType != null && contentType.indexOf('javascript') === -1)
- ) {
- // No service worker found. Probably a different app. Reload the page.
- navigator.serviceWorker.ready.then(registration => {
- registration.unregister().then(() => {
- window.location.reload();
- });
- });
- } else {
- // Service worker found. Proceed as normal.
- registerValidSW(swUrl, config);
- }
- })
- .catch(() => {
- console.log(
- 'No internet connection found. App is running in offline mode.'
- );
- });
-}
-
-export function unregister() {
- if ('serviceWorker' in navigator) {
- navigator.serviceWorker.ready
- .then(registration => {
- registration.unregister();
- })
- .catch(error => {
- console.error(error.message);
- });
- }
-}
diff --git a/media-store/app/src/setupTests.js b/media-store/app/src/setupTests.js
deleted file mode 100644
index 74b1a275..00000000
--- a/media-store/app/src/setupTests.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// jest-dom adds custom jest matchers for asserting on DOM nodes.
-// allows you to do things like:
-// expect(element).toHaveTextContent(/react/i)
-// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom/extend-expect';
diff --git a/media-store/app/src/util/EventEmitter.js b/media-store/app/src/util/EventEmitter.js
deleted file mode 100644
index 370e9777..00000000
--- a/media-store/app/src/util/EventEmitter.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import EventEmitter from "events";
-
-const emitter = new EventEmitter();
-
-export { emitter };
diff --git a/media-store/app/src/util/constants.js b/media-store/app/src/util/constants.js
deleted file mode 100644
index c844c903..00000000
--- a/media-store/app/src/util/constants.js
+++ /dev/null
@@ -1,14 +0,0 @@
-export const AVAILABLE_LOCALES = ["en", "fr", "de"];
-
-export const MESSAGE_TIMEOUT = 2;
-
-// in dev mode using provided api
-// in prod mode using proxy
-export const API =
- process.env.NODE_ENV === "development" ? "http://localhost:4004/" : "api/";
-
-export const requireEmployee = (user) =>
- !!user && user.roles.includes("employee");
-
-export const requireCustomer = (user) =>
- !!user && user.roles.includes("customer");
diff --git a/media-store/app/src/util/localStorageService.js b/media-store/app/src/util/localStorageService.js
deleted file mode 100644
index 2f0fca17..00000000
--- a/media-store/app/src/util/localStorageService.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import { isValidUser } from "./validateUser";
-import { AVAILABLE_LOCALES } from "./constants";
-
-const setUserToLS = (user) => {
- if (user) {
- localStorage.setItem("user", JSON.stringify(user));
- } else {
- localStorage.removeItem("user");
- }
-};
-
-const getUserFromLS = () => {
- let userFromLS;
- try {
- userFromLS = JSON.parse(localStorage.getItem("user"));
- if (isValidUser(userFromLS)) {
- return userFromLS;
- }
- } catch (e) {}
-};
-
-const getLocaleFromLS = () => {
- const localeFromLS = localStorage.getItem("locale");
- return localeFromLS &&
- localeFromLS !== "undefined" &&
- AVAILABLE_LOCALES.includes(localeFromLS)
- ? localeFromLS
- : "en";
-};
-
-const setLocaleToLS = (locale) => {
- localStorage.setItem("locale", locale);
-};
-
-export { setLocaleToLS, getLocaleFromLS, getUserFromLS, setUserToLS };
diff --git a/media-store/app/src/util/validateUser.js b/media-store/app/src/util/validateUser.js
deleted file mode 100644
index 160740b8..00000000
--- a/media-store/app/src/util/validateUser.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import { isArray, isEmpty, isString, isNumber } from "lodash";
-
-const CUSTOMER_ROLE = "customer";
-const EMPLOYEE_ROLE = "employee";
-
-const isValidUser = (user) => {
- return (
- !isEmpty(user) &&
- isNumber(user.ID) &&
- isArray(user.roles) &&
- !!user.roles.some(
- (role) => role === CUSTOMER_ROLE || role === EMPLOYEE_ROLE
- ) &&
- isString(user.email) &&
- isString(user.accessToken) &&
- isString(user.refreshToken)
- );
-};
-
-export { isValidUser };
diff --git a/media-store/app/xs-app.json b/media-store/app/xs-app.json
deleted file mode 100644
index 930c40ee..00000000
--- a/media-store/app/xs-app.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "welcomeFile": "/index.html",
- "routes": [
- {
- "source": "^(.*)",
- "target": "$1",
- "service": "html5-apps-repo-rt"
- }
- ]
-}
\ No newline at end of file
diff --git a/media-store/approuter/package.json b/media-store/approuter/package.json
deleted file mode 100644
index d9a4cd89..00000000
--- a/media-store/approuter/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "media-store-approuter",
- "description": "Approuter",
- "version": "1.0.0",
- "dependencies": {
- "@sap/approuter": "^6.8.2"
- },
- "scripts": {
- "start": "node node_modules/@sap/approuter/approuter.js"
- }
-}
diff --git a/media-store/approuter/xs-app.json b/media-store/approuter/xs-app.json
deleted file mode 100644
index 4270e0cb..00000000
--- a/media-store/approuter/xs-app.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "welcomeFile": "/index.html",
- "authenticationMethod": "none",
- "routes": [
- {
- "source": "/api/(.*)",
- "target": "$1",
- "destination": "srv-binding",
- "authenticationType": "none"
- },
- {
- "source": "^(.*)",
- "target": "mediastore/$1",
- "service": "html5-apps-repo-rt"
- }
- ]
-}
diff --git a/media-store/html5Deployer/package.json b/media-store/html5Deployer/package.json
deleted file mode 100644
index 09f597b2..00000000
--- a/media-store/html5Deployer/package.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "name": "media-store-html5deployer",
- "engines": {
- "node": ">=6.0.0"
- },
- "dependencies": {
- "@sap/html5-app-deployer": "^2.0.0"
- },
- "scripts": {
- "start": "node node_modules/@sap/html5-app-deployer/index.js"
- }
-}