Skip to content

Commit

Permalink
[UI] EVEREST-1175 Fix minor UI issues with texts (#460)
Browse files Browse the repository at this point in the history
* fix: update texts

* fix: tests

---------

Co-authored-by: Fábio Silva <[email protected]>
  • Loading branch information
dianabirs and fabio-silva authored Jun 28, 2024
1 parent 4410e73 commit a90a1bb
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ui/apps/everest/.e2e/db-cluster/db-cluster-overview.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test.describe('DB Cluster Overview', async () => {

await expect(page.getByText('Type: MySQL')).toBeVisible();
await expect(page.getByText(`Name: ${dbClusterName}`)).toBeVisible();
await expect(page.getByText('Number of nodes: 1')).toBeVisible();
await expect(page.getByText(' nodes: 1')).toBeVisible();
await expect(
page.getByText('CPU: 600m').or(page.getByText('CPU: 0.6'))
).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ test.describe('DB Cluster creation', () => {
dbName = await page.getByTestId('text-input-db-name').inputValue();

await moveForward(page);
await expect(page.getByText('Number of nodes: 3')).toBeVisible();
await expect(page.getByText(' nodes: 3')).toBeVisible();

await resourcesStepCheck(page);
await moveForward(page);
Expand All @@ -160,15 +160,15 @@ test.describe('DB Cluster creation', () => {
dbName
);
await page.getByTestId('postgresql-toggle-button').click();
await expect(page.getByText('Number of nodes: 2')).toBeVisible();
await expect(page.getByText(' nodes: 2')).toBeVisible();
// Now we change the number of nodes
await page.getByTestId('button-edit-preview-resources').click();
await page.getByTestId('toggle-button-nodes-3').click();
await page.getByTestId('toggle-button-nodes-2').click();
await page.getByTestId('button-edit-preview-basic-information').click();
// Because 2 nodes is not valid for MongoDB, the default will be picked
await page.getByTestId('mongodb-toggle-button').click();
await expect(page.getByText('Number of nodes: 3')).toBeVisible();
await expect(page.getByText(' nodes: 3')).toBeVisible();
await page.getByTestId('button-edit-preview-backups').click();

await expect(page.getByTestId('radio-option-logical')).not.toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const Messages = {
pageDescription:
'Configure the resources your new database will have access to.',
labels: {
numberOfNodes: 'Number of nodes',
numberOfNodes: ' nodes',
resourceSizePerNode: 'Resource size per node',
cpu: 'cpu',
memory: 'memory',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('DatabasePreview', () => {
expect(screen.getByText('Type: MySQL')).toBeInTheDocument();
expect(screen.getByText('Version: 1.0.0')).toBeInTheDocument();

expect(screen.queryByText('Number of nodes: 1')).not.toBeInTheDocument();
expect(screen.queryByText(' nodes: 1')).not.toBeInTheDocument();
});

it('should show values from previous steps', () => {
Expand All @@ -83,7 +83,7 @@ describe('DatabasePreview', () => {
expect(screen.getByText('Type: MySQL')).toBeInTheDocument();
expect(screen.getByText('Version: 1.0.0')).toBeInTheDocument();

expect(screen.getByText('Number of nodes: 1')).toBeInTheDocument();
expect(screen.getByText(' nodes: 1')).toBeInTheDocument();
expect(screen.getByText('CPU: 1 CPU')).toBeInTheDocument();
expect(screen.getByText('Disk: 30 GB')).toBeInTheDocument();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const ResourcesPreviewSection = ({

return (
<>
<PreviewContentText text={`Number of nodes: ${numberOfNodes}`} />
<PreviewContentText text={` nodes: ${numberOfNodes}`} />
<PreviewContentText
text={`CPU: ${Number.isNaN(parsedCPU) ? '' : `${parsedCPU} CPU`}`}
/>
Expand Down
4 changes: 2 additions & 2 deletions ui/apps/everest/src/pages/databases/DbClusterView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ export const DbClusterView = () => {
{
accessorKey: 'nodes',
id: 'nodes',
header: 'Number of nodes',
header: ' nodes',
},
{
accessorKey: 'namespace',
id: 'namespace',
header: 'Namespaces',
header: 'Namespace',
},
{
accessorKey: 'monitoringConfigName',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Messages = {
cpu: 'CPU',
memory: 'Memory',
disk: 'Disk',
nodes: 'Number of nodes',
nodes: ' nodes',
externalAccess: 'External Access',
monitoring: 'Monitoring',
enabled: 'Enabled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ export const Messages = {
name: (clusterName?: string) => `Name: ${clusterName}`,
namespace: (namespace?: string) => `Namespace: ${namespace}`,
version: (type?: string) => `Version: ${type}`,
numberOfNodes: (numberOfNodes?: number) =>
`Number of nodes: ${numberOfNodes}`,
numberOfNodes: (numberOfNodes?: number) => `Nº nodes: ${numberOfNodes}`,
cpu: (cpu?: string | number) => `CPU: ${cpu}`,
memory: (memory: string | number) => `Memory: ${memory}`,
disk: (disk: string | number) => `Disk: ${disk}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Messages = {
'Percona Everest does not store PMM credentials, so fill in both the User and Password fields.',
},
fieldPlaceholders: {
name: 'Enter Monitoring Endpoint name',
name: 'Insert Monitoring endpoint display name',
namespaces: 'Select namespaces',
endpoint: 'Enter endpoint URL',
user: 'Enter username',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Messages = {
description: 'Enter an optional description',
namespaces: 'Select namespaces',
type: 'Enter bucket name',
region: 'Enter regions',
region: 'Enter region',
url: 'Enter URL',
accessKey: 'Enter Access key',
secretKey: 'Enter Secret key',
Expand Down

0 comments on commit a90a1bb

Please sign in to comment.