Skip to content

Commit

Permalink
Merge branch 'main' into PMM-12545-dbaas-removal-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
YashSartanpara1 authored Nov 28, 2023
2 parents e5b3d16 + 213b1a9 commit ecf46e0
Show file tree
Hide file tree
Showing 59 changed files with 2,273 additions and 117 deletions.
127 changes: 119 additions & 8 deletions .betterer.results
Original file line number Diff line number Diff line change
Expand Up @@ -5742,6 +5742,124 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
[0, 0, 0, "Do not use any type assertions.", "12"]
],
"public/app/percona/add-instance/components/AddRemoteInstance/AddRemoteInstance.service.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"],
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
],
"public/app/percona/backup/components/BackupInventory/RestoreBackupModal/RestoreBackupModal.service.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/percona/check/components/AllChecksTab/ChangeCheckIntervalModal/ChangeCheckIntervalModal.constants.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/percona/check/components/AllChecksTab/CheckActions/CheckActions.types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/percona/dbaas/components/DBCluster/DBCluster.service.utils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"public/app/percona/dbaas/components/DBCluster/DBClusterLogsModal/DBClusterLogsModal.utils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"]
],
"public/app/percona/dbaas/components/DBCluster/EditDBClusterPage/hooks/useEditDBClusterFormSubmit.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/percona/dbaas/components/DBCluster/ResourcesBar/ResourcesBar.utils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/percona/dbaas/components/Kubernetes/ColumnRenderers/ColumnRenderers.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/percona/dbaas/components/Kubernetes/ManageComponentsVersionsModal/ManageComponentsVersions.utils.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"]
],
"public/app/percona/inventory/Tabs/Services/ClusterItem.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/percona/inventory/Tabs/Services/Clusters.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/percona/inventory/Tabs/Services/Clusters.utils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/percona/pmm-dump/PMMDump.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"public/app/percona/pmm-dump/SendToSupportModal.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/percona/settings/components/Advanced/Advanced.utils.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/percona/settings/components/Communication/Email/Email.utils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"public/app/percona/shared/components/Elements/ExpandableCell/ExpandableCell.types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/percona/shared/components/Form/FieldAdapters/Field.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"public/app/percona/shared/components/Form/FieldAdapters/FieldAdapters.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/percona/shared/components/Form/FormElement/FormElement.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/percona/shared/components/Form/MultiCheckbox/MultiCheckboxField.types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/percona/shared/core/reducers/dbaas/addDBCluster/addDBCluster.types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/percona/shared/helpers/cron/cron.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/percona/shared/helpers/promises.test.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/percona/shared/helpers/promises.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
],
"public/app/percona/shared/helpers/testUtils.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
],
"public/app/percona/shared/helpers/validator.types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
],
"public/app/percona/shared/helpers/validators.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
],
"public/app/plugins/datasource/alertmanager/DataSource.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
Expand Down Expand Up @@ -6767,11 +6885,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"]
],
"public/app/plugins/datasource/mssql/response_parser.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"]
],
"public/app/plugins/datasource/mysql/datasource.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
Expand Down Expand Up @@ -7026,9 +7139,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "11"],
[0, 0, 0, "Unexpected any. Specify a different type.", "12"],
[0, 0, 0, "Unexpected any. Specify a different type.", "13"],
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
[0, 0, 0, "Unexpected any. Specify a different type.", "15"],
[0, 0, 0, "Unexpected any. Specify a different type.", "16"]
[0, 0, 0, "Unexpected any. Specify a different type.", "14"]
],
"public/app/plugins/datasource/postgres/module.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:

- name: Attaching artifacts
if: ${{ always() }}
uses: percona-platform/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ui-tests-output
path: ./pmm-ui-tests/tests/output
1 change: 1 addition & 0 deletions packages/grafana-data/src/types/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const availableIconsIndex = {
github: true,
gitlab: true,
okta: true,
brain: true,
anchor: true,
'angle-double-down': true,
'angle-double-right': true,
Expand Down
1 change: 1 addition & 0 deletions packages/grafana-ui/src/components/Icon/cached.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"unicons/book",
"unicons/book-open",
"unicons/brackets-curly",
"unicons/brain",
"unicons/bug",
"unicons/building",
"unicons/calculator-alt",
Expand Down
7 changes: 7 additions & 0 deletions public/app/core/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export interface FooterLink {

export let getFooterLinks = (): FooterLink[] => {
return [
{
id: 'pmm-dump',
text: 'PMM Dump',
icon: 'brain',
url: '/graph/pmm-dump',
target: '_self',
},
{
id: 'pmm-logs',
text: 'PMM Logs',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const PostgreSQLAdditionalOptions: FC<PostgreSQLAdditionalOptionsProps> =
const validators = [platformCoreValidators.containsNumber, ...platformCoreValidators.int32];

const getAutoDiscoveryLimitValue = (type: AutoDiscoveryOptionsInterface) =>
type === AutoDiscoveryOptionsInterface.enabled ? 0 : type === AutoDiscoveryOptionsInterface.disabled ? -1 : 10;
type === AutoDiscoveryOptionsInterface.disabled ? -1 : 10;

useEffect(() => {
setSelectedValue(selectedOption);
Expand Down
15 changes: 14 additions & 1 deletion public/app/percona/backup/Backup.messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@ export const Messages = {
created: 'Created',
location: 'Location',
vendor: 'DB Technology',
status: 'Status',
status: {
name: 'Status',
options: {
success: 'Success',
error: 'Error',
pending: 'Pending',
paused: 'Paused',
invalid: 'Invalid',
inProgress: 'In Progress',
failedToDelete: 'Failed To Delete',
failedNotSupportedByAgent: 'Failed Not Supported By Agent',
deleting: 'Deleting',
},
},
actions: 'Actions',
type: 'Type',
},
Expand Down
16 changes: 8 additions & 8 deletions public/app/percona/backup/Backup.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ export const formatDataModel = (model: DataModel): string => {
return map[model] ?? '';
};

export const formatBackupMode = (mode: BackupMode): string => {
const map: Record<BackupMode, string> = {
[BackupMode.SNAPSHOT]: backupModeMsg.full,
[BackupMode.INCREMENTAL]: backupModeMsg.incremental,
[BackupMode.PITR]: backupModeMsg.pitr,
[BackupMode.INVALID]: backupModeMsg.invalid,
};
export const BackupModeMap: Record<BackupMode, string> = {
[BackupMode.SNAPSHOT]: backupModeMsg.full,
[BackupMode.INCREMENTAL]: backupModeMsg.incremental,
[BackupMode.PITR]: backupModeMsg.pitr,
[BackupMode.INVALID]: backupModeMsg.invalid,
};

return map[mode] || map[BackupMode.INVALID];
export const formatBackupMode = (mode: BackupMode): string => {
return BackupModeMap[mode] || BackupModeMap[BackupMode.INVALID];
};

export const formatLocationsToMap = (locations: StorageLocation[]) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import { BackupInventory } from './BackupInventory';
jest.mock('./BackupInventory.service');
jest.mock('app/percona/backup/components/StorageLocations/StorageLocations.service');
jest.mock('../../hooks/recurringCall.hook');
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useLocation: () => ({
pathname: '/',
}),
}));

describe('BackupInventory', () => {
it('should send correct data to Table', async () => {
Expand Down
Loading

0 comments on commit ecf46e0

Please sign in to comment.