Skip to content

Commit

Permalink
Lint + fix the application
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamik10 committed Dec 28, 2024
1 parent b7a7d6d commit 1a40807
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/apps/advanced-search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const advancedSearchIndexTranslations = {
"term.isbn": "advancedSearchIdentifierText"
} as const;

export type AdvancedSearchIndex = typeof advancedSearchIndexes[number];
export type AdvancedSearchIndex = (typeof advancedSearchIndexes)[number];

export type AdvancedSearchClause = {
value: "AND" | "OR" | "NOT";
Expand Down
4 changes: 2 additions & 2 deletions src/components/material/MaterialHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ const MaterialHeader: React.FC<MaterialHeaderProps> = ({
);
};
const author = creatorsToString(flattenCreators(creators), t);
const containsDanish = mainLanguages.some((language) =>
language?.isoCode.toLowerCase().includes("dan")
const containsDanish = mainLanguages.some(
(language) => language?.isoCode.toLowerCase().includes("dan")
);
const allLanguages = mainLanguages
.map((language) => language.display)
Expand Down
2 changes: 1 addition & 1 deletion src/core/dbc-gateway/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { beforeAll, vi } from "vitest";
import { getServiceBaseUrl } from "../utils/reduxMiddleware/extractServiceBaseUrls";
import queryMap from "./queryMap";

type Baseurl = typeof queryMap[keyof typeof queryMap];
type Baseurl = (typeof queryMap)[keyof typeof queryMap];

export const resolveBaseUrl = (query?: string) => {
if (!query) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ul>
*/
export type AuthenticatedPatronV6AuthenticateStatus =
typeof AuthenticatedPatronV6AuthenticateStatus[keyof typeof AuthenticatedPatronV6AuthenticateStatus];
(typeof AuthenticatedPatronV6AuthenticateStatus)[keyof typeof AuthenticatedPatronV6AuthenticateStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AuthenticatedPatronV6AuthenticateStatus = {
Expand Down
2 changes: 1 addition & 1 deletion src/core/publizon/model/apiResponseCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Orders/loans created in test environment will not be invoiced. Please request a
* 101 = Success, 105 = InvalidContentIdentifier, 118 = InvalidRequestIdentity, 120 = MaxConcurrentLoansPerBorrowerExceeded, 125 = MaxAmountPerMonthExceeded, 128 = ContentNotFound, 131 = NotLoanable, 134 = CardTemporarilyBlocked, 135 = MaxLoansOnTitleReached, 136 = InsufficientCopiesException, 137 = ReservationLimitReached, 138 = GenericFault, 139 = InvalidAgreement, 140 = AlreadyReserved, 141 = InvalidEmail, 142 = InvalidPhone, 143 = CostFreeLimitReached, 147 = CountryNotFound, 148 = InvalidInstitutionId, 149 = InvalidCardFormat, 150 = InvalidCardByCulr, 151 = CardNotFound, 152 = InvalidClientId, 153 = LoanNotFound
*/
export type ApiResponseCode =
typeof ApiResponseCode[keyof typeof ApiResponseCode];
(typeof ApiResponseCode)[keyof typeof ApiResponseCode];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ApiResponseCode = {
Expand Down
2 changes: 1 addition & 1 deletion src/core/publizon/model/bookTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Orders/loans created in test environment will not be invoiced. Please request a
/**
* 0 = Ebook, 1 = Audio
*/
export type BookTypes = typeof BookTypes[keyof typeof BookTypes];
export type BookTypes = (typeof BookTypes)[keyof typeof BookTypes];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const BookTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/core/publizon/model/contentLoanStatusEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Orders/loans created in test environment will not be invoiced. Please request a
*/

export type ContentLoanStatusEnum =
typeof ContentLoanStatusEnum[keyof typeof ContentLoanStatusEnum];
(typeof ContentLoanStatusEnum)[keyof typeof ContentLoanStatusEnum];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ContentLoanStatusEnum = {
Expand Down
2 changes: 1 addition & 1 deletion src/core/publizon/model/fileExtensionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Orders/loans created in test environment will not be invoiced. Please request a
*/

export type FileExtensionType =
typeof FileExtensionType[keyof typeof FileExtensionType];
(typeof FileExtensionType)[keyof typeof FileExtensionType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const FileExtensionType = {
Expand Down
2 changes: 1 addition & 1 deletion src/core/publizon/model/identifierTypeEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Orders/loans created in test environment will not be invoiced. Please request a
*/

export type IdentifierTypeEnum =
typeof IdentifierTypeEnum[keyof typeof IdentifierTypeEnum];
(typeof IdentifierTypeEnum)[keyof typeof IdentifierTypeEnum];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const IdentifierTypeEnum = {
Expand Down
5 changes: 3 additions & 2 deletions src/core/utils/useReservableFromAnotherLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ const useReservableFromAnotherLibrary = (
}

const reservablePidsFromAnotherLibrary = manifestations
.filter(({ catalogueCodes }) =>
catalogueCodes?.otherCatalogues.some((code) => code.startsWith("OVE"))
.filter(
({ catalogueCodes }) =>
catalogueCodes?.otherCatalogues.some((code) => code.startsWith("OVE"))
)
.map(({ pid }) => pid);

Expand Down
19 changes: 9 additions & 10 deletions src/core/utils/withFocusTrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import React, { FC } from "react";
export default <P extends object>(
Component: React.ComponentType<P>
): FC<P & { withFocusTrap?: boolean }> =>
({ withFocusTrap, ...props }) =>
(
<FocusTrap
focusTrapOptions={{
allowOutsideClick: true
}}
>
<Component {...(props as P)} />
</FocusTrap>
);
({ withFocusTrap, ...props }) => (
<FocusTrap
focusTrapOptions={{
allowOutsideClick: true
}}
>
<Component {...(props as P)} />
</FocusTrap>
);

0 comments on commit 1a40807

Please sign in to comment.