Profile Management
Welcome to Fans United Profile Management Widget. The widget allows staff members with sufficient permissions to manage user profiles. You can use this widget as it is and embed it in your platform, or you can use the Management Panel to manage user profiles. With successful installation, you can manage user profiles.
Installation and usage
The easiest way to use fansunited-widget-profile-management is to install it from npm as follows:
npm install fansunited-widget-profileor:
yarn add fansunited-widget-profileHere is an example how you can integrate Fans United Profile Management Widget:
import 'fansunited-widget-profile/style.css';
import { ProfileManager } from 'fansunited-widget-profile';
const App = () => {
return (
<ProfileManager
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.cssfile from package folder:
import 'fansunited-widget-profile/style.css';
N.B: If you are using an entry point for importing all your stylings, you need to import fansunited-widget-profile/style.css there as well
- Easy translation in every language. For more information check our Translation heading.
Props
type ProfileManagerProps = {
fansUnitedApiKey: string;
fansUnitedClientId: string;
fansUnitedLanguage?: string;
fansUnitedEnvironment?: string;
sportal365Project?: string;
sportal365Infrastructure?: 'shared' | 'betway';
labels?: LabelsModel;
hideSignOutButton?: boolean;
};Fans United Profile 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 Profile 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- 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.
Translation
You can easily translate Fans United Profile 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-profile/style.css';
import { ProfileManager } from 'fansunited-widget-profile';
const labels = {
featureDisabled: 'Feature disabled!',
noPermissionMessage: 'You have no permission for this feature!',
tryAgainButton: 'Try again',
userNotFound: 'User not found. Please try again',
signOut: 'Sign out',
searchById: 'Search by ID',
searchByName: 'Search by name/nickname',
getProfilesErrorMessage: 'There was a problem with fetching profiles data',
export: 'Export',
exportUsers: 'Export users',
exportUsersDescription: 'Export a list of users who have selected sports-related interest (competitions, teams, players) in their profile settings. Search for teams, players and competitions.',
exportAll: 'All',
exportAllText: 'Export profiles that have all of your selected sports interests.',
exportAtLeastOne: 'At least one',
exportAtLeastOneText: 'Export profiles that have at least one of your selected sports interests.',
exportFavourite: 'Favourite',
exportFavouriteText: 'Export profiles that have all of your selected sports interests marked as favourites.',
usersExportMessage: 'Users have been exported successfully',
usersExportErrorMessage: 'There was a problem with exporting users. Please try again',
user: 'User',
statistics: 'Statistics',
actions: 'Actions',
additionalInformation: 'Additional information',
banned: 'BANNED',
points: 'Points',
predictions: 'Predictions',
successRate: 'Success rate',
totalPosts: 'Total posts',
miniGamesParticipation: 'Mini games participation',
classicQuizzes: 'Classic Quizzes',
eitherOrs: 'Either/Ors',
stats: 'Stats',
discussions: 'Discussions',
predictionActivity: 'Prediction Activity',
miniGames: 'Mini Games',
comingSoon: 'Coming soon',
verified: 'Verified',
staffMember: 'Staff member',
moderatePosts: 'Moderate posts',
banFromDiscussions: 'Ban from Discussions',
unbanFromDiscussions: 'Unban from Discussions',
verify: 'Verify',
unverify: 'Unverify',
markAsStaffMember: 'Mark profile as staff member',
unmarkAsStaffMember: 'Unmark profile as staff member',
moderateProfileTitle: 'Moderate user posts',
moderateProfileDescription: 'The following operation will moderate all posts for the user',
reason: 'Reason',
moderate: 'Moderate',
moderateProfileMessage: 'User profile has been moderated',
moderateProfileErrorMessage: 'There was a problem with moderating profile. Please try again',
banProfileTitle: 'Ban user ',
unbanProfileTitle: 'Unban user ',
banPeriod: 'Ban period in days',
day: 'day',
days: 'days',
indefinite: 'INDEFINITE',
customPeriod: 'Custom period',
timeFormat: 'DD.MM.YYYY, HH:mm',
bannedAt: 'Banned at',
bannedPeriod: 'Banned period',
bannedReason: 'Banned reason',
banReason: 'Ban reason',
unbanReason: 'Unban reason',
ban: 'Ban',
unban: 'Unban',
banProfileMessage: 'User profile has been banned',
banProfileErrorMessage: 'There was a problem with banning profile. Please try again',
unbanProfileMessage: 'User profile has been unbanned',
unbanProfileErrorMessage: 'There was a problem with unbanning profile. Please try again',
verifyProfileTitle: 'Verify profile',
verifyProfileDescription: 'Are you sure you want to verify the following profile:',
unverifyProfileTitle: 'Unverify profile',
unverifyProfileDescription: 'Are you sure you want to unverify the following profile:',
verifyProfileMessage: 'User profile has been verified',
verifyProfileErrorMessage: 'There was a problem with verifying profile. Please try again',
unverifyProfileMessage: 'User profile has been unverified',
unverifyProfileErrorMessage = 'There was a problem with unverifying profile. Please try again',
markAsStaffMemberTitle: 'Mark profile as staff member',
markAsStaffMemberDescription: 'Are you sure you want to mark the following profile as a staff member:',
unmarkAsStaffMemberTitle: 'Unmark profile as staff member',
unmarkAsStaffMemberDescription: 'Are you sure you want to unmark the following profile as a staff member:',
markAsStaffMemberMessage: 'User has been marked as a staff member',
markAsStaffMemberErrorMessage: 'There was a problem with marking user as a staff member. Please try again',
unmarkAsStaffMemberMessage: 'User has been unmarked as a staff member',
unmarkAsStaffMemberErrorMessage: 'There was a problem with unmarking user as a staff member. Please try again',
deleteProfileTitle: 'Delete user profile',
deleteProfileDescription: 'Are you sure you want to permanently delete this profile: __profileName__? This action cannot be undone. Once deleted, you will no longer be able to moderate posts, ban/unban, or perform any other actions on this user.',
delete: 'Delete',
deleted: 'DELETED',
close: 'Close',
deleteProfileMessage: 'User profile has been deleted',
deleteProfileErrorMessage: 'There was a problem with deleting profile. Please try again',
};
const App = () => {
return (
<ProfileManager
fansUnitedApiKey={'your-api-key'}
fansUnitedClientId={'your-client-id'}
labels={labels}/>
);
}Here is all information about LabelsModel:
| Key | Description | Default Value |
|---|---|---|
featureDisabled | Label for no permission card title | Feature disabled! |
noPermissionMessage | Label for no permission card paragraph | You have no permission for this feature! |
tryAgainButton | Label for no permission card button | Try again |
userNotFound | On login screen when client gives invalid information about email or password. | User not found. Please try again |
signOut | Used as label on sign out button | Sign out |
searchById | Search by Id option for profile search select | Search by ID |
searchByName | Search by name option for profile search select | Search by name/nickname |
getProfilesErrorMessage | Toast error message when problem with fetching profiles data occurs | There was a problem with fetching profiles data |
export | Export users modal action button title | Export |
exportUsers | Export users button title | Export users |
exportUsersDescription | Export users modal description text | Export a list of users who have selected sports-related interests (competitions, teams, players) in their profile settings. Search for teams, players and competitions. |
exportAll | Export users type all | All |
exportAllText | Export users type all tooltip content | Export profiles that have all of your selected sports interests. |
exportAtLeastOne | Export users type at least one | At least one |
exportAtLeastOneText | Export users type at least one tooltip content | Export profiles that have at least one of your selected sports interests. |
exportFavourite | Export users type favourite | Favourite |
exportFavouriteText | Export users type favourite tooltip content | Export profiles that have all of your selected sports interests marked as favourites. |
usersExportMessage | Toast success message when profiles are exported | Users have been exported successfully |
usersExportErrorMessage | Toas error message when problem occurs while exporting users | There was a problem with exporting users. Please try again |
user | Table header label | User |
statistics | Table header label | Statistics |
actions | Table header label | Actions |
points | Table header label | Points |
predictions | Table header label | Predictions |
successRate | Table header label | Success rate |
totalPosts | Table header label | Total posts |
miniGamesParticipation | Table header label | Mini games participation |
classicQuizzes | Row text in mini games participation column | Classic Quizzes |
eitherOrs | Row text in mini games participation column | Either/Ors |
additionalInformation | Tooltip text for row expand/collapses button | Additional information |
stats | Additional information tabs tab name | Stats |
discussions | Additional information tabs tab name | Discussions |
predictionActivity | Additional information tabs tab name | Prediction Activity |
miniGames | Additional information tabs tab name | Mini Games |
comingSoon | Additional information tabs chip text | Coming soon |
banned | Chip text showing that profile is banned | BANNED |
verified | Tooltip for the icon showing that profile is verified | Verified |
staffMember | Tooltip for the icon showing that profile is verified | Staff member |
moderatePosts | Table row action button option | Moderate posts |
banFromDiscussions | Table row action button option | Ban from Discussions |
unbanFromDiscussions | Table row action button option | Unban from Discussions |
verify | Table row action button option | Verify |
unverify | Table row action button option | Unverify |
markAsStaffMember | Table row action button option | 'Mark profile as staff member |
unmarkAsStaffMember | Table row action button option | Unmark profile as staff member |
moderateProfileTitle | Moderate profile posts modal title | Moderate user posts |
moderateProfileDescription | Moderate profile posts modal description text | The following operation will moderate all posts for the user |
reason | Moderate modal reason title | Reason |
moderate | Moderate modal action button title | Moderate |
moderateProfileMessage | Toast success message when user profile has been moderated | User profile has been moderated |
moderateProfileErrorMessage | Toast error message when problem occurs while moderating profile | There was a problem with moderating profile. Please try again |
banProfileTitle | Ban profile modal title | Ban user |
unbanProfileTitle | Unban profile modal title | Unban user |
banPeriod | Ban profile modal period selector title | Ban period in days |
day | Day label | day |
days | Days label | days |
indefinite | Indefinite period label | INDEFINITE |
customPeriod | Custom period select option | Custom period |
timeFormat | Time format using for showing date objects | DD.MM.YYYY, HH:mm |
bannedAt | Banned profile info row label | Banned at |
bannedPeriod | Banned profile info row label | Banned period |
bannedReason | Banned profile info row label | Banned reason |
banReason | Ban profile modal reason text title | Ban reason |
unbanReason | Unban profile modal reason text title | Unban reason |
ban | Ban profile modal action button title | Ban |
unban | Unban profile modal action button title | Unban |
banProfileMessage | Toast success message when profile has been banned | User profile has been banned |
banProfileErrorMessage | Toast error message when problem occurs while banning a profile | There was a problem with banning profile. Please try again |
unbanProfileMessage | Toast success message when profile has been unbanned | User profile has been unbanned |
unbanProfileErrorMessage | Toast error message when problem occurs while unbanning a profile | There was a problem with unbanning profile. Please try again |
verifyProfileTitle | Verify profile modal title | Verify profile |
verifyProfileDescription | Verify profile modal description | Are you sure you want to verify the following profile: |
unverifyProfileTitle | Unverify profile modal title | Unverify profile |
unverifyProfileDescription | Unverify profile modal description | Are you sure you want to unverify the following profile: |
verifyProfileMessage | Toast success message when profile has been verified | User profile has been verified |
verifyProfileErrorMessage | Toast error message when problem occurs while verifying a profile | There was a problem with verifying profile. Please try again |
unverifyProfileMessage | Toast success message when profile has been unverified | User profile has been unverified |
unverifyProfileErrorMessage | Toast error message when problem occurs while unverifying a profile | There was a problem with unverifying profile. Please try again |
markAsStaffMemberTitle | Mark profile as staff member modal title | Mark profile as staff member |
markAsStaffMemberDescription | Mark profile as staff member modal description | Are you sure you want to mark the following profile as a staff member: |
unmarkAsStaffMemberTitle | Unmark profile as staff member modal title | Unmark profile as staff member |
unmarkAsStaffMemberDescription | Unmark profile as staff member modal description | Are you sure you want to unmark the following profile as a staff member: |
markAsStaffMemberMessage | Toast success message when profile has been marked as a staff member | User has been marked as a staff member |
markAsStaffMemberErrorMessage | Toast error message when problem occurs while marking profile as a staff member | There was a problem with marking user as a staff member. Please try again |
unmarkAsStaffMemberMessage | Toast success message when profile has been unmarked as a staff member | User has been unmarked as a staff member |
unmarkAsStaffMemberErrorMessage | Toast error message when problem occurs while unmarking profile as a staff member | There was a problem with unmarking user as a staff member. Please try again |
deleteProfileTitle | Delete profile modal title | Delete user profile |
deleteProfileDescription | Delete profile modal description text. The placeholder profileName is split so the nickname (or name) of the profile can be displayed | Are you sure you want to permanently delete this profile: profileName? This action cannot be undone. Once deleted, you will no longer be able to moderate posts, ban/unban, or perform any other actions on this user. |
delete | Delete profile modal action button title | Delete |
deleted | Label for deleted chip | DELETED |
close | Close button title | Close |
deleteProfileMessage | Toast success message when profile has been deleted | User profile has been deleted |
deleteProfileErrorMessage | Toast error message when problem occurs while deleting profile | There was a problem with deleting profile. Please try again |
Updated 10 days ago
