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

ui: remove $ internal from apps filter option #75470

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

maryliag
Copy link
Contributor

Previously, we had the option $ internal on the list of
Apps on filters of both Statement and Transaction pages.
We're making a change to not return internal filters anymore,
so this commit remove that option from the filter, since
it will always results on a blank table.

Release note (ui change): Remove $ internal as one of the apps
option under the Statements and Transactions page filters.

@maryliag maryliag requested a review from a team January 24, 2022 22:48
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@Azhng Azhng left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @Azhng and @maryliag)


pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.selectors.ts, line 72 at r1 (raw file):

            sqlStatsState.data.internal_app_name_prefix,
          )) ||
        sqlStatsState.data.internal_app_name_prefix == undefined

This boolean expression is getting a bit complicated, thoughts on refactoring this a bit? I'm thinking something along the line of:

const containsRegularAppName = (sqlStatsState.data.internal_app_name_prefix &&
                                  !statement.key.key_data.app.startsWith(
                                      sqlStatsState.data.internal_app_name_prefix,
                                  );
const isInternalAppNameUndefined = sqlStatsState.data.internal_app_name_prefix;

if (containsRegularAppname || isInternalAppNameUndefined) {
  // ... 
}

Previously, we had the option `$ internal` on the list of
Apps on filters of both Statement and Transaction pages.
We're making a change to not return internal filters anymore,
so this commit remove that option from the filter, since
it will always results on a blank table.

Release note (ui change): Remove `$ internal` as one of the apps
option under the Statements and Transactions page filters.
@maryliag maryliag force-pushed the remove-internal-filter branch from e83963b to 997cbfb Compare January 25, 2022 00:29
Copy link
Contributor Author

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @Azhng)


pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.selectors.ts, line 72 at r1 (raw file):

Previously, Azhng (Archer Zhang) wrote…

This boolean expression is getting a bit complicated, thoughts on refactoring this a bit? I'm thinking something along the line of:

const containsRegularAppName = (sqlStatsState.data.internal_app_name_prefix &&
                                  !statement.key.key_data.app.startsWith(
                                      sqlStatsState.data.internal_app_name_prefix,
                                  );
const isInternalAppNameUndefined = sqlStatsState.data.internal_app_name_prefix;

if (containsRegularAppname || isInternalAppNameUndefined) {
  // ... 
}

created the isNotInternalApp to make that part of the conditional easier to understand, but kept the check for undefined directly since it's too straight forward for a creation of a const just for this

Copy link
Contributor

@Azhng Azhng left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @Azhng)

@maryliag
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 25, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jan 25, 2022

Build succeeded:

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.

3 participants