Configuration Management
Welcome to Fans United Configuration Management Widget. The widget allows staff members with sufficient permissions to update their different configurations. You can use this widget as it is and embed it in your platform, or you can use the Management Panel to manage your configuration. With successful installation, you can manage your language, cache TTL and football assets configurations.
Installation and usage
The easiest way to use fansunited-widget-client-configuration is to install it from npm as follows:
npm install fansunited-widget-client-configurationor:
yarn add fansunited-widget-client-configurationHere is an example how you can integrate Fans United Classic Quiz Management Widget:
import { ConfigurationManager } from 'fansunited-widget-client-configuration';
const App = () => {
return (
<ConfigurationManager
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.
-
Easy translation in every language. For more information check our Translation heading.
Props
type ConfigurationManagerProps = {
fansUnitedApiKey: string;
fansUnitedClientId: string;
fansUnitedLanguage?: string;
fansUnitedEnvironment?: string;
labels?: LabelsModel;
hideSignOutButton?: boolean;
sportal365Project?: string;
sportal365Infrastructure?: 'shared' | 'betway';
};Fans United Classic Quiz 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, watg and yolo. 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 Match Quiz Management Widget is available in English so if no value is given, the widget will be translated in English. -
hideSignOutButton- By default on the top right corner of the widget will be displayed a sign out button. To hide that button set this prop to true. -
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 .
Translation
You can easily translate Fans United Configuration 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 { ConfigurationManager } from 'fansunited-widget-client-configuration';
const labels = {
clientConfigErrorMessage: "There was a problem fetching client's configuration. Please try again",
userNotFound: 'User not found. Please try again',
signOut: 'Sign Out',
language: 'Language',
profilePreferences: 'Profile Preferences',
cacheTTL: 'Cache TTL',
footballAssets: 'Football Assets',
soon: 'Soon',
update: 'Update Configuration',
configTitle: 'Configure Fans United',
configDescription: 'Customize different features of Fans United',
configLanguageTitle: 'Language Configuration',
defaultLanguage: 'Default language',
defaultLanguageHelperText: 'What is the default language of your content? This field, if different from English, would be used in our translation tools.',
availableLanguages: 'Available languages',
availableLanguagesHelperText: 'In case your project is multi-lingual, select the available languages for your app.',
translationRules: 'Translation rules',
translationRulesHelperText: 'Select the default status when a game is automatically translated.',
gameStatus: 'Game status',
active: 'Active',
inactive: 'Inactive',
updateConfigMessage: 'You have successfully updated Language configuration',
updateConfigErrorMessage: 'There was a problem updating configuration. Please try again',
categories: 'Categories',
delete: 'Delete',
id: 'ID',
name: 'Name',
addCategory: 'Add Category',
preferences: 'Preferences',
addPreference: 'Add Preference',
selectCategories: 'Select categories for new preference',
uniqueCategoriesIdErrorMessage: `Categories' IDs must be unique!`,
uniquePreferencesIdErrorMessage: `Preferences' IDs must be unique!`,
uploadImage: 'Upload Image',
sportal365Images: 'Sportal365 Images',
search: 'Search',
clearImage: 'Clear image',
copyUrl: 'Copy URL',
viewImage: 'View image',
cropImage: 'Crop image',
aspectRatio: 'Aspect ratio',
crop: 'Crop',
reset: 'Reset',
urlCopiedToClipboardMessage: 'URL copied to clipboard',
imageDeletedMessage: 'Image deleted',
imageResetMessage: 'The initial size of the image has been restored',
fromDate: 'From Date',
toDate: 'To Date',
uploadingImageMessage: 'You have successfully uploaded image',
uploadingImageErrorMessage: 'There was a problem with uploading image to bucket. Please try again',
generateSignedInUrlErrorMessage: 'There was a problem generating signed in URL to store the image in bucket. Please try again',
encryptingImageErrorMessage: 'There was a problem with encrypting image before uploading it to bucket. Please try again',
searchImage: 'Search image',
hideFilters: 'Hide filters',
showFilters: 'Show filters',
searchSportal365ImagesErrorMessage: 'There was a problem with searching images from Sportal 365 API. Please try again',
previous: 'Previous',
next: 'Next'
};
const App = () => {
return (
<ConfigurationManager
fansUnitedApiKey={'your-api-key'}
fansUnitedClientId={'your-client-id'}
labels={labels}/>
);
}Here is all information about LabelsModel:
| Key | Description | Default Value |
|---|---|---|
clientConfigErrorMessage | Toast error message when fetching client configuration fails. | There was a problem fetching client's configuration. Please try again |
userNotFound | On login screen when client gives invalid information about email or password. | User not found. Please try again |
signOut | Label for sign out button. | Sign Out |
language | Label for language tab. | Language |
profilePreferences | Label for profile preferences tab. | Profile Preferences |
cacheTTL | Label for cache TTL tab. | Cache TTL |
footballAssets | Label for football assets tab. | Football Assets |
soon | Label for soon chip on tabs. | Soon |
update | Label for management button. | Update Configuration |
configTitle | Title of the management screen. | Configure Fans United |
configDescription | Description of the management screen. | Customize different features of Fans United |
configLanguageTitle | Title for language configuration section. | Language Configuration |
defaultLanguage | Label for default language select. | Default language |
defaultLanguageHelperText | Description for default language select. | What is the default language of your content? This field, if different from English, would be used in our translation tools. |
availableLanguages | Label for available languages group container. | Available languages |
availableLanguagesHelperText | Description for available languages container. | In case your project is multi-lingual, select the available languages for your app. |
translationRules | Label for translation rules table. | Translation rules |
translationRulesHelperText | Description for translation rules table. | Select the default status when a game is automatically translated. |
gameStatus | Label for column in translation rules table. | Game status |
active | Label for status option. | Active |
inactive | Label for status option. | Inactive |
updateConfigMessage | Toast success message when updating client configuration. | You have successfully updated Language configuration |
updateConfigErrorMessage | Toast error message when updating client configuration fails. | There was a problem updating configuration. Please try again |
categories | Title for categories section in profile preferences | Categories |
delete | Tooltip for chip delete button | Delete |
id | ID input title | ID |
name | Name input title | Name |
addCategory | Add new category button title | Add Category |
preferences | Title for preferences section in profile preferences | Preferences |
addPreference | Add new preference button title | Add Preference |
selectCategories | Info text for selecting categories for new preference creation | Select categories for new preference |
uniqueCategoriesIdErrorMessage | Error validation message when new category added doesn't have unique ID | Categories' IDs must be unique! |
uniquePreferencesIdErrorMessage | Error validation message when new preference added doesn't have unique ID | Preferences' IDs must be unique! |
uploadImage | Label for upload image tab in image upload card | Upload Image |
sportal365Images | Label for Sportal365 images tab in image upload card | Sportal365 Images |
search | Label for search button | Search |
clearImage | Label for clear image button | Clear image |
copyUrl | Label for copy URL button | Copy URL |
viewImage | Label for view image button | View image |
cropImage | Label for crop image button | Crop image |
aspectRatio | Label for aspect ratio input | Aspect ratio |
crop | Label for crop button in crop modal | Crop |
reset | Label for reset button in crop modal | Reset |
urlCopiedToClipboardMessage | Toast success message when URL is copied to clipboard | URL copied to clipboard |
imageDeletedMessage | Toast success message when image is deleted | Image deleted |
imageResetMessage | Toast success message when image is reset to initial size | The initial size of the image has been restored |
fromDate | Label for from date filter in Sportal365 images | From Date |
toDate | Label for to date filter in Sportal365 images | To Date |
uploadingImageMessage | Toast success message when image is uploaded | You have successfully uploaded image |
uploadingImageErrorMessage | Toast error message when uploading image fails | There was a problem with uploading image to bucket. Please try again |
generateSignedInUrlErrorMessage | Toast error message when generating signed URL fails | There was a problem generating signed in URL to store the image in bucket. Please try again |
encryptingImageErrorMessage | Toast error message when encrypting image fails | There was a problem with encrypting image before uploading it to bucket. Please try again |
searchImage | Placeholder for search image input | Search image |
hideFilters | Label for hide filters button in Sportal365 images | Hide filters |
showFilters | Label for show filters button in Sportal365 images | Show filters |
searchSportal365ImagesErrorMessage | Toast error message when searching Sportal365 images fails | There was a problem with searching images from Sportal 365 API. Please try again |
previous | Label for previous page button in Sportal365 images pagination | Previous |
next | Label for next page button in Sportal365 images pagination | Next |
Updated 3 days ago
