1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Release 6.1.11 (#6397)

* Release 6.1.11

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Add release guide (#6374)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix crash when opening pod details (#6376)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix ReactiveDuration to update as frequently as necessary (#6375)

- When used in non compact mode (eg KubeObjectMeta's age) the seconds
  can be displayed but previously between 10m and 180m of age, the
  display would only update every minute

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-10-11 11:39:33 -04:00 committed by GitHub
parent a31f773795
commit 11e7a38823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 23 deletions

19
RELEASE_GUIDE.md Normal file
View File

@ -0,0 +1,19 @@
# Release Guide
Releases for this repository are made via running the `create-release-pr` script defined in the `package.json`.
All releases will be made by creating a PR which bumps the version field in the `package.json` and, if necessary, cherry pick the relavent commits from master.
## Prerequisites
- `yarn`
- Running `yarn` (to install all dependencies)
- `gh` (Github's CLI) with a version at least 2.15.0
## Steps
1. If you are making a minor or major release (or prereleases for one) make sure you are on the `master` branch.
1. If you are making a patch release (or a prerelease for one) make sure you are on the `release/v<MAJOR>.<MINOR>` branch.
1. Run `yarn create-release-pr <release-type>`. If you are making a subsequent prerelease release, provide the `--check-commits` flag.
1. If you are checking the commits, type `y<ENTER>` to pick a commit, and `n<ENTER>` to skip it. You will want to skip the commits that were part of previous prerelease releases.
1. Once the PR is created, approved, and then merged the `Release Open Lens` workflow will create a tag and release for you.
1. If you are making a major or minor release, create a `release/v<MAJOR>.<MINOR>` branch and push it to `origin` so that future patch releases can be made from it.

View File

@ -3,7 +3,7 @@
"productName": "OpenLens", "productName": "OpenLens",
"description": "OpenLens - Open Source IDE for Kubernetes", "description": "OpenLens - Open Source IDE for Kubernetes",
"homepage": "https://github.com/lensapp/lens", "homepage": "https://github.com/lensapp/lens",
"version": "6.1.10", "version": "6.1.11",
"main": "static/build/main.js", "main": "static/build/main.js",
"copyright": "© 2022 OpenLens Authors", "copyright": "© 2022 OpenLens Authors",
"license": "MIT", "license": "MIT",

View File

@ -18,19 +18,29 @@ export interface ReactiveDurationProps {
compact?: boolean; compact?: boolean;
} }
const everySecond = 1000;
const everyMinute = 60 * 1000;
/** /**
* This function computes a resonable update * This function computes a resonable update interval, matching `formatDuration`'s rules on when to display seconds
*/ */
function computeUpdateInterval(creationTimestampEpoch: number): number { function computeUpdateInterval(creationTimestampEpoch: number, compact: boolean): number {
const seconds = Math.floor((Date.now() - creationTimestampEpoch) / 1000); const seconds = Math.floor((Date.now() - creationTimestampEpoch) / 1000);
const minutes = Math.floor(seconds / 60); const minutes = Math.floor(seconds / 60);
if (minutes < 10) { if (minutes < 10) {
// Update every second return everySecond;
return 1000;
} }
return 60 * 1000; if (compact) {
return everyMinute;
}
if (minutes < (60 * 3)) {
return everySecond;
}
return everyMinute;
} }
export const ReactiveDuration = observer(({ timestamp, compact = true }: ReactiveDurationProps) => { export const ReactiveDuration = observer(({ timestamp, compact = true }: ReactiveDurationProps) => {
@ -42,7 +52,7 @@ export const ReactiveDuration = observer(({ timestamp, compact = true }: Reactiv
return ( return (
<> <>
{formatDuration(reactiveNow(computeUpdateInterval(timestampSeconds)) - timestampSeconds, compact)} {formatDuration(reactiveNow(computeUpdateInterval(timestampSeconds, compact)) - timestampSeconds, compact)}
</> </>
); );
}); });

View File

@ -62,13 +62,7 @@ const NonInjectedKubeObjectMeta = observer(({
<DrawerItem name="Created" hidden={isHidden("creationTimestamp")}> <DrawerItem name="Created" hidden={isHidden("creationTimestamp")}>
<KubeObjectAge object={object} compact={false} /> <KubeObjectAge object={object} compact={false} />
{" ago "} {" ago "}
{creationTimestamp && ( {creationTimestamp && <LocaleDate date={creationTimestamp} />}
<>
(
<LocaleDate date={creationTimestamp} />
)
</>
)}
</DrawerItem> </DrawerItem>
<DrawerItem name="Name" hidden={isHidden("name")}> <DrawerItem name="Name" hidden={isHidden("name")}>
{getName()} {getName()}

View File

@ -69,10 +69,10 @@ export class Menu extends React.Component<MenuProps, State> {
super(props); super(props);
autoBind(this); autoBind(this);
} }
public opener: HTMLElement | null = null; private opener: HTMLElement | null = null;
public elem: HTMLUListElement | null = null; private elem: HTMLUListElement | null = null;
protected items: { [index: number]: MenuItem } = {}; protected items: { [index: number]: MenuItem } = {};
public state: State = {}; state: State = {};
get isOpen() { get isOpen() {
return !!this.props.isOpen; return !!this.props.isOpen;
@ -88,15 +88,15 @@ export class Menu extends React.Component<MenuProps, State> {
htmlFor, htmlFor,
toggleEvent, toggleEvent,
} = this.props; } = this.props;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const elem = this.elem!;
if (!usePortal) { if (!usePortal) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion if (this.elem?.parentElement) {
const parent = elem.parentElement!; const { position } = window.getComputedStyle(this.elem.parentElement);
const position = window.getComputedStyle(parent).position;
if (position === "static") parent.style.position = "relative"; if (position === "static") {
this.elem.parentElement.style.position = "relative";
}
}
} else if (this.isOpen) { } else if (this.isOpen) {
this.refreshPosition(); this.refreshPosition();
} }