Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding database properties general tab with read-only fields #23318

Merged
merged 21 commits into from
Jun 22, 2023

Conversation

ssreerama
Copy link
Contributor

@ssreerama ssreerama commented Jun 5, 2023

This PR contains:

  1. Code changes that creates a basic general tab which displays the sample data (from objectManagmenetService.ts).

Some of the below tasks would be addressed in this PR or separate PRs

  1. Get the STS changes to use the real time values instead of sample data. (Separate PR Enabling database properties general tab with real time values from SMO sqltoolsservice#2093 )
  2. Telemetry
  3. UI Tests

Images/Videos:
NEW:
image

@ssreerama ssreerama self-assigned this Jun 5, 2023
@ssreerama ssreerama linked an issue Jun 5, 2023 that may be closed by this pull request
@ssreerama ssreerama marked this pull request as ready for review June 5, 2023 20:14
extensions/admin-tool-ext-win/package.json Outdated Show resolved Hide resolved
extensions/mssql/package.json Outdated Show resolved Hide resolved
extensions/mssql/src/mssql.d.ts Outdated Show resolved Hide resolved
extensions/mssql/src/objectManagement/commands.ts Outdated Show resolved Hide resolved
extensions/mssql/src/objectManagement/commands.ts Outdated Show resolved Hide resolved
extensions/mssql/src/objectManagement/commands.ts Outdated Show resolved Hide resolved
extensions/mssql/src/objectManagement/commands.ts Outdated Show resolved Hide resolved
@alanrenmsft
Copy link
Contributor

@ssreerama there shouldn't be a horizonal scroll bar, could you please investigate why is it there? also, looking at the content in the dialog, the vertical bar also shouldn't be there giving how much empty space are there in the screenshot.

@ssreerama
Copy link
Contributor Author

@ssreerama there shouldn't be a horizonal scroll bar, could you please investigate why is it there? also, looking at the content in the dialog, the vertical bar also shouldn't be there giving how much empty space are there in the screenshot.

It seems @barbaravaldez is already fixed both scroll bar issue in her PR, will take a look if both issues are not fixed in her PR. Thanks

extensions/mssql/src/mssql.d.ts Outdated Show resolved Hide resolved
@@ -106,8 +107,9 @@ async function handleObjectPropertiesDialogCommand(context: azdata.ObjectExplore
return;
}
try {
const parentUrn = await getParentUrn(context);
const parentUrn = context.nodeInfo ? await getParentUrn(context) : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about updating getParentUrn to possibly return undefined instead? That makes sense if there isn't a parent already

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if the ParentUrn is empty, then can we cconsider the objectUrn as a parent and update the value there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this as a follow-up - I already asked @barbaravaldez to do a separate PR for moving this into a helper function anyways and we can discuss it there.

@ssreerama ssreerama linked an issue Jun 7, 2023 that may be closed by this pull request
@ssreerama
Copy link
Contributor Author

Please, Ignore the latest commit for review, going to work on reusing the database dialog and will have a lot of refactoring.

@Charles-Gagnon
Copy link
Contributor

@ssreerama Maybe close this PR until you're ready for review? Or at least make it a draft.

@ssreerama ssreerama marked this pull request as draft June 8, 2023 20:51
@ssreerama ssreerama marked this pull request as ready for review June 13, 2023 16:28
@ssreerama ssreerama marked this pull request as draft June 13, 2023 20:36
@ssreerama ssreerama marked this pull request as ready for review June 13, 2023 22:52
@@ -106,8 +107,9 @@ async function handleObjectPropertiesDialogCommand(context: azdata.ObjectExplore
return;
}
try {
const parentUrn = await getParentUrn(context);
const parentUrn = context.nodeInfo ? await getParentUrn(context) : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this as a follow-up - I already asked @barbaravaldez to do a separate PR for moving this into a helper function anyways and we can discuss it there.

extensions/mssql/src/objectManagement/utils.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Charles-Gagnon Charles-Gagnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine for an initial PR - I'd say get this in now as it is and then create follow-up issues/PRs for addressing the other comments that came up and other functionality you need to add.

@@ -42,3 +42,8 @@ export function isValidSQLPassword(password: string, userName: string = 'sa'): b
const hasNonAlphas = /\W/.test(password) ? 1 : 0;
return !containsUserName && password.length >= 8 && password.length <= 128 && (hasUpperCase + hasLowerCase + hasNumbers + hasNonAlphas >= 3);
}

// Converts number to two decimal placed string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use actual JS doc syntax for doc comments please


// Converts number to two decimal placed string
export function convertNumToTwoDecimalStringinMB(value: number): string {
return localizedConstants.StringValueInMB(value?.toFixed(2));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If value is actually possible to be undefined then the parameter should reflect that. And in that case it'd probably be better to just return an empty string instead

@ssreerama ssreerama merged commit c8ed14f into main Jun 22, 2023
@ssreerama ssreerama deleted the 'sai/databasePropertiesInitial' branch June 22, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling General tab UI with Sample data
4 participants