You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
5.6 KiB
129 lines
5.6 KiB
/**
|
|
* Constants for AccountViewView component
|
|
* Centralizes magic strings and provides type safety
|
|
*/
|
|
|
|
export const ACCOUNT_VIEW_CONSTANTS = {
|
|
// Error messages
|
|
ERRORS: {
|
|
PROFILE_NOT_AVAILABLE: "Your server profile is not available.",
|
|
PROFILE_LOAD_ERROR:
|
|
"See the Help page about errors with your personal data.",
|
|
BROWSER_NOTIFICATIONS_UNSUPPORTED:
|
|
"This browser does not support notifications. Use Chrome, or install this to the home screen, or try other suggestions on the 'Troubleshoot your notifications' page.",
|
|
IMAGE_DELETE_PROBLEM:
|
|
"There was a problem deleting the image. Contact support if you want it removed from the servers.",
|
|
IMAGE_DELETE_ERROR: "There was an error deleting the image.",
|
|
SETTINGS_UPDATE_ERROR:
|
|
"Unable to update your settings. Check claim limits again.",
|
|
IMPORT_ERROR: "There was an error reading that Dexie file.",
|
|
EXPORT_ERROR: "There was an error exporting the data.",
|
|
PROFILE_SAVE_ERROR: "There was an error saving your profile.",
|
|
PROFILE_DELETE_ERROR: "There was an error deleting your profile.",
|
|
PROFILE_NOT_SAVED: "Profile not saved",
|
|
PROFILE_NOT_DELETED: "Profile not deleted",
|
|
UNABLE_TO_LOAD_PROFILE: "Unable to load profile.",
|
|
},
|
|
|
|
// Success messages
|
|
SUCCESS: {
|
|
PROFILE_SAVED: "Your profile has been updated successfully.",
|
|
PROFILE_DELETED: "Your profile has been deleted successfully.",
|
|
IMPORT_COMPLETE: "Import Complete",
|
|
PROFILE_DELETED_SILENT: "Your profile has been deleted successfully.",
|
|
},
|
|
|
|
// Info messages
|
|
INFO: {
|
|
PROFILE_INFO:
|
|
"This data will be published for all to see, so be careful what your write. Your ID will only be shared with people who you allow to see your activity.",
|
|
NO_PROFILE_LOCATION: "No profile location is saved.",
|
|
RELOAD_VAPID:
|
|
"Now reload the app to get a new VAPID to use with this push server.",
|
|
},
|
|
|
|
// Warning messages
|
|
WARNINGS: {
|
|
IMAGE_DELETE_WARNING:
|
|
"Note that anyone with you already as a contact will no longer see a picture, and you will have to reshare your data with them if you save a new picture. Are you sure you want to delete your profile picture?",
|
|
ERASE_LOCATION_WARNING:
|
|
"Are you sure you don't want to mark a location? This will erase the current location.",
|
|
DELETE_PROFILE_WARNING:
|
|
"Are you sure you want to delete your public profile? This will remove your description and location from the server, and it cannot be undone.",
|
|
IMPORT_REPLACE_WARNING:
|
|
"This will replace all settings and contacts, so we recommend you first do the backup step above. Are you sure you want to import and replace all contacts and settings?",
|
|
},
|
|
|
|
// Notification messages
|
|
NOTIFICATIONS: {
|
|
NEW_ACTIVITY_INFO: `
|
|
This will only notify you when there is new relevant activity for you personally.
|
|
Note that it runs on your device and many factors may affect delivery,
|
|
so if you want a reliable but simple daily notification then choose a 'Reminder'.
|
|
Do you want more details?
|
|
`,
|
|
REMINDER_INFO: `
|
|
This will notify you at a specific time each day.
|
|
Note that it does not give you personalized notifications,
|
|
so if you want less reliable but personalized notification then choose a 'New Activity' Notification.
|
|
Do you want more details?
|
|
`,
|
|
},
|
|
|
|
// UI text
|
|
UI: {
|
|
COPIED: "Copied",
|
|
SENT: "Sent...",
|
|
RECORDING_GIVE: "Recording the give...",
|
|
RECORDING_OFFER: "Recording the offer...",
|
|
},
|
|
|
|
// Limits messages
|
|
LIMITS: {
|
|
NO_IDENTIFIER: "You have no identifier, or your data has been corrupted.",
|
|
NO_LIMITS_FOUND: "No limits were found, so no actions are allowed.",
|
|
NO_IMAGE_ACCESS: "You don't have access to upload images.",
|
|
CANNOT_UPLOAD_IMAGES: "You cannot upload images.",
|
|
BAD_SERVER_RESPONSE: "Bad server response.",
|
|
ERROR_RETRIEVING_LIMITS:
|
|
"No limits were found, so no actions are allowed. You will need to get registered.",
|
|
},
|
|
|
|
// Project assignment errors
|
|
PROJECT_ERRORS: {
|
|
MISSING_PROJECT:
|
|
"To assign to a project, you must open this page through a project.",
|
|
CONFLICT_RECIPIENT:
|
|
"You cannot assign both to a project and to a recipient.",
|
|
MISSING_RECIPIENT:
|
|
"To assign to a recipient, you must open this page from a contact.",
|
|
CONFLICT_PROJECT: "You cannot assign both to a recipient and to a project.",
|
|
},
|
|
|
|
// Giver/Recipient errors
|
|
GIVER_RECIPIENT_ERRORS: {
|
|
MISSING_GIVER: "To assign a giver, you must open this page from a contact.",
|
|
CONFLICT_PROJECT_GIVER: "You cannot assign both a giver and a project.",
|
|
MISSING_RECIPIENT_GIFT:
|
|
"To assign to a recipient, you must open this page from a contact.",
|
|
CONFLICT_PROJECT_RECIPIENT:
|
|
"You cannot assign both to a recipient and to a project.",
|
|
MISSING_PROVIDER_PROJECT:
|
|
"To select a project as a provider, you must open this page through a project.",
|
|
CONFLICT_GIVING_PROJECT:
|
|
"You cannot select both a giving project and person.",
|
|
MISSING_FULFILLS_PROJECT:
|
|
"To assign to a project, you must open this page through a project.",
|
|
CONFLICT_FULFILLS_PROJECT:
|
|
"You cannot assign both to a project and to a recipient.",
|
|
},
|
|
} as const;
|
|
|
|
// Type for accessing constants
|
|
export type AccountViewConstants = typeof ACCOUNT_VIEW_CONSTANTS;
|
|
|
|
// Helper type for error messages
|
|
export type ErrorMessageKey = keyof typeof ACCOUNT_VIEW_CONSTANTS.ERRORS;
|
|
export type SuccessMessageKey = keyof typeof ACCOUNT_VIEW_CONSTANTS.SUCCESS;
|
|
export type InfoMessageKey = keyof typeof ACCOUNT_VIEW_CONSTANTS.INFO;
|
|
export type WarningMessageKey = keyof typeof ACCOUNT_VIEW_CONSTANTS.WARNINGS;
|
|
|