fansunited-widget-sports-data 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/components/Main.d.ts +14 -0
- package/components/MainLayout.d.ts +9 -0
- package/components/SportData/AssetsSection.d.ts +41 -0
- package/components/SportData/BrandingSection.d.ts +31 -0
- package/components/SportData/CatalogueScopeTabs.d.ts +17 -0
- package/components/SportData/CopyableId.d.ts +9 -0
- package/components/SportData/EntitiesTable.d.ts +40 -0
- package/components/SportData/EntityBanner.d.ts +19 -0
- package/components/SportData/EntityEditor.d.ts +27 -0
- package/components/SportData/EntityTypeTabs.d.ts +9 -0
- package/components/SportData/GeneralSection.d.ts +13 -0
- package/components/SportData/JsonDrawer.d.ts +27 -0
- package/components/SportData/ListPagination.d.ts +20 -0
- package/components/SportData/ListToolbar.d.ts +19 -0
- package/components/SportData/OverrideConfirmModal.d.ts +27 -0
- package/components/SportData/RelatedSection.d.ts +36 -0
- package/components/SportData/RemoveButton.d.ts +20 -0
- package/components/SportData/RemoveOverrideModal.d.ts +23 -0
- package/components/SportData/RowListSection.d.ts +38 -0
- package/components/SportData/SaveStatus.d.ts +16 -0
- package/components/SportData/ScopeNote.d.ts +17 -0
- package/components/SportData/SearchIndexPanel.d.ts +63 -0
- package/components/SportData/SeasonHistorySection.d.ts +49 -0
- package/components/SportData/SelectionStrip.d.ts +20 -0
- package/components/SportData/SocialsSection.d.ts +17 -0
- package/components/SportData/SportDataPage.d.ts +44 -0
- package/components/SportData/TranslationsSection.d.ts +31 -0
- package/constants/constants.d.ts +134 -0
- package/constants/languages.d.ts +21 -0
- package/constants/styles.d.ts +16 -0
- package/context/LabelsContext.d.ts +8 -0
- package/context/RolesContext.d.ts +29 -0
- package/helpers/assets.d.ts +45 -0
- package/helpers/branding.d.ts +54 -0
- package/helpers/deviations.d.ts +11 -0
- package/helpers/entityFields.d.ts +88 -0
- package/helpers/entitySections.d.ts +36 -0
- package/helpers/labels.d.ts +10 -0
- package/helpers/pagination.d.ts +24 -0
- package/helpers/related.d.ts +45 -0
- package/helpers/roles.d.ts +46 -0
- package/helpers/seasonHistory.d.ts +27 -0
- package/helpers/socials.d.ts +19 -0
- package/helpers/sportEntity.d.ts +64 -0
- package/helpers/translations.d.ts +43 -0
- package/hooks/useClientOverrideIds.d.ts +17 -0
- package/hooks/useConstantContext.d.ts +2 -0
- package/hooks/useCountries.d.ts +14 -0
- package/hooks/useDebouncedValue.d.ts +7 -0
- package/hooks/useResolvedEntities.d.ts +15 -0
- package/hooks/useSportEntities.d.ts +33 -0
- package/hooks/useSportEntitiesService.d.ts +9 -0
- package/hooks/useSportEntity.d.ts +20 -0
- package/index.d.ts +1 -0
- package/models/Labels/LabelsModel.d.ts +204 -0
- package/package.json +8 -0
- package/services/SportEntitiesService.d.ts +159 -0
- package/sports-data-manager.es.d.ts +2 -0
- package/sports-data-manager.es.js +89424 -0
- package/sports-data-manager.umd.js +3714 -0
- package/style.css +6 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Documentation about the widget
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as LabelsModel } from '../models/Labels/LabelsModel';
|
|
3
|
+
type MainProps = {
|
|
4
|
+
fansUnitedApiKey: string;
|
|
5
|
+
fansUnitedClientId: string;
|
|
6
|
+
/** Display name for the client. Falls back to the client id when omitted. */
|
|
7
|
+
fansUnitedClientName?: string;
|
|
8
|
+
fansUnitedLanguage?: string;
|
|
9
|
+
fansUnitedEnvironment?: string;
|
|
10
|
+
labels?: LabelsModel;
|
|
11
|
+
hideSignOutButton?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const Main: React.FC<MainProps>;
|
|
14
|
+
export default Main;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type MainLayoutProps = {
|
|
3
|
+
hideSignOutButton: boolean;
|
|
4
|
+
fansUnitedEnvironment: string;
|
|
5
|
+
fansUnitedClientId: string;
|
|
6
|
+
fansUnitedClientName?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const MainLayout: React.FC<MainLayoutProps>;
|
|
9
|
+
export default MainLayout;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AssetRow, AssetSlot } from '../../helpers/assets';
|
|
3
|
+
export type AssetLabels = {
|
|
4
|
+
uploadedChip: string;
|
|
5
|
+
externalChip: string;
|
|
6
|
+
replace: string;
|
|
7
|
+
remove: string;
|
|
8
|
+
chooseFile: string;
|
|
9
|
+
dropHere: string;
|
|
10
|
+
useExternalUrl: string;
|
|
11
|
+
externalUrlPlaceholder: string;
|
|
12
|
+
saveUrl: string;
|
|
13
|
+
cancel: string;
|
|
14
|
+
storedPathNote: string;
|
|
15
|
+
externalUrlNote: string;
|
|
16
|
+
uploading: string;
|
|
17
|
+
};
|
|
18
|
+
type AssetsSectionProps = {
|
|
19
|
+
assets: AssetRow[];
|
|
20
|
+
slots: AssetSlot[];
|
|
21
|
+
readOnly: boolean;
|
|
22
|
+
labels: AssetLabels;
|
|
23
|
+
summary: string;
|
|
24
|
+
onUpload: (file: File, assetKey: string) => Promise<{
|
|
25
|
+
path: string;
|
|
26
|
+
url: string;
|
|
27
|
+
}>;
|
|
28
|
+
onChange: (assets: AssetRow[]) => void;
|
|
29
|
+
onError: (message: string) => void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Images for an entity, one card per slot the type offers.
|
|
33
|
+
*
|
|
34
|
+
* Two ways in, and they store different things. An uploaded file goes through
|
|
35
|
+
* the proxy into Cloud Storage and is stored as a CDN-relative path; an external
|
|
36
|
+
* URL is stored verbatim and stays hosted wherever it already lives. The chip on
|
|
37
|
+
* each card says which of the two it is, because that is the difference between
|
|
38
|
+
* an image we control and one that can disappear without warning.
|
|
39
|
+
*/
|
|
40
|
+
declare const AssetsSection: React.FC<AssetsSectionProps>;
|
|
41
|
+
export default AssetsSection;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BrandColorSlot, ShirtColors } from '../../helpers/branding';
|
|
3
|
+
export type BrandingLabels = {
|
|
4
|
+
notSet: string;
|
|
5
|
+
clear: string;
|
|
6
|
+
shirtColorsHeading: string;
|
|
7
|
+
addShirt: string;
|
|
8
|
+
removeShirt: string;
|
|
9
|
+
shirtPrimary: string;
|
|
10
|
+
shirtSecondary: string;
|
|
11
|
+
summary: string;
|
|
12
|
+
};
|
|
13
|
+
type BrandingSectionProps = {
|
|
14
|
+
branding: Record<string, unknown>;
|
|
15
|
+
colorSlots: BrandColorSlot[];
|
|
16
|
+
shirts: ShirtColors[];
|
|
17
|
+
showShirts: boolean;
|
|
18
|
+
readOnly: boolean;
|
|
19
|
+
labels: BrandingLabels;
|
|
20
|
+
onColorChange: (key: string, value: string | null) => void;
|
|
21
|
+
onShirtsChange: (shirts: ShirtColors[]) => void;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Brand colours for an entity, and a team's kit colours.
|
|
25
|
+
*
|
|
26
|
+
* The colours are not decoration inside this widget either - `avatarColorOf`
|
|
27
|
+
* renders every row's avatar on the primary colour, so what is set here is
|
|
28
|
+
* visible in the list the moment it is saved.
|
|
29
|
+
*/
|
|
30
|
+
declare const BrandingSection: React.FC<BrandingSectionProps>;
|
|
31
|
+
export default BrandingSection;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Which index the list is reading: the shared catalogue, or one client's overlay. */
|
|
3
|
+
export type CatalogueScope = 'global' | 'overrides';
|
|
4
|
+
type CatalogueScopeTabsProps = {
|
|
5
|
+
value: CatalogueScope;
|
|
6
|
+
globalLabel: string;
|
|
7
|
+
overridesLabel: string;
|
|
8
|
+
onChange: (scope: CatalogueScope) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Global catalogue / overrides switch.
|
|
12
|
+
*
|
|
13
|
+
* This is the control that decides whether reads and writes carry a `clientId`,
|
|
14
|
+
* so it is the visible form of the rule that `null` means the global catalogue.
|
|
15
|
+
*/
|
|
16
|
+
declare const CatalogueScopeTabs: React.FC<CatalogueScopeTabsProps>;
|
|
17
|
+
export default CatalogueScopeTabs;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type CopyableIdProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
copyLabel: string;
|
|
5
|
+
copiedLabel: string;
|
|
6
|
+
};
|
|
7
|
+
/** An entity id that copies itself, used wherever an id is shown. */
|
|
8
|
+
declare const CopyableId: React.FC<CopyableIdProps>;
|
|
9
|
+
export default CopyableId;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IkebanaEntity } from 'fansunited-management-components';
|
|
3
|
+
import { CountryRef } from '../../services/SportEntitiesService';
|
|
4
|
+
export type RowAction = {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
variant: 'solid' | 'outlined' | 'plain';
|
|
8
|
+
color: 'primary' | 'neutral' | 'warning' | 'danger';
|
|
9
|
+
onClick: (entity: IkebanaEntity) => void;
|
|
10
|
+
};
|
|
11
|
+
type EntitiesTableProps = {
|
|
12
|
+
entities: IkebanaEntity[];
|
|
13
|
+
countries: Map<string, CountryRef>;
|
|
14
|
+
actionsFor: (entity: IkebanaEntity) => RowAction[];
|
|
15
|
+
onOpen: (entity: IkebanaEntity) => void;
|
|
16
|
+
/** Bulk-override selection. Hidden outside the global catalogue, which is the
|
|
17
|
+
only scope where creating an override makes sense. */
|
|
18
|
+
showSelect: boolean;
|
|
19
|
+
selectedIds: Record<string, boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Entities this client already overrides. Badged, and not selectable - creating
|
|
22
|
+
* a second override for the same id would just overwrite the first.
|
|
23
|
+
*/
|
|
24
|
+
overriddenIds: Set<string>;
|
|
25
|
+
/** Badge copy, and its tooltip. Only shown while browsing the global catalogue. */
|
|
26
|
+
overriddenLabel: string;
|
|
27
|
+
overriddenTitle: string;
|
|
28
|
+
showOverriddenBadge: boolean;
|
|
29
|
+
onToggleSelect: (id: string) => void;
|
|
30
|
+
onToggleSelectAll: () => void;
|
|
31
|
+
nameColumn: string;
|
|
32
|
+
countryColumn: string;
|
|
33
|
+
actionsColumn: string;
|
|
34
|
+
notAvailableLabel: string;
|
|
35
|
+
copyIdLabel: string;
|
|
36
|
+
copiedIdLabel: string;
|
|
37
|
+
emptyMessage: string;
|
|
38
|
+
};
|
|
39
|
+
declare const EntitiesTable: React.FC<EntitiesTableProps>;
|
|
40
|
+
export default EntitiesTable;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ColorPaletteProp } from '@mui/joy/styles';
|
|
3
|
+
export type BannerIcon = 'global' | 'overrides' | 'readOnly' | 'new';
|
|
4
|
+
type EntityBannerProps = {
|
|
5
|
+
title: string;
|
|
6
|
+
text: string;
|
|
7
|
+
color: ColorPaletteProp;
|
|
8
|
+
icon: BannerIcon;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* States, in the editor, what saving will do and who it reaches.
|
|
12
|
+
*
|
|
13
|
+
* Separate from the list's ScopeNote despite looking similar: this one leads with
|
|
14
|
+
* a bold claim ("Editing the GLOBAL entity") because the consequence differs per
|
|
15
|
+
* state and is the thing a reader must not skim past. Publishing to every client
|
|
16
|
+
* and editing one client's private copy look identical in the form below it.
|
|
17
|
+
*/
|
|
18
|
+
declare const EntityBanner: React.FC<EntityBannerProps>;
|
|
19
|
+
export default EntityBanner;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CatalogueScope } from './CatalogueScopeTabs';
|
|
3
|
+
import { IkebanaEntityType } from 'fansunited-management-components';
|
|
4
|
+
type EntityEditorProps = {
|
|
5
|
+
/** Empty while creating - there is no document to load yet. */
|
|
6
|
+
entityId: string;
|
|
7
|
+
/** Name from the row that was opened, shown until the document arrives. */
|
|
8
|
+
knownName?: string;
|
|
9
|
+
/** Creating rather than editing: nothing is fetched, and the id is unlocked. */
|
|
10
|
+
isNew?: boolean;
|
|
11
|
+
/** Sport code to seed a new entity's id and sport with, e.g. 'fb'. */
|
|
12
|
+
newSportCode?: string | null;
|
|
13
|
+
/** Called with the new id once a create succeeds, so the parent can switch to editing it. */
|
|
14
|
+
onCreated?: (id: string) => void;
|
|
15
|
+
entityType: IkebanaEntityType;
|
|
16
|
+
scope: CatalogueScope;
|
|
17
|
+
/** Display name for the client. */
|
|
18
|
+
clientName: string;
|
|
19
|
+
/** The client whose overlay is read when the scope is `overrides`. */
|
|
20
|
+
clientId: string;
|
|
21
|
+
canEdit: boolean;
|
|
22
|
+
/** Switches this editor onto the client's copy once one exists. */
|
|
23
|
+
onOverrideCreated?: () => void;
|
|
24
|
+
onBack: () => void;
|
|
25
|
+
};
|
|
26
|
+
declare const EntityEditor: React.FC<EntityEditorProps>;
|
|
27
|
+
export default EntityEditor;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IkebanaEntityType } from 'fansunited-management-components';
|
|
3
|
+
type EntityTypeTabsProps = {
|
|
4
|
+
value: IkebanaEntityType;
|
|
5
|
+
onChange: (entityType: IkebanaEntityType) => void;
|
|
6
|
+
};
|
|
7
|
+
/** The seven entity type tabs across the top of the catalogue. */
|
|
8
|
+
declare const EntityTypeTabs: React.FC<EntityTypeTabsProps>;
|
|
9
|
+
export default EntityTypeTabs;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FieldDef } from '../../helpers/entityFields';
|
|
3
|
+
type GeneralSectionProps = {
|
|
4
|
+
fields: FieldDef[];
|
|
5
|
+
values: Record<string, string>;
|
|
6
|
+
errors: Record<string, string>;
|
|
7
|
+
readOnly: boolean;
|
|
8
|
+
/** Locked fields become editable while creating, and never afterwards. */
|
|
9
|
+
isNew: boolean;
|
|
10
|
+
onChange: (field: FieldDef, value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const GeneralSection: React.FC<GeneralSectionProps>;
|
|
13
|
+
export default GeneralSection;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type JsonDrawerLabels = {
|
|
3
|
+
globalSubtitle: string;
|
|
4
|
+
overrideSubtitle: string;
|
|
5
|
+
copy: string;
|
|
6
|
+
copied: string;
|
|
7
|
+
close: string;
|
|
8
|
+
footerNote: string;
|
|
9
|
+
};
|
|
10
|
+
type JsonDrawerProps = {
|
|
11
|
+
open: boolean;
|
|
12
|
+
title: string;
|
|
13
|
+
entityId: string;
|
|
14
|
+
isOverride: boolean;
|
|
15
|
+
/** The entity data a save would send, already normalised. */
|
|
16
|
+
json: string;
|
|
17
|
+
labels: JsonDrawerLabels;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The entity data this editor would save, as JSON.
|
|
22
|
+
*
|
|
23
|
+
* Read-only on purpose: editing it would be a second way to write the same
|
|
24
|
+
* entity, with none of the validation.
|
|
25
|
+
*/
|
|
26
|
+
declare const JsonDrawer: React.FC<JsonDrawerProps>;
|
|
27
|
+
export default JsonDrawer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const PAGE_SIZE_OPTIONS: number[];
|
|
3
|
+
type ListPaginationProps = {
|
|
4
|
+
summary: string;
|
|
5
|
+
page: number;
|
|
6
|
+
pageCount: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
rowsPerPageLabel: string;
|
|
9
|
+
onPageChange: (page: number) => void;
|
|
10
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Summary on the left, page size and numbered page controls on the right.
|
|
14
|
+
*
|
|
15
|
+
* Hand-rolled because Joy ships no Pagination component and pulling in the
|
|
16
|
+
* Material one would put a second design system in the table footer. The page
|
|
17
|
+
* numbers are windowed (see pageSlots) so a catalogue of thousands still fits.
|
|
18
|
+
*/
|
|
19
|
+
declare const ListPagination: React.FC<ListPaginationProps>;
|
|
20
|
+
export default ListPagination;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ALL_SPORTS, SportCode } from '../../constants/constants';
|
|
3
|
+
type ListToolbarProps = {
|
|
4
|
+
query: string;
|
|
5
|
+
onQueryChange: (query: string) => void;
|
|
6
|
+
sport: SportCode | typeof ALL_SPORTS;
|
|
7
|
+
onSportChange: (sport: SportCode | typeof ALL_SPORTS) => void;
|
|
8
|
+
/** Hidden for countries, which carry no sport and would filter to nothing. */
|
|
9
|
+
showSportFilter: boolean;
|
|
10
|
+
canCreate: boolean;
|
|
11
|
+
createLabel: string;
|
|
12
|
+
createHint: string;
|
|
13
|
+
searchPlaceholder: string;
|
|
14
|
+
allSportsLabel: string;
|
|
15
|
+
onCreate: () => void;
|
|
16
|
+
};
|
|
17
|
+
/** Search, sport filter and create, on the right of the scope tabs. */
|
|
18
|
+
declare const ListToolbar: React.FC<ListToolbarProps>;
|
|
19
|
+
export default ListToolbar;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IkebanaEntity } from 'fansunited-management-components';
|
|
3
|
+
type OverrideConfirmModalProps = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
entities: IkebanaEntity[];
|
|
6
|
+
title: string;
|
|
7
|
+
subtitle: string;
|
|
8
|
+
bodyText: string;
|
|
9
|
+
startsFromNote: string;
|
|
10
|
+
reversibleNote: string;
|
|
11
|
+
moreLabel: string;
|
|
12
|
+
fewerLabel: string;
|
|
13
|
+
cancelLabel: string;
|
|
14
|
+
confirmLabel: string;
|
|
15
|
+
busy: boolean;
|
|
16
|
+
onCancel: () => void;
|
|
17
|
+
onConfirm: () => void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Confirms creating client overrides, for one entity or many.
|
|
21
|
+
*
|
|
22
|
+
* Worth confirming rather than acting immediately: an override permanently
|
|
23
|
+
* detaches that entity from the global catalogue for this client - later global
|
|
24
|
+
* edits stop reaching it - and that consequence is invisible from the list.
|
|
25
|
+
*/
|
|
26
|
+
declare const OverrideConfirmModal: React.FC<OverrideConfirmModalProps>;
|
|
27
|
+
export default OverrideConfirmModal;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IkebanaEntity, IkebanaEntityType } from 'fansunited-management-components';
|
|
3
|
+
import { RelatedLink, RelationshipDef } from '../../helpers/related';
|
|
4
|
+
export type RelatedLabels = {
|
|
5
|
+
addHeading: string;
|
|
6
|
+
searchPlaceholder: string;
|
|
7
|
+
noResults: string;
|
|
8
|
+
searching: string;
|
|
9
|
+
removeTitle: string;
|
|
10
|
+
unknownEntity: string;
|
|
11
|
+
unknownRelationship: string;
|
|
12
|
+
showMore: string;
|
|
13
|
+
showLess: string;
|
|
14
|
+
copyId: string;
|
|
15
|
+
copiedId: string;
|
|
16
|
+
empty: string;
|
|
17
|
+
summary: string;
|
|
18
|
+
};
|
|
19
|
+
type RelatedSectionProps = {
|
|
20
|
+
related: RelatedLink[];
|
|
21
|
+
relationships: RelationshipDef[];
|
|
22
|
+
/** Names for ids already linked, keyed by id. */
|
|
23
|
+
resolved: Map<string, IkebanaEntity>;
|
|
24
|
+
readOnly: boolean;
|
|
25
|
+
labels: RelatedLabels;
|
|
26
|
+
onSearch: (query: string, entityType: IkebanaEntityType) => Promise<IkebanaEntity[]>;
|
|
27
|
+
onChange: (related: RelatedLink[]) => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The entities this one is linked to.
|
|
31
|
+
*
|
|
32
|
+
* These are what the Search API filters on, so a link added here is what makes
|
|
33
|
+
* the entity answer a query like "every team in this competition".
|
|
34
|
+
*/
|
|
35
|
+
declare const RelatedSection: React.FC<RelatedSectionProps>;
|
|
36
|
+
export default RelatedSection;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type RemoveButtonProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
/** `md` for headers, where the button stands alone rather than ending a row. */
|
|
6
|
+
size?: 'sm' | 'md';
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The one way a row is removed, anywhere in the editor.
|
|
10
|
+
*
|
|
11
|
+
* Shared rather than repeated so the icon, size and hover cannot drift apart
|
|
12
|
+
* between sections - translations, attributes and provider references are the
|
|
13
|
+
* same gesture and should not look like three different ones.
|
|
14
|
+
*
|
|
15
|
+
* Only the glyph changes colour on hover. A tinted background reads as a
|
|
16
|
+
* destructive button being armed, which is the wrong weight for removing an
|
|
17
|
+
* unsaved row from a list.
|
|
18
|
+
*/
|
|
19
|
+
declare const RemoveButton: React.FC<RemoveButtonProps>;
|
|
20
|
+
export default RemoveButton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type RemoveOverrideModalProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
title: string;
|
|
5
|
+
/** The entity being reset, named rather than identified by id. */
|
|
6
|
+
subtitle: string;
|
|
7
|
+
bodyText: string;
|
|
8
|
+
fallsBackNote: string;
|
|
9
|
+
permanentNote: string;
|
|
10
|
+
cancelLabel: string;
|
|
11
|
+
confirmLabel: string;
|
|
12
|
+
busy: boolean;
|
|
13
|
+
onCancel: () => void;
|
|
14
|
+
onConfirm: () => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Confirms deleting a client's override.
|
|
18
|
+
*
|
|
19
|
+
* Laid out like the create-override dialog on purpose: the two are opposite ends
|
|
20
|
+
* of the same action, and a reader who has seen one should recognise the other.
|
|
21
|
+
*/
|
|
22
|
+
declare const RemoveOverrideModal: React.FC<RemoveOverrideModalProps>;
|
|
23
|
+
export default RemoveOverrideModal;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RowListRow {
|
|
3
|
+
/** Chosen from a fixed list - an attribute name, or a provider. */
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
type RowListSectionProps = {
|
|
8
|
+
rows: RowListRow[];
|
|
9
|
+
options: {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}[];
|
|
13
|
+
keyHeading: string;
|
|
14
|
+
valueHeading: string;
|
|
15
|
+
valuePlaceholder: string;
|
|
16
|
+
addLabel: string;
|
|
17
|
+
emptyMessage: string;
|
|
18
|
+
/** Tooltip on the remove button, e.g. "Remove provider reference". */
|
|
19
|
+
removeTitle: string;
|
|
20
|
+
readOnly: boolean;
|
|
21
|
+
/** Renders the value in monospace, for ids. */
|
|
22
|
+
monoValue?: boolean;
|
|
23
|
+
/** Shown above the empty-state message. */
|
|
24
|
+
emptyIcon: React.ReactNode;
|
|
25
|
+
/** Closing note, e.g. "2 provider references. Each provider should appear once." */
|
|
26
|
+
summary: string;
|
|
27
|
+
onChange: (rows: RowListRow[]) => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A list of key/value rows, backing both Additional Information and Provider
|
|
31
|
+
* References.
|
|
32
|
+
*
|
|
33
|
+
* One component for both because they are the same shape - a key from a fixed
|
|
34
|
+
* list, a free-text value, add and remove - and the only differences are the copy
|
|
35
|
+
* and whether the value reads as an id.
|
|
36
|
+
*/
|
|
37
|
+
declare const RowListSection: React.FC<RowListSectionProps>;
|
|
38
|
+
export default RowListSection;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type SaveState = 'clean' | 'dirty' | 'errors' | 'readOnly';
|
|
3
|
+
type SaveStatusProps = {
|
|
4
|
+
state: SaveState;
|
|
5
|
+
text: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The save bar's state, as a chip rather than a line of grey text.
|
|
9
|
+
*
|
|
10
|
+
* The four states carry very different consequences - publishing to every client
|
|
11
|
+
* is not the same as having nothing to save - and flat text of one colour made
|
|
12
|
+
* them all look alike. The design marks this with a small coloured dot; this
|
|
13
|
+
* keeps that idea and lets the tint carry the severity.
|
|
14
|
+
*/
|
|
15
|
+
declare const SaveStatus: React.FC<SaveStatusProps>;
|
|
16
|
+
export default SaveStatus;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ColorPaletteProp } from '@mui/joy/styles';
|
|
3
|
+
type ScopeNoteProps = {
|
|
4
|
+
text: string;
|
|
5
|
+
color: ColorPaletteProp;
|
|
6
|
+
icon: 'global' | 'overrides' | 'readOnly';
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The tinted band under the toolbar spelling out what editing in this scope does.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately always present rather than dismissible: the difference between
|
|
12
|
+
* changing one client's data and changing every client's is the single most
|
|
13
|
+
* consequential thing on this screen, and it is not otherwise visible from the
|
|
14
|
+
* table.
|
|
15
|
+
*/
|
|
16
|
+
declare const ScopeNote: React.FC<ScopeNoteProps>;
|
|
17
|
+
export default ScopeNote;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IkebanaEntity } from 'fansunited-management-components';
|
|
3
|
+
export type SearchPanelLabels = {
|
|
4
|
+
title: string;
|
|
5
|
+
hint: string;
|
|
6
|
+
nameStep: string;
|
|
7
|
+
nameStepHint: string;
|
|
8
|
+
variationsStep: string;
|
|
9
|
+
variationsStepHint: string;
|
|
10
|
+
noVariations: string;
|
|
11
|
+
filtersStep: string;
|
|
12
|
+
filtersStepHint: string;
|
|
13
|
+
noFilters: string;
|
|
14
|
+
moreFilters: string;
|
|
15
|
+
fewerFilters: string;
|
|
16
|
+
copyFilter: string;
|
|
17
|
+
copiedFilter: string;
|
|
18
|
+
showParams: string;
|
|
19
|
+
hideParams: string;
|
|
20
|
+
paramsHint: string;
|
|
21
|
+
paramsMore: string;
|
|
22
|
+
rankingStep: string;
|
|
23
|
+
rankingStepHint: string;
|
|
24
|
+
unfilterableWarning: string;
|
|
25
|
+
};
|
|
26
|
+
type SearchIndexPanelProps = {
|
|
27
|
+
labels: SearchPanelLabels;
|
|
28
|
+
/** The value of `search_title` this entity will be saved with. */
|
|
29
|
+
searchTitle: string;
|
|
30
|
+
/** The `search_variations` derived from the form. */
|
|
31
|
+
variations: string[];
|
|
32
|
+
/** `search_filters` - the only link field the Search API filters on. */
|
|
33
|
+
filters: {
|
|
34
|
+
relationship: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}[];
|
|
37
|
+
/**
|
|
38
|
+
* Links stored under `relationships` instead of `search_filters`.
|
|
39
|
+
*
|
|
40
|
+
* Counted rather than listed because the point is only that they exist: the
|
|
41
|
+
* Search API never reads them, so they are invisible to filtering.
|
|
42
|
+
*/
|
|
43
|
+
strandedLinkCount: number;
|
|
44
|
+
popularity: number;
|
|
45
|
+
/** Linked entities already loaded for Related, so nothing is fetched twice. */
|
|
46
|
+
resolved: Map<string, IkebanaEntity>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* What searching for this entity will actually do, in plain language.
|
|
50
|
+
*
|
|
51
|
+
* Written for whoever is editing the entity rather than for whoever built the
|
|
52
|
+
* index: the four steps are the four things that decide whether an app finds
|
|
53
|
+
* this entity and how high it appears, in the order a search applies them.
|
|
54
|
+
*
|
|
55
|
+
* Everything shown is derived from the form, not from the stored document - it
|
|
56
|
+
* is a preview of what saving would produce, which is the only version anyone
|
|
57
|
+
* can still change.
|
|
58
|
+
*
|
|
59
|
+
* Collapsed by default: General is where the editing happens, and this explains
|
|
60
|
+
* a consequence of it rather than asking for input.
|
|
61
|
+
*/
|
|
62
|
+
declare const SearchIndexPanel: React.FC<SearchIndexPanelProps>;
|
|
63
|
+
export default SearchIndexPanel;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SeasonEntry } from '../../helpers/seasonHistory';
|
|
3
|
+
import { RelationshipDef } from '../../helpers/related';
|
|
4
|
+
import { AssetLabels } from './AssetsSection';
|
|
5
|
+
import { AssetSlot } from '../../helpers/assets';
|
|
6
|
+
export type SeasonHistoryLabels = {
|
|
7
|
+
addSeason: string;
|
|
8
|
+
removeSeason: string;
|
|
9
|
+
seasonIdLabel: string;
|
|
10
|
+
seasonIdPlaceholder: string;
|
|
11
|
+
seasonIdInvalid: string;
|
|
12
|
+
untitledSeason: string;
|
|
13
|
+
linksHeading: string;
|
|
14
|
+
relationshipColumn: string;
|
|
15
|
+
entityIdColumn: string;
|
|
16
|
+
addLink: string;
|
|
17
|
+
removeLink: string;
|
|
18
|
+
noLinks: string;
|
|
19
|
+
assetsHeading: string;
|
|
20
|
+
attributesHeading: string;
|
|
21
|
+
attributeColumn: string;
|
|
22
|
+
valueColumn: string;
|
|
23
|
+
addAttribute: string;
|
|
24
|
+
removeAttribute: string;
|
|
25
|
+
noAttributes: string;
|
|
26
|
+
empty: string;
|
|
27
|
+
summary: string;
|
|
28
|
+
};
|
|
29
|
+
type SeasonHistorySectionProps = {
|
|
30
|
+
history: SeasonEntry[];
|
|
31
|
+
relationships: RelationshipDef[];
|
|
32
|
+
assetSlots: AssetSlot[];
|
|
33
|
+
attributeOptions: {
|
|
34
|
+
value: string;
|
|
35
|
+
label: string;
|
|
36
|
+
}[];
|
|
37
|
+
readOnly: boolean;
|
|
38
|
+
labels: SeasonHistoryLabels;
|
|
39
|
+
assetLabels: AssetLabels;
|
|
40
|
+
onUpload: (file: File, assetKey: string) => Promise<{
|
|
41
|
+
path: string;
|
|
42
|
+
url: string;
|
|
43
|
+
}>;
|
|
44
|
+
onError: (message: string) => void;
|
|
45
|
+
onChange: (history: SeasonEntry[]) => void;
|
|
46
|
+
};
|
|
47
|
+
/** Per-season squad, staff, assets and attributes. */
|
|
48
|
+
declare const SeasonHistorySection: React.FC<SeasonHistorySectionProps>;
|
|
49
|
+
export default SeasonHistorySection;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type SelectionStripProps = {
|
|
3
|
+
selectedLabel: string;
|
|
4
|
+
createOverridesForLabel: string;
|
|
5
|
+
clientName: string;
|
|
6
|
+
clearLabel: string;
|
|
7
|
+
createLabel: string;
|
|
8
|
+
busy: boolean;
|
|
9
|
+
onClear: () => void;
|
|
10
|
+
onCreate: () => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Replaces the scope note while rows are selected.
|
|
14
|
+
*
|
|
15
|
+
* It takes the scope note's place rather than stacking below it because the two
|
|
16
|
+
* say different things about the same band of the screen, and the design treats
|
|
17
|
+
* them as one slot.
|
|
18
|
+
*/
|
|
19
|
+
declare const SelectionStrip: React.FC<SelectionStripProps>;
|
|
20
|
+
export default SelectionStrip;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SocialSlot } from '../../helpers/socials';
|
|
3
|
+
export type SocialsLabels = {
|
|
4
|
+
invalidUrl: string;
|
|
5
|
+
openLink: string;
|
|
6
|
+
summary: string;
|
|
7
|
+
};
|
|
8
|
+
type SocialsSectionProps = {
|
|
9
|
+
socials: Record<string, unknown>;
|
|
10
|
+
slots: SocialSlot[];
|
|
11
|
+
readOnly: boolean;
|
|
12
|
+
labels: SocialsLabels;
|
|
13
|
+
onChange: (key: string, value: string | null) => void;
|
|
14
|
+
};
|
|
15
|
+
/** Official channel URLs for an entity, one field per platform. */
|
|
16
|
+
declare const SocialsSection: React.FC<SocialsSectionProps>;
|
|
17
|
+
export default SocialsSection;
|