Skip to content

Commit

Permalink
Restructured helpers folder
Browse files Browse the repository at this point in the history
  • Loading branch information
davewalker5 committed Dec 3, 2023
1 parent 5a295cd commit 22b350c
Show file tree
Hide file tree
Showing 38 changed files with 47 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/components/albums/albumEditor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styles from "./albumEditor.module.css";
import pages from "@/helpers/navigation";
import FormInputField from "../common/formInputField";
import { apiCreateAlbum, apiUpdateAlbum } from "@/helpers/apiAlbums";
import { apiCreateAlbum, apiUpdateAlbum } from "@/helpers/api/apiAlbums";
import { useState, useCallback } from "react";
import GenreSelector from "../genres/genreSelector";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState, useCallback } from "react";
import CurrencyInput from "react-currency-input-field";
import config from "@/config.json";
import pages from "@/helpers/navigation";
import { apiSetAlbumPurchaseDetails } from "@/helpers/apiAlbums";
import { apiSetAlbumPurchaseDetails } from "@/helpers/api/apiAlbums";
import RetailerSelector from "../retailers/retailerSelector";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import {
apiSetAlbumWishListFlag,
apiFetchAlbumsByArtist,
} from "@/helpers/apiAlbums";
} from "@/helpers/api/apiAlbums";

/**
* Icon and associated action to move an album between the catalogue and wish list
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { useCallback } from "react";
import { apiDeleteAlbum, apiFetchAlbumsByArtist } from "@/helpers/apiAlbums";
import {
apiDeleteAlbum,
apiFetchAlbumsByArtist,
} from "@/helpers/api/apiAlbums";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faTrashAlt } from "@fortawesome/free-solid-svg-icons";

Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback, useState } from "react";
import Login from "./login/login";
import pages from "@/helpers/navigation";
import ComponentPicker from "./componentPicker";
import { apiClearToken } from "@/helpers/apiToken";
import { apiClearToken } from "@/helpers/api/apiToken";
import useIsLoggedIn from "@/hooks/useIsLoggedIn";
import MenuBar from "./menuBar";
import { clearStorageValue } from "@/helpers/storage";
Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/components/artists/artistEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styles from "./artistEditor.module.css";
import pages from "@/helpers/navigation";
import FormInputField from "../common/formInputField";
import { useState, useCallback } from "react";
import { apiCreateArtist, apiUpdateArtist } from "@/helpers/apiArtists";
import { apiCreateArtist, apiUpdateArtist } from "@/helpers/api/apiArtists";

/**
* Component to render the artist editor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback } from "react";
import { apiDeleteArtist, apiFetchArtists } from "@/helpers/apiArtists";
import { apiDeleteArtist, apiFetchArtists } from "@/helpers/api/apiArtists";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faTrashAlt } from "@fortawesome/free-solid-svg-icons";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styles from "./export.module.css";
import { useCallback, useState } from "react";
import { apiRequestCatalogueExport } from "@/helpers/apiDataExchange";
import { apiRequestCatalogueExport } from "@/helpers/api/apiDataExchange";
import FormInputField from "../common/formInputField";

/**
Expand Down
6 changes: 3 additions & 3 deletions src/music-catalogue-ui/components/login/login.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import styles from "./login.module.css";
import secrets from "@/helpers/secrets";
import { React, useState, useCallback } from "react";
import { apiAuthenticate } from "@/helpers/apiAuthenticate";
import { apiSetToken } from "@/helpers/apiToken";
import { apiFetchSecret } from "@/helpers/apiSecrets";
import { apiAuthenticate } from "@/helpers/api/apiAuthenticate";
import { apiSetToken } from "@/helpers/api/apiToken";
import { apiFetchSecret } from "@/helpers/api/apiSecrets";
import { setStorageValue } from "@/helpers/storage";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React, { useCallback, useState } from "react";
import styles from "@/components/reports/reports.module.css";
import catalogues from "@/helpers/catalogues";
import "react-datepicker/dist/react-datepicker.css";
import { apiArtistStatisticsReport } from "@/helpers/apiReports";
import { apiArtistStatisticsReport } from "@/helpers/api/apiReports";
import ArtistStatisticsRow from "./artistStatisticsRow";
import ReportExportControls from "./reportExportControls";
import { apiRequestAristStatisticsExport } from "@/helpers/apiDataExchange";
import { apiRequestAristStatisticsExport } from "@/helpers/api/apiDataExchange";
import CatalogueSelector from "../common/catalogueSelector";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React, { useCallback, useState } from "react";
import styles from "./reports.module.css";
import catalogues from "@/helpers/catalogues";
import "react-datepicker/dist/react-datepicker.css";
import { apiGenreStatisticsReport } from "@/helpers/apiReports";
import { apiGenreStatisticsReport } from "@/helpers/api/apiReports";
import GenreStatisticsRow from "./genreStatisticsRow";
import ReportExportControls from "./reportExportControls";
import { apiRequestGenreStatisticsExport } from "@/helpers/apiDataExchange";
import { apiRequestGenreStatisticsExport } from "@/helpers/api/apiDataExchange";
import CatalogueSelector from "../common/catalogueSelector";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback, useState } from "react";
import styles from "@/components/reports/reports.module.css";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { apiJobStatusReport } from "@/helpers/apiReports";
import { apiJobStatusReport } from "@/helpers/api/apiReports";
import JobStatusRow from "./jobStatusRow";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styles from "@/components/reports/reports.module.css";
import useMonthlySpend from "@/hooks/useMonthlySpend";
import MonthlySpendReportRow from "./monthlySpendReportRow";
import ReportExportControls from "./reportExportControls";
import { apiRequestMonthlySpendingExport } from "@/helpers/apiDataExchange";
import { apiRequestMonthlySpendingExport } from "@/helpers/api/apiDataExchange";

/**
* Component to display the monthly spending report page and its results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React, { useCallback, useState } from "react";
import styles from "@/components/reports/reports.module.css";
import catalogues from "@/helpers/catalogues";
import "react-datepicker/dist/react-datepicker.css";
import { apiRetailerStatisticsReport } from "@/helpers/apiReports";
import { apiRetailerStatisticsReport } from "@/helpers/api/apiReports";
import RetailerStatisticsRow from "./retailerStatisticsRow";
import ReportExportControls from "./reportExportControls";
import { apiRequestRetailerStatisticsExport } from "@/helpers/apiDataExchange";
import { apiRequestRetailerStatisticsExport } from "@/helpers/api/apiDataExchange";
import CatalogueSelector from "../common/catalogueSelector";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { useCallback } from "react";
import { apiDeleteRetailer, apiFetchRetailers } from "@/helpers/apiRetailers";
import {
apiDeleteRetailer,
apiFetchRetailers,
} from "@/helpers/api/apiRetailers";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faTrashAlt } from "@fortawesome/free-solid-svg-icons";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import styles from "./retailerEditor.module.css";
import pages from "@/helpers/navigation";
import { useState, useCallback } from "react";
import { apiCreateRetailer, apiUpdateRetailer } from "@/helpers/apiRetailers";
import {
apiCreateRetailer,
apiUpdateRetailer,
} from "@/helpers/api/apiRetailers";
import FormInputField from "../common/formInputField";
import { geocodeAddress } from "@/helpers/geocoder";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
Expand Down
4 changes: 2 additions & 2 deletions src/music-catalogue-ui/components/search/lookupAlbum.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import styles from "./lookupAlbum.module.css";
import pages from "@/helpers/navigation";
import { useCallback, useState } from "react";
import { apiFetchArtistById } from "@/helpers/apiArtists";
import { apiLookupAlbum } from "@/helpers/apiAlbums";
import { apiFetchArtistById } from "@/helpers/api/apiArtists";
import { apiLookupAlbum } from "@/helpers/api/apiAlbums";
import Select from "react-select";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { apiDeleteTrack } from "@/helpers/apiTracks";
import { apiFetchAlbumById } from "@/helpers/apiAlbums";
import { apiDeleteTrack } from "@/helpers/api/apiTracks";
import { apiFetchAlbumById } from "@/helpers/api/apiAlbums";
import { useCallback } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faTrashAlt } from "@fortawesome/free-solid-svg-icons";
Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/components/tracks/trackEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styles from "./trackEditor.module.css";
import pages from "@/helpers/navigation";
import FormInputField from "../common/formInputField";
import { useState, useCallback } from "react";
import { apiCreateTrack, apiUpdateTrack } from "@/helpers/apiTracks";
import { apiCreateTrack, apiUpdateTrack } from "@/helpers/api/apiTracks";

/**
* Component to render the track details editor
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { setStorageValue, getStorageValue, clearStorageValue } from "./storage";
import {
setStorageValue,
getStorageValue,
clearStorageValue,
} from "../storage";

/**
* Store the JWT token
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/hooks/useAlbums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { apiFetchAlbumsByArtist } from "@/helpers/apiAlbums";
import { apiFetchAlbumsByArtist } from "@/helpers/api/apiAlbums";

/**
* Hook that uses the API helpers to retrieve a list of albums by the specified
Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/hooks/useArtists.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { apiFetchArtists } from "@/helpers/apiArtists";
import { apiFetchArtists } from "@/helpers/api/apiArtists";

/**
* Hook that uses the API helpers to retrieve a list of artists from the
Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/hooks/useGenres.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { apiFetchGenres } from "@/helpers/apiGenres";
import { apiFetchGenres } from "@/helpers/api/apiGenres";

/**
* Hook that uses the API helpers to retrieve a list of genres from the
Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/hooks/useIsLoggedIn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { apiGetToken } from "@/helpers/apiToken";
import { apiGetToken } from "@/helpers/api/apiToken";
import { useState, useEffect } from "react";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/hooks/useMonthlySpend.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { apiMonthlySpendReport } from "@/helpers/apiReports";
import { apiMonthlySpendReport } from "@/helpers/api/apiReports";

/**
* Hook that uses the API helpers to retrieve a list of artists from the
Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/hooks/useRetailers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { apiFetchRetailers } from "@/helpers/apiRetailers";
import { apiFetchRetailers } from "@/helpers/api/apiRetailers";
import { useState, useEffect } from "react";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/music-catalogue-ui/hooks/useTracks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { apiFetchAlbumById } from "@/helpers/apiAlbums";
import { apiFetchAlbumById } from "@/helpers/api/apiAlbums";

/**
* Hook that uses the API helpers to retrieve a list of tracks for the
Expand Down

0 comments on commit 22b350c

Please sign in to comment.