Info Page Management

Welcome to Fans United Info Pages Management Widget. The widget allows staff members with sufficient permissions to create and manage info pages. You can use this widget as it is and embed it in your platform, or you can use the Management Panel to create info pages. Info Pages support multiple content types (TEXT, HTML, JSON) and custom game configurations including Pick-the-Pair, Chance Game, and Memory Game. With successful installation, you can create, edit, and manage Info Pages with rich content and interactive features.

Installation and usage

The easiest way to use fansunited-widget-info-pages is to install it from npm as follows:

npm install fansunited-widget-info-pages

or:

yarn add fansunited-widget-info-pages

Here is an example how you can integrate Fans United Info Pages Management Widget:

import 'fansunited-widget-info-pages/style.css';
import { InfoPageManager } from 'fansunited-widget-info-pages';

const App = () => {
  return (
    <InfoPageManager
      fansUnitedApiKey={'your-api-key'}
      fansUnitedClientId={'your-client-id'} />
  );
}

Notes

  • The widget is bundled as a React component and its usage is as simple as the above example

  • Don't worry about your project's CSS. The widget's styling is done with Joy UI which is based on headless unstyle react components. This means that the widget's CSS will NOT affect yours. One important thing is that you need to import style.css file from package folder:

import 'fansunited-widget-info-pages-management/style.css';

N.B: If you are using an entry point for importing all your stylings, you need to import fansunited-widget-info-pages/style.css there as well

Props

type InfoPageManagerProps = {
  fansUnitedApiKey: string;
  fansUnitedClientId: string;
  fansUnitedLanguage?: string;
  fansUnitedEnvironment?: string;
  sportal365Project?: string;
  sportal365Infrastructure?: 'shared' | 'betway';
  labels?: LabelsModel;
  hideSignOutButton?: boolean;
};

Fans United Info Pages Management Widget depends on Fans United JS SDK and Fans United Client API. Thats why fansUnitedApiKey and fansUnitedClientId are required. They will be provided to you from Fans United team. For other optional props here is some information:

  • fansUnitedLanguage - for our sports APIs FansUnited platform supports different languages. For now they are Bulgarian (bg), English (en), Romanian (ro), Greek (el), Slovak (sk), Serbian (sr) and Hungarian (hu). If no value given it will be set to English (en).

  • fansUnitedEnvironment - You can run the widget in the following environments: staging and production. If no value given it will be set to production (prod).

  • labels - you can easily translate all labels, UI messages, descriptions, placeholders and etc. with this prop. By default, Fans United Info Pages Management Widget is available in English so if no value is given, the widget will be translated in English.

  • sportal365Project - The Sportal365 project. Used as a request header when communicating with Sportal365 APIs.

  • sportal365Infrastructure - The Sportal365 infrastructure. Used to determine what authorization should be used when communicating with Sportal365 APIs. If no value given (when sportal365Project props is provided) it will be set to shared.

  • hideSignOutButton - The prop is used to hide the sign out button which is positioned on the top right corner on the main screen of the widget.

Translation

You can easily translate Fans United Info Pages Management Widget in your language! You just need to pass an object to labels prop with concrete keys and values and that's it! Here's an example how you can do it:

import 'fansunited-widget-info-pages/style.css';
import { InfoPageManager } from 'fansunited-widget-info-pages';

const labels = {
  userNotFound: 'User not found. Please try again.',
  noInfoPagesFound: "No info pages were found. You can create an info page by clicking the button 'Create'",
  create: 'Create',
  signOut: 'Sign out',
  infoPages: 'Info Pages',
  mainDescription: 'Use this interface to manage your Info Pages and customize your Info Pages configuration.',
  itemsPerPage: 'Items per page',
  back: 'Back',
  manageTitle: 'Manage Info Page',
  manageDescription: 'Using this form, you can manage Info Page.',
  title: 'Title',
  description: 'Description',
  subtitle: 'Subtitle',
  configuration: 'Configuration',
  id: 'ID',
  type: 'Type',
  contentType: 'Content Type',
  text: 'Text',
  html: 'HTML',
  json: 'JSON',
  content: 'Content',
  images: 'Images',
  mainImage: 'Main',
  coverImage: 'Cover',
  mobileImage: 'Mobile',
  uploadImage: 'Upload Image',
  sportal365Images: 'Sportal365 Images',
  search: 'Search',
  searchImage: 'Search image',
  hideFilters: 'Hide filters',
  showFilters: 'Show filters',
  branding: 'Branding',
  brandingTemplateLabel: 'Select branding',
  brandingTemplatePlaceholder: 'Choose existing branding',
  colors: 'Colors',
  urls: 'URLs',
  labels: 'Labels',
  context: 'Context',
  language: 'Language',
  languageDescription: 'Select the language for this info page.',
  typeDescription: 'Select the type for this info page.',
  // Game configuration labels
  chanceGame: 'Chance Game',
  pickThePair: 'Pick the Pair',
  memoryGame: 'Memory Game',
  selectionMode: 'Selection Mode',
  alwaysWin: 'Always Win',
  fairRandom: 'Fair Random',
  weightedByProbability: 'Weighted by Probability',
  segments: 'Segments',
  pairs: 'Pairs',
  cards: 'Cards',
  timeLimit: 'Time Limit',
  timeLimitSeconds: 'Time Limit (seconds)',
  successThreshold: 'Success Threshold',
  displayOrder: 'Display Order',
  leftColumn: 'Left Column',
  rightColumn: 'Right Column',
  // Messages
  createInfoPageMessage: 'You have successfully created an info page.',
  editInfoPageMessage: 'You have successfully edited an info page.',
  cloneInfoPageMessage: 'You have successfully cloned an info page.',
  deleteInfoPageMessage: 'You have successfully deleted an info page.',
  createInfoPageErrorMessage: 'There was a problem with creating the info page. Please try again.',
  editInfoPageErrorMessage: 'There was a problem with editing the info page. Please try again.',
  infoPagesErrorMessage: 'There was a problem retrieving information about the info pages.',
  updateConfigurationMessage: 'Configuration updated successfully.',
  updateConfigurationErrorMessage: 'There was a problem updating the configuration. Please try again.',
};

const App = () => {
  return (
    <InfoPageManager
      fansUnitedApiKey={'your-api-key'}
      fansUnitedClientId={'your-client-id'}
      labels={labels} />
  );
}

Here is all information about LabelsModel:

Core Labels

KeyDescriptionDefault Value
userNotFoundOn login screen when client gives invalid information about email or password.User not found. Please try again.
clientFeaturesNotFoundMessageError message when client features cannot be fetched.There was a problem fetching configuration. Please try again.
signOutUsed as label on sign out button.Sign out
mainDescriptionMain description for the widget.Use this interface to manage your Info Pages and customize your Info Pages configuration.
infoPagesLabel for Info Pages.Info Pages
createUsed as label on create button.Create
noInfoPagesFoundWhen there are no created info pages for specific client, this message will appear on screen.No info pages were found. You can create a game by clicking the button 'Create'
itemsPerPageLabel for items per page filter.Items per page
backLabel for back button (left arrow positioned on top-right corner).Back
manageTitleTitle on managing screen.Manage Info Page
manageDescriptionDescription on managing screen.Using this form, you can manage Info Page.

Form Labels

KeyDescriptionDefault Value
titleLabel for title input.Title
descriptionLabel for description input field.Description
subtitleLabel for subtitle input.Subtitle
configurationLabel for configuration accordion.Configuration
idLabel for ID input field.ID
nameLabel for name input.Name
labelLabel for label input.Label
typeLabel for type select.Type
typeDescriptionDescription for type select.Select the type for this info page.
contentLabel for content input.Content
contentTypeLabel for content type select.Content Type
textLabel for TEXT content type option.Text
htmlLabel for HTML content type option.HTML
jsonLabel for JSON content type option.JSON
selectContentTypeDescriptionDescription for content type select.Select the content type for your info page.
htmlContentLabel for HTML content editor.HTML Content
jsonContentLabel for JSON content editor.JSON Content
professionalHtmlEditorDescriptionDescription for HTML editor.Use this professional HTML editor to create rich content.
professionalJsonEditorDescriptionDescription for JSON editor.Use this professional JSON editor to configure your content.
languageLabel for language select.Language
languageDescriptionDescription for language select.Select the language for this info page.
formViewLabel for form view tab.Form View
jsonViewLabel for JSON view tab.JSON View
labelsConfigurationLabel for labels configuration.Labels Configuration
labelsConfigurationDescriptionDescription for labels configuration.Configure custom labels for your info page.
errorLabel for error state.Error
jsonConfigurationLabel for JSON configuration.JSON Configuration
configurationWillBeResetWarning message for configuration reset.Configuration will be reset
changingInfoPageTypeWarningWarning when changing info page type.Changing the info page type will reset the configuration. Are you sure you want to continue?

Image Management Labels

KeyDescriptionDefault Value
imagesTitle for images container.Images
mainImageTitle for main image.Main
coverImageTitle for cover image.Cover
mobileImageTitle for mobile image.Mobile
uploadImageLabel for upload button in images accordion.Upload Image
sportal365ImagesLabel for sportal365 images button.Sportal365 Images
searchLabel for search button.Search
searchImagePlaceholder for input search in sportal365.Search image
hideFiltersLabel for hide filters for sportal365 images hyperlink.Hide filters
showFiltersLabel for show filters for sportal365 images hyperlink.Show filters
hideMoreImagesLabel for hide more images hyperlink.Hide more images
showMoreImagesLabel for show more images hyperlink.Show more images
addImagesLabel for toggle button to show images.Add images
fromDateLabel for from date filter.From Date
toDateLabel for to date filter.To Date
clearImageTooltip for clear image button.Clear image
copyUrlTooltip for copy url image button.Copy URL
viewImageTooltip for view image button.View image
cropImageTooltip for crop image button.Crop image
aspectRatioLabel for aspect ratio select.Aspect ratio
cropLabel for crop button.Crop
resetLabel for reset button.Reset

Game Configuration Labels

KeyDescriptionDefault Value
chanceGameLabel for Chance Game type.Chance Game
pickThePairLabel for Pick the Pair game type.Pick the Pair
memoryGameLabel for Memory Game type.Memory Game
selectionModeLabel for selection mode.Selection Mode
modeLabel for mode select.Mode
casualLabel for casual mode.Casual
challengeLabel for challenge mode.Challenge
alwaysWinLabel for always win mode.Always Win
fairRandomLabel for fair random mode.Fair Random
weightedByProbabilityLabel for weighted mode.Weighted by Probability
segmentsLabel for segments.Segments
pairsLabel for pairs.Pairs
cardsLabel for cards.Cards
timeLimitSecondsLabel for time limit in seconds.Time Limit (seconds)
successThresholdLabel for success threshold.Success Threshold
displayOrderLabel for display order.Display Order
leftColumnOptionsDisplayOrderLabel for left column options display order.Left Column Options Display Order
rightColumnOptionsDisplayOrderLabel for right column options display order.Right Column Options Display Order
optionALabel for option A.Option A
optionBLabel for option B.Option B
winningLabel for winning toggle.Winning
weightLabel for weight input.Weight
resultDisplayLabel for result display.Result Display
resultTitleLabel for result title.Result Title
resultDescriptionLabel for result description.Result Description
callToActionButtonsLabel for call to action buttons.Call to Action Buttons
addPrimaryCtaLabel for add primary CTA button.Add Primary CTA
primaryCtaLabel for primary CTA.Primary CTA
addSecondaryCtaLabel for add secondary CTA button.Add Secondary CTA
secondaryCtaLabel for secondary CTA.Secondary CTA
buttonLabelLabel for button label input.Button Label
buttonLinkLabel for button link input.Button Link
segmentNumberLabel for segment number.Segment #
pairNumberLabel for pair number.Pair #
cardNumberLabel for card number.Card #
alwaysWinDescriptionDescription for always win mode.In this mode, users will always win.
fairDescriptionDescription for fair random mode.In this mode, each segment has an equal chance of being selected.
weightedDescriptionDescription for weighted mode.In this mode, segments are selected based on their weight/probability.
resultDisplayDescriptionDescription for result display.Configure how the result is displayed to the user.
segmentLabelDescriptionDescription for segment label.Enter a label for this segment.
winningDescriptionDescription for winning toggle.Mark this segment as a winning segment.
weightDescriptionDescription for weight input.Set the weight/probability for this segment.
casualModeDescriptionDescription for casual mode.In casual mode, users can match pairs at their own pace.
challengeModeDescriptionDescription for challenge mode.In challenge mode, users must complete within a time limit.
timeLimitDescriptionDescription for time limit.Set the time limit in seconds for completing the game.
successThresholdDescriptionDescription for success threshold.Set the minimum number of correct pairs needed to win.
displayOrderDescriptionDescription for display order.Configure the display order of options.
leftColumnDescriptionDescription for left column.Configure options for the left column.
rightColumnDescriptionDescription for right column.Configure options for the right column.

Branding Labels

KeyDescriptionDefault Value
brandingLabel for branding accordion.Branding
brandingTemplateLabelLabel for branding menu selection.Select branding
brandingTemplatePlaceholderPlaceholder for branding menu selection.Choose existing branding
colorsLabel for colors tab in branding accordion.Colors
urlsLabel for urls tab in branding accordion.URLs
mainLogoLabel for main logo input in branding accordion.Main Logo
mobileLogoLabel for mobile logo input in branding accordion.Mobile logo
backgroundImageLabel for background image input in branding accordion.Background image
mobileBackgroundImageLabel for mobile background image input in branding accordion.Mobile background image
additionalImageLabel for additional image input in branding accordion.Additional image
primaryColorLabel for primary color input in branding accordion.Primary color
secondaryColorLabel for secondary color input in branding accordion.Secondary color
contentColorLabel for content color input in branding accordion.Content color
backgroundColorLabel for background color input in branding accordion.Background color
borderColorLabel for border color input in branding accordion.Border color
additionalColorLabel for additional color input in branding accordion.Additional color
primaryUrlLabel for primary url input in branding accordion.Primary URL
secondaryUrlLabel for secondary url input in branding accordion.Secondary URL
privacyPolicyUrlLabel for privacy policy url input in branding accordion.Privacy policy URL
termsAndConditionsUrlLabel for terms and conditions url input in branding accordion.Terms and conditions URL
additionalUrlLabel for additional url input in branding accordion.Additional URL

Action Labels

KeyDescriptionDefault Value
previousLabel for previous button.Previous
nextLabel for next button.Next
editUsed as a tooltip on edit button.Edit
cloneUsed as label on clone button.Clone
closeLabel for close button.Close
saveLabel for save button.Save
addLabel for add button.Add
removeLabel for remove button.Remove
deleteLabel for delete button.Delete
cancelLabel for cancel button.Cancel
continueLabel for continue button.Continue
formatLabel for format button.Format
minifyLabel for minify button.Minify
pageNoLabel for pagination.Page No

Context and Tags Labels

KeyDescriptionDefault Value
contextLabel for context accordion.Context
tagsLabel for tags.Tags
campaignLabel for campaign.Campaign
contextEntityTagLabel for context entity tag.Context Entity Tag
typeContextTagNamePlaceholderPlaceholder for context tag name.Type context tag name
labelsLabel for labels accordion.Labels
keyDynamicFieldsLabel for key input in dynamic fields.Key
valueDynamicFieldsLabel for value input in dynamic fields.Value

Message Labels

KeyDescriptionDefault Value
urlCopiedToClipboardMessageToast info message when image URL is copied.URL copied to clipboard
imageDeletedMessageToast info message when image is deleted.Image deleted
imageResetMessageToast info message when image size is restored.The initial size of the image has been restored
uploadingImageMessageToast success message when uploading image to bucket.You have successfully uploaded image
generateSignedInUrlErrorMessageToast error message when trying to receive a signed in URL.There was a problem generating signed in URL to store the image in bucket. Please try again
uploadingImageErrorMessageToast error message when uploading image to bucket.There was a problem with uploading image to bucket. Please try again
encryptingImageErrorMessageToast error message when encrypting image before uploading it to bucket.There was a problem with encrypting image before uploading it to bucket. Please try again
searchSportal365ImagesErrorMessageToast error message when searching images from Sportal 365 API.There was a problem with searching images from Sportal 365 API. Please try again
provideTitleInfoPageErrorMessageToast error message when no title is provided.You need to provide a title to your info page!
infoPagesErrorMessageToast error message when request for fetching info pages fails.There was a problem retrieving information about the info pages.
createInfoPageMessageWhen creating an info page displaying a toast successful message.You have successfully created an info page.
editInfoPageMessageWhen editing an info page displaying a toast successful message.You have successfully edited an info page.
createInfoPageErrorMessageWhen creating an info page displaying a toast error message.There was a problem with creating the info page. Please try again.
editInfoPageErrorMessageWhen editing an info page displaying a toast error message.There was a problem with editing the info page. Please try again.
cloneInfoPageMessageWhen cloning an info page displaying a toast successful message.You have successfully cloned an info page.
deleteInfoPageMessageWhen deleting an info page displaying a toast successful message.You have successfully deleted an info page.
deleteInfoPageErrorMessageWhen deleting an info page displaying a toast error message.There was a problem with deleting the info page. Please try again.
updateConfigurationMessageWhen updating configuration displaying a toast successful message.Configuration updated successfully.
updateConfigurationErrorMessageWhen updating configuration displaying a toast error message.There was a problem updating the configuration. Please try again.
requiredFieldValidationMessageCommon error toast validation message when main required field is missing.The following field is required:
getFootballEntitiesErrorMessageError message when fetching football entities fails.There was a problem fetching football entities. Please try again.
invalidJsonFormatError message for invalid JSON format.Invalid JSON format
failedToSerializeConfigurationError message when configuration serialization fails.Failed to serialize configuration
invalidJsonFormatFixBeforeSwitchingError message when switching views with invalid JSON.Invalid JSON format. Please fix before switching views.
youMustHaveAtLeast2PairsError message for insufficient pairs.You must have at least 2 pairs
defineCardsForMemoryGameError message for missing cards.Please define cards for the memory game
defineMatchingPairsForGameError message for missing pairs.Please define matching pairs for the game
noCardsAddedYetInfo message when no cards are added.No cards added yet
cannotMinifyInvalidJsonError message when trying to minify invalid JSON.Cannot minify invalid JSON

Validation Error Messages

KeyDescriptionDefault Value
bodyConfigurationLabel for body configuration.Body configuration
invalidJsonFormatInBodyConfigurationValidation error for invalid JSON in body.Invalid JSON format in body configuration
modeIsRequiredInConfigurationValidation error for missing mode.Mode is required in configuration
modeMustBeCasualOrChallengeValidation error for invalid mode value.Mode must be 'casual' or 'challenge'
pairsArrayIsRequiredInConfigurationValidation error for missing pairs array.Pairs array is required in configuration
atLeast2PairsAreRequiredValidation error for insufficient pairs.At least 2 pairs are required
pairIdIsRequiredValidation error for missing pair ID.Pair ID is required
pairOptionAIsRequiredValidation error for missing option A.Pair option A is required
pairOptionATitleIsRequiredValidation error for missing option A title.Pair option A title is required
pairOptionBIsRequiredValidation error for missing option B.Pair option B is required
pairOptionBTitleIsRequiredValidation error for missing option B title.Pair option B title is required
modeMustBeWinFairOrWeightedValidation error for invalid selection mode.Mode must be 'win', 'fair', or 'weighted'
segmentsArrayIsRequiredInConfigurationValidation error for missing segments array.Segments array is required in configuration
atLeast2SegmentsAreRequiredValidation error for insufficient segments.At least 2 segments are required
segmentIdIsRequiredValidation error for missing segment ID.Segment ID is required
segmentLabelIsRequiredValidation error for missing segment label.Segment label is required
segmentResultsIsRequiredValidation error for missing segment results.Segment results is required
segmentResultsTitleIsRequiredValidation error for missing segment results title.Segment results title is required
timeLimitIsRequiredInConfigurationValidation error for missing time limit.Time limit is required in configuration
timeLimitMustBe0OrGreaterValidation error for invalid time limit value.Time limit must be 0 or greater
cardsArrayIsRequiredInConfigurationValidation error for missing cards array.Cards array is required in configuration
atLeast2CardsAreRequiredValidation error for insufficient cards.At least 2 cards are required
cardIdIsRequiredValidation error for missing card ID.Card ID is required
cardTitleIsRequiredValidation error for missing card title.Card title is required
labelIsRequiredAndCannotBeEmptyValidation error for empty label.Label is required and cannot be empty

Miscellaneous Labels

KeyDescriptionDefault Value
timeFormatTime format for displaying dates. Widget uses dayjs as a date dependency.DD.MM.YYYY, HH:mm
creationDateLabel for creation date column.Created at
actionsLabel for actions column.Actions
sortLabel for sort select.Sort
ascendingLabel for ascending option.Ascending
descendingLabel for descending option.Descending
updateConfigurationLabel for update configuration button.Update Configuration
widgetEmbedCodeTitleTitle for widget embed code section.Widget Embed Code
copyToClipboardLabel for copy to clipboard button.Copy to Clipboard
divElementTextInfoInfo text for div element.Div Element Text Info
widgetEmbedCodeNotAvailableMessage when widget embed code is not available.Widget embed code not available
copiedToClipboardMessage when content is copied to clipboard.Copied to clipboard
layoutTemplateLabel for layout template.Layout Template
layoutTemplateDescriptionDescription for layout template.Select the layout template for your info page.
imagePositionLabel for image position.Image Position
imagePositionDescriptionDescription for image position.Select the position of the image in your info page.
deleteInfoPageTitleTitle for delete info page modal.Delete Info Page
deleteInfoPageDescriptionDescription for delete info page modal.Are you sure you want to delete this info page?
cloneInfoPageTitleTitle for clone info page modal.Clone Info Page
typesLabel for types configuration.Types
configureTypesDescriptionDescription for types configuration.Configure the types for your Info Pages. Types are used to categorize your Info Pages.
typeNumberLabel for type number.Type #