Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

batches: commit signing settings UI#52907

Merged
courier-new merged 15 commits into
batches/commit-signingfrom
kr/ux-create-app
Jun 7, 2023
Merged

batches: commit signing settings UI#52907
courier-new merged 15 commits into
batches/commit-signingfrom
kr/ux-create-app

Conversation

@courier-new

@courier-new courier-new commented Jun 5, 2023

Copy link
Copy Markdown
Contributor

This PR introduces the initial settings UI components to list out GitHub App connections. As you'll see there's lots of TODOs in here to hook up parts of the workflow or link to docs as those things become available. I decided to open the PR up at this state to avoid bloating it, so treat this mostly as a UI review. 🙂

Screenshots

As a user:

image

As an admin:

image

Demonstrating some of the clean up/consistency work:

image

Test plan

Storybook coverage.

@cla-bot cla-bot Bot added the cla-signed label Jun 5, 2023
@courier-new courier-new changed the title batches: batches: settings UX Jun 5, 2023
@courier-new courier-new changed the title batches: settings UX batches: commit signing settings UX Jun 5, 2023
@courier-new courier-new self-assigned this Jun 5, 2023
@courier-new courier-new added batch-changes Issues related to Batch Changes batches-signed-commit labels Jun 5, 2023
@courier-new courier-new changed the base branch from kr/push-commit-with-app to bo/redirect-batches-github-app-settings June 5, 2023 18:40
@courier-new courier-new changed the base branch from bo/redirect-batches-github-app-settings to batches/commit-signing June 5, 2023 19:01

@st0nebreaker st0nebreaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An initial pass, left a few comments. This is very clean & easy to read, thanks Kelli!

Comment thread client/web/src/enterprise/batches/settings/CommitSigningIntegrations.tsx Outdated
Comment thread client/web/src/enterprise/batches/settings/CommitSigningIntegrations.tsx Outdated
Comment thread client/web/src/enterprise/batches/settings/CommitSigningIntegrationNode.tsx Outdated
Comment thread client/web/src/enterprise/batches/settings/backend.ts
@courier-new courier-new changed the title batches: commit signing settings UX batches: commit signing settings UI Jun 6, 2023
Comment on lines -65 to -69
<Tooltip content="Delete GitHub App">
<Button aria-label="Delete" onClick={onDelete} disabled={loading} variant="danger" size="sm">
<Icon aria-hidden={true} svgPath={mdiDelete} /> Delete
</Button>
</Tooltip>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This tooltip was extraneous.

Comment on lines -39 to +41
interface Props extends TelemetryProps {
externalServicesFromFile: boolean
allowEditExternalServicesWithFile: boolean
}
interface Props extends TelemetryProps {}

export const GitHubAppPage: FC<Props> = ({
telemetryService,
externalServicesFromFile,
allowEditExternalServicesWithFile,
}) => {
export const GitHubAppPage: FC<Props> = ({ telemetryService }) => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These props were unused.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cleanup Kelli is here. 😄

Love this improvements to our codebase.

Comment on lines -24 to +30
<Button className="text-primary text-nowrap" onClick={onClick} variant="link" aria-label={label}>
<Button
className="text-primary text-nowrap font-weight-normal"
onClick={onClick}
variant="link"
size="sm"
aria-label={label}
>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated this button a bit to make it look more like the "View on GitHub" button/link for GH Apps.

@courier-new courier-new marked this pull request as ready for review June 6, 2023 01:35
@courier-new courier-new requested a review from a team June 6, 2023 01:35
@sourcegraph-bot

sourcegraph-bot commented Jun 6, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff b154242...4a71870.

Notify File(s)
@BolajiOlajide client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.story.tsx
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.tsx
client/web/src/enterprise/batches/settings/BatchChangesSiteConfigSettingsArea.story.tsx
client/web/src/enterprise/batches/settings/BatchChangesSiteConfigSettingsArea.tsx
client/web/src/enterprise/batches/settings/CheckButton.tsx
client/web/src/enterprise/batches/settings/CodeHostConnectionNode.module.scss
client/web/src/enterprise/batches/settings/CodeHostConnectionNode.story.tsx
client/web/src/enterprise/batches/settings/CodeHostConnectionNode.tsx
client/web/src/enterprise/batches/settings/CodeHostConnections.tsx
client/web/src/enterprise/batches/settings/CommitSigningIntegrationNode.module.scss
client/web/src/enterprise/batches/settings/CommitSigningIntegrationNode.tsx
client/web/src/enterprise/batches/settings/CommitSigningIntegrations.tsx
client/web/src/enterprise/batches/settings/backend.ts
client/web/src/integration/batches.test.ts
@eseliger client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.story.tsx
client/web/src/enterprise/batches/settings/BatchChangesSettingsArea.tsx
client/web/src/enterprise/batches/settings/BatchChangesSiteConfigSettingsArea.story.tsx
client/web/src/enterprise/batches/settings/BatchChangesSiteConfigSettingsArea.tsx
client/web/src/enterprise/batches/settings/CheckButton.tsx
client/web/src/enterprise/batches/settings/CodeHostConnectionNode.module.scss
client/web/src/enterprise/batches/settings/CodeHostConnectionNode.story.tsx
client/web/src/enterprise/batches/settings/CodeHostConnectionNode.tsx
client/web/src/enterprise/batches/settings/CodeHostConnections.tsx
client/web/src/enterprise/batches/settings/CommitSigningIntegrationNode.module.scss
client/web/src/enterprise/batches/settings/CommitSigningIntegrationNode.tsx
client/web/src/enterprise/batches/settings/CommitSigningIntegrations.tsx
client/web/src/enterprise/batches/settings/backend.ts
client/web/src/integration/batches.test.ts

@sourcegraph-bot

sourcegraph-bot commented Jun 6, 2023

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@st0nebreaker st0nebreaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!! ✨ Just a small comment on mobile responsiveness & a storybook update below

> = ({ node, readOnly }) => {
const ExternalServiceIcon = defaultExternalServices[node.externalServiceKind].icon
return (
<li className={classNames(styles.node, 'list-group-item')}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Around ~790 screen width this item gets crowded & overflows (screen break depending on length of the names of course). Should we add a max-width to line break here or overflow-x?
image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh good call, yeah we can just make it wrap when it needs to.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay here's it at medium-ish size now when it starts needing to wrap:
image

And here's it at phone size, for those eager beaver site admins who wanna set up their GH App on the go:
image

Comment on lines -39 to +41
interface Props extends TelemetryProps {
externalServicesFromFile: boolean
allowEditExternalServicesWithFile: boolean
}
interface Props extends TelemetryProps {}

export const GitHubAppPage: FC<Props> = ({
telemetryService,
externalServicesFromFile,
allowEditExternalServicesWithFile,
}) => {
export const GitHubAppPage: FC<Props> = ({ telemetryService }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cleanup Kelli is here. 😄

Love this improvements to our codebase.

Comment on lines +261 to +264
swhere := where.Query(sqlf.PostgresBindVar)
for i, arg := range where.Args() {
swhere = strings.Replace(swhere, fmt.Sprintf("$%d", i+1), fmt.Sprintf("%v", arg), 1)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Creative. I love it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Heheh in case you want more context: https://github.com/sourcegraph/sourcegraph/pull/52965#discussion_r1219954089.
Everyone's favorite ORM sqlf making it REAL HARD to just get the WHERE clause of a query as a string. 😂

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the additional context.

I figured that was the case tbh but I don't think sqlf will offer an API for that because i think it's misuse can lead to sql injection.

@courier-new courier-new merged commit c6be395 into batches/commit-signing Jun 7, 2023
@courier-new courier-new deleted the kr/ux-create-app branch June 7, 2023 01:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

batch-changes Issues related to Batch Changes cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants