Standing Game Management

Welcome to Fans United Custom Standing Game Management Widget. The widget allows staff members with sufficient permissions to create new games. You can use this widget as it is and embed it in your platform, or you can use the Management Panel to create games. Standing Game is a game where users must predict the standing when a game is finished. With successful installation, you can create and edit a Standing Game.

Installation and usage

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

npm  install  fansunited-widget-standing

or:

yarn  add  fansunited-widget-standing

Here is an example how you can integrate Fans United Standing Game Management Widget:

import  'fansunited-widget-standing/style.css';
import { StandingManager } from  'fansunited-widget-standing';

const  App = () => {
return (
<StandingManager
	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-standing/style.css';

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

Props

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

Fans United Standing Game 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, production and watg. 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 Standing Game 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 Standing Game 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-standing/style.css';
import { StandingManager } from  'fansunited-widget-standing';

const labels = {
    userNotFound: 'User not found. Please try again.',
    noGamesFound: "No games were found. You can create a game by clicking the button 'Create'",
    create: 'Create',
    signOut: 'Sign out',
    name: 'Name',
    status: 'Status',
    statusDescription: 'Select the status of the game.',
    participants: 'Participants',
    creationDate: 'Created at',
    acceptUntil: 'Accept Until',
    actions: 'Actions',
    pending: 'Pending',
    settled: 'Settled',
    live: 'Live',
    open: 'Open',
    canceled: 'Canceled',
    closed: 'Closed',
    sortOrder: 'Sort order',
    ascending: 'Ascending',
    descending: 'Descending',
    itemsPerPage: 'Items per page',
    back: 'Back',
    manageGameTitle: 'Manage Standing Game',
    manageGameDescription: 'Using this form, you can manage Standing games.',
    title: 'Title',
    description: 'Description',
    cutoffTime: 'Cutoff time',
    configuration: 'Configuration',
    id: 'ID',
    points: 'Points',
    pointsDescription: 'Set the number of points awarded for each correct prediction. Points will be added to users rankings.'
    customFields: 'Custom fields',
    type: 'Type',
    relationship: 'Relationship',
    entity: 'Entity',
    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',
    urlCopiedToClipboardMessage: 'URL copied to clipboard',
    imageDeletedMessage: 'Image deleted',
    imageResetMessage: 'The initial size of the image has been restored',
    uploadingImageMessage: 'You have successfully uploaded image',
    generateSignedInUrlErrorMessage: 'There was a problem generating signed in URL to store the image in bucket. Please try again',
    uploadingImageErrorMessage: 'There was a problem with uploading image to bucket. Please try again',
    encryptingImageErrorMessage: 'There was a problem with encrypting image before uploading it to bucket. Please try again',
    searchSportal365ImagesErrorMessage: 'There was a problem with searching images from Sportal 365 API. Please try again',
    clearImage: 'Clear image',
    copyUrl: 'Copy URL',
    viewImage: 'View image',
    cropImage: 'Crop image',
    aspectRatio: 'Aspect ratio',
    crop: 'Crop',
    reset: 'Reset',
    hideMoreImages: 'Hide more images',
    showMoreImages: 'Show more images',
    addImages: 'Add images',
    participantsDescription: 'Add participants to the game.',
    additionalFields: 'Additional fields',
    addParticipant: 'Add participant',
    participantNumber: 'Participant number',
    group: 'Group',
    undecided: 'Undecided',
    removeParticipant: 'Remove participant'
    related: 'Related',
    rules: 'Rules',
    timeFormat: 'DD.MM.YYYY, HH:mm',
    edit: 'Edit',
    clone: 'Clone',
    close: 'Close',
    pageNo: 'Page No',
    save: 'Save',
    keyDynamicFields: 'Key',
    valueDynamicFields: 'Value',
    add: 'Add',
    delete: 'Delete',
    cloneGameTitle: 'Clone Standing Game',
    resolvePredictions: 'Resolve predictions',
    outcome: "Outcome",
    noItemsToDisplay: 'No items to display',
    dragToReorder: 'Drag to reorder',
    provideIdGameErrorMessage: 'You need to provide an ID to your game!',
    provideTitleGameErrorMessage: 'You need to provide a title to your game!',
    gamesErrorMessage: 'There was a problem retrieving information about the games.',
    createGameMessage: 'You have successfully created a game.',
    editGameMessage: 'You have successfully edited a game.',
    createGameErrorMessage: 'There was a problem with creating the game. Please try again.',
    editGameErrorMessage: 'There was a problem with editing the game. Please try again.',
    requiredFieldValidationMessage: 'The following field is required: ',
    participantsValidationMessage: 'Participant __participantNumber__: __propertyLabel__ is required!',
    relatedEntitiesErrorMessage: 'There was a problem with fetching entities for related. Please try again.',
    predictionsStartingToResolveInfoMessage: 'Predictions for game __gameTitle__ are starting to resolve. Keep in mind that this operation can take a while if there are thousands of predictions.',
    resolvingPredictionsInProgressInfoMessage: 'Resolving game predictions is already in progress...',
    resolvingPredictionsMessage: 'Predictions for game __gameTitle__ are successfully resolved! Total resolved predictions: __predictionsLength__',
};

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

Here is all information about LabelsModel:

KeyDescriptionDefault Value
userNotFoundOn login screen when client gives invalid information about email or password.User not found. Please try again.
noGamesFoundWhen there are no created games for specific client, this message will appear on screen.No games were found. You can create a game by clicking the button 'Create'.
createUsed as label on create button.Create
signOutUsed as label on sign out button.Sign out
nameLabel for name.Name
statusLabel for status.Status
statusDescriptionStatus select description.Select the status of the game.
participantsLabel text for participants tabParticipants
creationDateDisplayed in header of list of games. Date of created game in same format as given for timeFormat propCreated at
acceptUntilDisplayed in header of list of games. Date of predictions cutoff in same format as given for timeFormat propAccept until
actionsDisplayed in header of list of games.Actions
pendingStatus for specific game.Pending
settledStatus for specific game.Settled
liveStatus for specific game.Live
openStatus for specific game.Open
canceledStatus for specific game.Canceled
closedStatus for specific game.Closed
sortOrderLabel for sort order select inputSort order
ascendingLabel for ascending optionAscending
descendingLabel for descending optionDescending
itemsPerPageLabel for items per page filterItems per page
backlabel for back button (left arrow positioned on top-right corner).Back
manageGameTitleTitle on managing screenManage Standing Game
manageGameDescriptionDescription on managing screenUsing this form, you can manage Standing games.
titleLabel for title inputTitle
descriptionLabel for description input field when creating/editing a game.Description
cutoffTimeTitle for choosing a cutoff time for game.Cutoff time
configurationLabel for configuration accordionConfiguration
idLabel for ID input field.ID
pointsLabel for points configuration number inputPoints
pointsDescriptionDescription for points configuration number inputSet the number of points awarded for each correct prediction. Points will be added to users rankings.
customFieldsLabel for custom fields accordion.Custom fields
typeLabel for type input in related relationship.Type
relationshipLabel for relationship input in related relationship.Relationship
entityLabel for entity input in related relationship.Entity
keyDynamicFieldsLabel for key input.Key
valueDynamicFieldsLabel for value input.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 accordionUpload Image
sportal365ImagesLabel for sportal365 images buttonSportal365 Images
searchLabel for search buttonSearch
searchImagePlaceholder for input search in sportal365Search image
hideFiltersLabel for hide filters for sportal365 images hyperlinkHide filters
showFiltersLabel for show filters for sportal365 images hyperlinkShow filters
urlCopiedToClipboardMessageToast info message when image URL is copiedURL copied to clipboard
imageDeletedMessageToast info message when image is deletedImage deleted
imageResetMessageToast info message when image size is restoredThe initial size of the image has been restored
uploadingImageMessageToast success message when uploading image to bucketYou 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 bucketThere was a problem with uploading image to bucket. Please try again
encryptingImageErrorMessageToast error message when encrypting image before uploading it to bucketThere was a problem with encrypting image before uploading it to bucket. Please try again
searchSportal365ImagesErrorMessageToast error message when searching images from Sportal 365 APIThere was a problem with searching images from Sportal 365 API. Please try again
clearImageTooltip for clear image buttonClear image
copyUrlTooltip for copy url image buttonCopy URL
viewImageTooltip for view image buttonView image
cropImageTooltip for crop image buttonCrop image
aspectRatioLabel for aspect ratio selectAspect ratio
cropLabel for crop buttonCrop
resetLabel for reset buttonReset
hideMoreImagesLabel for hide more images hyperlinkHide more images
showMoreImagesLabel for show more images hyperlinkShow more images
addImagesLabel for toggle button to show imagesAdd images
participantsDescriptionDescription for participants tabAdd participants to the game.
additionalFieldsHeading text for toggle actions on participantsAdditional fields
addParticipantLabel for add participant buttonAdd participant
participantNumberPlaceholder text when no participant is fulfilledParticipant number
groupLabel for group inputGroup
undecidedLabel for undecided toggle switchUndecided
removeParticipantLabel for remove participant buttonRemove participant
relatedLabel for related accordionRelated
rulesLabel for rules accordionRules
timeFormatTime format for displaying dates. Widgets uses dayjs as a date dependency.DD.MM.YYYY, HH:mm
editUsed as a tooltip on edit button.Edit
cloneUsed as label on clone button.Clone
closeLabel for close buttonClose
pageNoLabel for paginationPage No
saveLabel for save buttonSave
resolvePredictionsTooltip for resolve predictions buttonResolve predictions
addLabel for tooltip add button.Add
deleteLabel for delete buttonDelete
cloneGameTitleTitle on cloning modalClone Standing Game
outcomeLabel for outcome tabOutcome
dragToReorderTooltip for drag handleDrag to reorder
noItemsToDisplayParagraph when no items are available in outcomeNo items to display
provideIdGameErrorMessageToast error message when no ID is provided when cloning a gameYou need to provide an ID to your game!
provideTitleGameErrorMessageToast error message when no title is provided when cloning a gameYou need to provide a title to your game!
gamesErrorMessageToast error message when request for fetching games failsThere was a problem retrieving information about the games.
createGameMessageWhen creating a game displaying a toast successful message for created game.You have successfully created a game.
editGameMessageWhen editing a game displaying a toast successful message for edited game.You have successfully edited a game.
createGameErrorMessageWhen creating a game displaying a toast error message.There was a problem with creating the game. Please try again.
editGameErrorMessageWhen editing a game displaying a toast error message.There was a problem with editing the game. Please try again.
requiredFieldValidationMessageCommon error toast validation message when main required field is missing.The following field is required:
participantsValidationMessageError toast validation message for participants. participantNumber and propertyLabel are variables provided from the widget. The propertyLabel can be labels set for id and name.Participant participantNumber: propertyLabel is required!
relatedEntitiesErrorMessageError toast message when request to fetch entities for related failsThere was a problem with fetching entities for related. Please try again.
predictionsStartingToResolveInfoMessageInfo toast message for resolving predictions per game. gameTitle is a variable provided from the widget.Predictions for game gameTitle are starting to resolve. Keep in mind that this operation can take a while if there are thousands of predictions.
resolvingPredictionsInProgressInfoMessageInfo toast message for resolving predictions in progress per gameResolving game predictions is already in progress...
resolvingPredictionsMessageSuccess toast message for resolving predictions per game. gameTitle is a variable provided from the widget. predictionsLength is a number that comes from API response.Predictions for game gameTitle are successfully resolved! Total resolved predictions: predictionsLength