mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Sort Pod environment values in alphabetical order (#1075)
* Sort Pod environment values in alphabetical order Fixes: #739 Signed-off-by: Steve Richards <srichards@mirantis.com> * Consolidated to a single lodash import. Corrected Lint failure - Removed the additional import of flatten and updated as needed; - Changed the variabled `orderedEnv` to be a const; Signed-off-by: Steve Richards <srichards@mirantis.com> Co-authored-by: Steve Richards <srichards@mirantis.com>
This commit is contained in:
parent
087ebf6aec
commit
6e4fa31a49
@ -1,7 +1,6 @@
|
|||||||
import "./pod-container-env.scss";
|
import "./pod-container-env.scss";
|
||||||
|
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import flatten from "lodash/flatten";
|
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { Trans } from "@lingui/macro";
|
import { Trans } from "@lingui/macro";
|
||||||
import { IPodContainer, Secret } from "../../api/endpoints";
|
import { IPodContainer, Secret } from "../../api/endpoints";
|
||||||
@ -11,6 +10,7 @@ import { secretsStore } from "../+config-secrets/secrets.store";
|
|||||||
import { configMapsStore } from "../+config-maps/config-maps.store";
|
import { configMapsStore } from "../+config-maps/config-maps.store";
|
||||||
import { Icon } from "../icon";
|
import { Icon } from "../icon";
|
||||||
import { base64, cssNames } from "../../utils";
|
import { base64, cssNames } from "../../utils";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
container: IPodContainer;
|
container: IPodContainer;
|
||||||
@ -40,7 +40,9 @@ export const ContainerEnvironment = observer((props: Props) => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
const renderEnv = () => {
|
const renderEnv = () => {
|
||||||
return env.map(variable => {
|
const orderedEnv = _.sortBy(env, 'name');
|
||||||
|
|
||||||
|
return orderedEnv.map(variable => {
|
||||||
const { name, value, valueFrom } = variable
|
const { name, value, valueFrom } = variable
|
||||||
let secretValue = null
|
let secretValue = null
|
||||||
|
|
||||||
@ -89,7 +91,7 @@ export const ContainerEnvironment = observer((props: Props) => {
|
|||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
return flatten(envVars)
|
return _.flatten(envVars)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user