Skip to content

Commit 79d22bf

Browse files
committed
chore: remove unused auth hooks, types, and dead code
- Remove useAuthorization hook and Authorization type - Remove useIsAuthorizationReady hook (marked todo for removal) - Remove API_TOKEN_ACTIONS constant (marked todo for deletion) - Remove unused EventInList type from event/types.ts - Remove unused OldVenueDataFields type from venue/types.ts - Unexport internal CMS language entry constants Refs: PT-2015
1 parent 5bc0d40 commit 79d22bf

6 files changed

Lines changed: 4 additions & 96 deletions

File tree

src/domain/auth/constants.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ import { LoginProviderProps } from 'hds-react';
22

33
import AppConfig from '../app/AppConfig';
44

5-
// todo: delete this when new login implemented
6-
export const API_TOKEN_ACTIONS = {
7-
FETCH_TOKEN_ERROR: 'FETCH_TOKEN_ERROR',
8-
FETCH_TOKEN_SUCCESS: 'FETCH_TOKEN_SUCCESS',
9-
RESET_API_TOKEN_DATA: 'RESET_API_TOKEN_DATA',
10-
START_FETCHING_TOKEN: 'START_FETCHING_TOKEN',
11-
TOKEN_FETCHED: 'TOKEN_FETCHED',
12-
};
13-
145
const providerPropertiesBase: LoginProviderProps = {
156
userManagerSettings: {
167
authority: AppConfig.oidcAuthority,

src/domain/auth/useAuthorization.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/domain/auth/useIsAuthorizationReady.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/domain/event/types.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import { Event, Image, LocalisedObject } from '../../generated/graphql';
2-
3-
export type EventInList = Pick<Event, 'id' | 'startTime' | 'endTime'> & {
4-
images: Array<Pick<Image, 'id' | 'name' | 'url'>>;
5-
name: LocalisedObject;
6-
};
1+
import { LocalisedObject } from '../../generated/graphql';
72

83
export interface CreateEventFormFields {
94
audience: string[];

src/domain/languages/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
LanguageCodeEnum,
44
} from '@city-of-helsinki/react-helsinki-headless-cms';
55

6-
export const CMS_FINNISH_LANGUAGE_ENTRY = {
6+
const CMS_FINNISH_LANGUAGE_ENTRY = {
77
code: LanguageCodeEnum.Fi,
88
id: 'TGFuZ3VhZ2U6Zmk=',
99
locale: 'fi',
@@ -12,7 +12,7 @@ export const CMS_FINNISH_LANGUAGE_ENTRY = {
1212
__typename: 'Language',
1313
} as const satisfies Language;
1414

15-
export const CMS_ENGLISH_LANGUAGE_ENTRY = {
15+
const CMS_ENGLISH_LANGUAGE_ENTRY = {
1616
code: LanguageCodeEnum.En,
1717
id: 'TGFuZ3VhZ2U6ZW4=',
1818
locale: 'en_US',
@@ -21,7 +21,7 @@ export const CMS_ENGLISH_LANGUAGE_ENTRY = {
2121
__typename: 'Language',
2222
} as const satisfies Language;
2323

24-
export const CMS_SWEDISH_LANGUAGE_ENTRY = {
24+
const CMS_SWEDISH_LANGUAGE_ENTRY = {
2525
code: LanguageCodeEnum.Sv,
2626
id: 'TGFuZ3VhZ2U6c3Y=',
2727
locale: 'sv_SE',

src/domain/venue/types.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
import { LocalisedObjectInput } from '../../generated/graphql';
22

3-
export type OldVenueDataFields = {
4-
locationDescription: LocalisedObjectInput;
5-
hasClothingStorage: boolean;
6-
hasSnackEatingPlace: boolean;
7-
outdoorActivity: boolean;
8-
hasToiletNearby: boolean;
9-
hasAreaForGroupWork: boolean;
10-
hasIndoorPlayingArea: boolean;
11-
hasOutdoorPlayingArea: boolean;
12-
};
13-
143
export type VenueDataFields = {
154
locationDescription: LocalisedObjectInput;
165
hasClothingStorage: boolean;

0 commit comments

Comments
 (0)