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

Add alerts to site-admins when license keys are about to expire #2969

Merged
merged 3 commits into from Apr 3, 2019

Conversation

Projects
None yet
3 participants
@dadlerj
Copy link
Member

dadlerj commented Mar 25, 2019

Addresses #3016
Addresses first item from #2894

Instead of making it a non-dismissable alert, I made it re-appear every day from 7 days out.

While this example shows "7 months", it really will only appear when there are 7 or fewer days left.

image

@dadlerj dadlerj requested review from sqs and felixfbecker Mar 25, 2019

@dadlerj dadlerj force-pushed the license-warnings branch from 3292670 to 0090da6 Mar 25, 2019

@sqs

sqs approved these changes Mar 29, 2019

Copy link
Member

sqs left a comment

reviewed for product, should get a code review from a dev

@dadlerj

This comment has been minimized.

Copy link
Member Author

dadlerj commented Mar 29, 2019

@felixfbecker mind reviewing this?

@felixfbecker
Copy link
Member

felixfbecker left a comment

LGTM otherwise

className={`alert alert-warning d-flex align-items-center ${className}`}
>
<WarningIcon className="icon-inline mr-2 flex-shrink-0" />
Your Sourcegraph license will expire in {formatDistanceStrict(expiresAt, Date.now())}.&nbsp;

This comment has been minimized.

Copy link
@felixfbecker

felixfbecker Mar 29, 2019

Member

The non-breaking space doesn't make sense to me if it's followed by a newline (i.e., a breaking space)

This comment has been minimized.

Copy link
@dadlerj

dadlerj Mar 29, 2019

Author Member

Hmm, semantically perhaps this doesn't make sense, but I tried removing it, or replacing with {' '} and neither of those actually resulted in a space between the date and the next words. Is there a better way to do this?

This comment has been minimized.

Copy link
@felixfbecker

felixfbecker Mar 29, 2019

Member

I'm surprised by that. Could it be that the parent is display: flex maybe?

This comment has been minimized.

Copy link
@dadlerj

dadlerj Apr 2, 2019

Author Member

Not sure. What do you recommend? It being flex does cause some weirdness when the screen shrinks (each individual text/link block wraps on itself, not as a whole line), but I'm not sure it's in scope to add a fix for this in this PR.

This comment has been minimized.

Copy link
@felixfbecker

felixfbecker Apr 2, 2019

Member

Flex shouldn't be used if some of children are text nodes. No need to fix in this PR though.

</Link>
&nbsp;or&nbsp;
<a className="site-alert__link" href="https://about.sourcegraph.com/contact">
<span className="underline">contact Sourcegraph</span>

This comment has been minimized.

Copy link
@felixfbecker

felixfbecker Mar 29, 2019

Member

Why is this underlined? If it's a link it should have the normal consistent link style

This comment has been minimized.

Copy link
@dadlerj

dadlerj Mar 29, 2019

Author Member

Yep, it seemed strange to me at first, but we use it across all of the other alerts: https://sourcegraph.com/search?q=r:sourcegraph/sourcegraph+className%5C%3D%5C%22.*underline

Perhaps a decision was made early on that calling out the link with extra emphasis was especially important in this context

This comment has been minimized.

Copy link
@felixfbecker

This comment has been minimized.

Copy link
@dadlerj

dadlerj Apr 2, 2019

Author Member

@felixfbecker can I merge this with the underline, or should I fix that in this PR?

@dadlerj dadlerj force-pushed the license-warnings branch from 0090da6 to b7a345b Apr 2, 2019

@codecov

This comment has been minimized.

Copy link

codecov bot commented Apr 2, 2019

Codecov Report

Merging #2969 into master will decrease coverage by 0.09%.
The diff coverage is n/a.

Impacted Files Coverage Δ
cmd/frontend/backend/go_importers.go 22.22% <0%> (-37.5%) ⬇️
cmd/frontend/backend/repos_vcs.go 22.03% <0%> (-7.63%) ⬇️
cmd/frontend/backend/repos.go 28.71% <0%> (-2.98%) ⬇️

@dadlerj dadlerj merged commit 599f414 into master Apr 3, 2019

2 checks passed

buildkite/sourcegraph Build #30524 passed (9 minutes, 53 seconds)
Details
percy/Sourcegraph Visual review automatically approved, no visual changes found.
Details

@dadlerj dadlerj deleted the license-warnings branch Apr 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.