Skip to content

Commit

Permalink
feat: add different links to folder field (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-silva committed Jun 15, 2023
1 parent baeeb8e commit 56de6e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { Databases } from 'app/percona/shared/core';

import { BackupMode } from '../../Backup.types';

export const Messages = {
serviceName: 'Service name',
vendor: 'DB technology',
Expand Down Expand Up @@ -42,5 +46,17 @@ export const Messages = {
scheduleBackupDescription:
'Create a task that takes regular backups of a database, according to the schedule that you specify.',
folderTooltip: 'Changing the default folder, if available, is not recommended',
folderTooltipLink: 'https://www.percona.com/doc/percona-monitoring-and-management/2.x/to-be-added',
folderTooltipLink: (vendor: Databases | null, mode: BackupMode) => {
if (vendor === Databases.mysql) {
return 'https://docs.percona.com/percona-monitoring-and-management/get-started/backup/create_mysql_backup.html#folder-field';
}

if (vendor === Databases.mongodb) {
return mode === BackupMode.PITR
? 'https://docs.percona.com/percona-monitoring-and-management/get-started/backup/create_PITR_mongo.html#folder-field'
: 'https://docs.percona.com/percona-monitoring-and-management/get-started/backup/create_mongo_on_demand.html#folder-field';
}

return;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ const AddBackupPage: FC<GrafanaRouteComponentProps<{ type: string; id: string }>
label={Messages.folder}
disabled={editing}
tooltipText={Messages.folderTooltip}
tooltipLink={Messages.folderTooltipLink}
tooltipLink={Messages.folderTooltipLink(values.vendor, values.mode)}
/>
</CollapsableSection>
{!!backupErrors.length && <BackupErrorSection backupErrors={backupErrors} />}
Expand Down

0 comments on commit 56de6e8

Please sign in to comment.