Skip to content

Commit dee87a3

Browse files
authored
Rename EIM to infra (#115)
1 parent 31655e4 commit dee87a3

219 files changed

Lines changed: 1395 additions & 1370 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/admin/src/components/atoms/SshHostsTable/SshHostsTable.pom.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
6+
import { infra } from "@orch-ui/apis";
77
import { ApiErrorPom, EmptyPom, TablePom } from "@orch-ui/components";
88
import { CyApiDetails, CyPom } from "@orch-ui/tests";
99
import { assignedWorkloadHostOne, instanceTwo } from "@orch-ui/utils";
@@ -16,7 +16,7 @@ type ApiAliases = "getInstanceEmpty" | "getInstance" | "getInstanceError";
1616
const instanceUrl = "**/instances*";
1717
const instanceEndpoint: CyApiDetails<
1818
ApiAliases,
19-
eim.GetV1ProjectsByProjectNameComputeInstancesApiResponse
19+
infra.GetV1ProjectsByProjectNameComputeInstancesApiResponse
2020
> = {
2121
getInstance: {
2222
route: instanceUrl,

apps/admin/src/components/atoms/SshHostsTable/SshHostsTable.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
6+
import { infra } from "@orch-ui/apis";
77
import {
88
ApiError,
99
Empty,
@@ -19,7 +19,7 @@ const dataCy = "sshHostsTable";
1919

2020
interface SshHostsTableProps {
2121
/** Local account having ssh which is getting used by the host that are displayed. */
22-
localAccount: eim.LocalAccountRead;
22+
localAccount: infra.LocalAccountRead;
2323
poll?: boolean;
2424
AggregateHostStatusRemote?: React.LazyExoticComponent<
2525
React.ComponentType<any>
@@ -29,7 +29,7 @@ const AggregateHostStatus = RuntimeConfig.isEnabled("INFRA")
2929
? React.lazy(async () => await import("EimUI/AggregateHostStatus"))
3030
: null;
3131

32-
type InstanceReadModified = eim.InstanceRead & { host?: eim.HostRead };
32+
type InstanceReadModified = infra.InstanceRead & { host?: infra.HostRead };
3333

3434
const SshHostsTable = ({
3535
localAccount,
@@ -38,7 +38,7 @@ const SshHostsTable = ({
3838
}: SshHostsTableProps) => {
3939
const cy = { "data-cy": dataCy };
4040
const filter = `has(localaccount) AND localaccount.resourceId="${localAccount.resourceId}"`;
41-
const columns: TableColumn<eim.InstanceRead>[] = [
41+
const columns: TableColumn<infra.InstanceRead>[] = [
4242
{
4343
Header: "Name",
4444
apiName: "name",
@@ -48,12 +48,12 @@ const SshHostsTable = ({
4848
{
4949
Header: "Status",
5050
accessor: (item: InstanceReadModified) => item.host!.hostStatus,
51-
Cell: (table: { row: { original: eim.InstanceRead } }) => (
51+
Cell: (table: { row: { original: infra.InstanceRead } }) => (
5252
<Suspense fallback={<SquareSpinner />}>
5353
{AggregateHostStatusRemote !== null ? (
5454
<AggregateHostStatusRemote
5555
instance={table.row.original}
56-
host={table.row.original.host as eim.HostRead}
56+
host={table.row.original.host as infra.HostRead}
5757
/>
5858
) : (
5959
"Remote Error"
@@ -69,7 +69,7 @@ const SshHostsTable = ({
6969
isLoading,
7070
isError,
7171
error,
72-
} = eim.useGetV1ProjectsByProjectNameComputeInstancesQuery(
72+
} = infra.useGetV1ProjectsByProjectNameComputeInstancesQuery(
7373
{
7474
projectName: SharedStorage.project?.name ?? "",
7575
filter,

apps/admin/src/components/atoms/SshKeyInUseByHostsCell/SshKeyInUseByHostsCell.pom.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
76
import { CyApiDetails, CyPom } from "@orch-ui/tests";
87
import { instanceOne, provisionedHostOne } from "@orch-ui/utils";
98

@@ -20,7 +19,7 @@ export const fakeSshKey =
2019
const localAccountId = "localaccount-1";
2120
const sshKeyName = "test-key-name";
2221
const currentTime = new Date().toISOString();
23-
const mockInstance: eim.InstanceRead = {
22+
const mockInstance: infra.InstanceRead = {
2423
...instanceOne,
2524
host: provisionedHostOne,
2625
localAccount: {
@@ -39,7 +38,7 @@ const generateInstanceMocks = (
3938
size = 10,
4039
mock = mockInstance,
4140
offset = 0,
42-
): eim.InstanceRead[] =>
41+
): infra.InstanceRead[] =>
4342
[...Array(size).keys()].map((index) => ({
4443
...mock,
4544
resourceId: `instance-${index + offset}`,
@@ -50,7 +49,7 @@ const instanceUrlOnLocalAccount =
5049
"**/compute/instances?filter=has%28localaccount%29*";
5150
const sshInstanceEndpoint: CyApiDetails<
5251
ApiAliases,
53-
eim.GetV1ProjectsByProjectNameComputeInstancesApiResponse
52+
infra.GetV1ProjectsByProjectNameComputeInstancesApiResponse
5453
> = {
5554
getSshInstances: {
5655
route: instanceUrlOnLocalAccount,

apps/admin/src/components/atoms/SshKeyInUseByHostsCell/SshKeyInUseByHostsCell.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
6+
import { infra } from "@orch-ui/apis";
77
import { parseError, SharedStorage } from "@orch-ui/utils";
88
import { Icon, Tooltip } from "@spark-design/react";
99
import { ToastState } from "@spark-design/tokens";
@@ -15,7 +15,7 @@ import "./SshKeyInUseByHostsCell.scss";
1515
const dataCy = "sshKeyInUseByHostsCell";
1616

1717
interface SshKeyInUseByHostsCellProps {
18-
localAccount: eim.LocalAccountRead;
18+
localAccount: infra.LocalAccountRead;
1919
}
2020

2121
const SshKeyInUseByHostsCell = ({
@@ -28,7 +28,7 @@ const SshKeyInUseByHostsCell = ({
2828
data: instanceList,
2929
isError,
3030
error,
31-
} = eim.useGetV1ProjectsByProjectNameComputeInstancesQuery({
31+
} = infra.useGetV1ProjectsByProjectNameComputeInstancesQuery({
3232
projectName: SharedStorage.project?.name ?? "",
3333
filter: `has(localaccount) AND localaccount.resourceId="${localAccount.resourceId}"`,
3434
});

apps/admin/src/components/atoms/SshKeysPopup/SshKeysPopup.pom.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
76
import { PopupPom } from "@orch-ui/components";
87
import { CyApiDetails, CyPom } from "@orch-ui/tests";
98
import { assignedWorkloadHostOne, instanceTwo } from "@orch-ui/utils";
@@ -16,7 +15,7 @@ type ApiAliases = "getInstanceEmpty" | "getInstance" | "getInstanceError";
1615
const instanceUrl = "**/instances*";
1716
const instanceEndpoint: CyApiDetails<
1817
ApiAliases,
19-
eim.GetV1ProjectsByProjectNameComputeInstancesApiResponse
18+
infra.GetV1ProjectsByProjectNameComputeInstancesApiResponse
2019
> = {
2120
getInstance: {
2221
route: instanceUrl,

apps/admin/src/components/atoms/SshKeysPopup/SshKeysPopup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
6+
import { infra } from "@orch-ui/apis";
77
import { Popup } from "@orch-ui/components";
88
import { SharedStorage } from "@orch-ui/utils";
99
import { Icon } from "@spark-design/react";
1010
import { useEffect, useState } from "react";
1111

1212
const dataCy = "sshKeysPopup";
1313
interface SshKeysPopupProps {
14-
localAccount: eim.LocalAccountRead;
14+
localAccount: infra.LocalAccountRead;
1515
onViewDetails?: () => void;
1616
onDelete?: () => void;
1717
}
@@ -24,7 +24,7 @@ const SshKeysPopup = ({
2424
const [isPopupOpen, setIsPopupOpen] = useState<boolean>(false);
2525

2626
const { data, isSuccess, refetch } =
27-
eim.useGetV1ProjectsByProjectNameComputeInstancesQuery(
27+
infra.useGetV1ProjectsByProjectNameComputeInstancesQuery(
2828
{
2929
projectName: SharedStorage.project?.name ?? "",
3030
filter: `has(localaccount) AND localaccount.resourceId="${localAccount.resourceId}"`,

apps/admin/src/components/organisms/DeleteSSHDialog/DeleteSSHDialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
6+
import { infra } from "@orch-ui/apis";
77
import { Modal } from "@orch-ui/components";
88
import { parseError, SharedStorage } from "@orch-ui/utils";
99
import { ButtonVariant, ModalSize } from "@spark-design/tokens";
@@ -12,7 +12,7 @@ import "./DeleteSSHDialog.scss";
1212
const dataCy = "deleteSSHDialog";
1313

1414
interface DeleteSSHDialogProps {
15-
ssh: eim.LocalAccountRead;
15+
ssh: infra.LocalAccountRead;
1616
onCancel: () => void;
1717
onDelete?: () => void;
1818
onError?: (err: string) => void;
@@ -30,7 +30,7 @@ const DeleteSSHDialog = ({
3030
const cy = { "data-cy": dataCy };
3131

3232
const [deleteSsh] =
33-
eim.useDeleteV1ProjectsByProjectNameLocalAccountsAndLocalAccountIdMutation();
33+
infra.useDeleteV1ProjectsByProjectNameLocalAccountsAndLocalAccountIdMutation();
3434

3535
const onDeleteSsh = () => {
3636
const sshName = ssh.sshKey;

apps/admin/src/components/organisms/SshKeysAddEditDrawer/SshKeysAddEditDrawer.pom.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
76
import { CyPom } from "@orch-ui/tests";
87

98
const dataCySelectors = [
@@ -32,7 +31,7 @@ class SshKeysAddEditDrawerPom extends CyPom<Selectors> {
3231
return this.root.find("[data-testid='drawer-header-close-btn']");
3332
}
3433

35-
fillSshForm(localAccounts: eim.LocalAccount) {
34+
fillSshForm(localAccounts: infra.LocalAccount) {
3635
this.el.sshKeyUsername.clear().type(localAccounts.username);
3736
this.el.sshPublicKey.clear().type(localAccounts.sshKey);
3837
}

apps/admin/src/components/organisms/SshKeysAddEditDrawer/SshKeysAddEditDrawer.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
6+
import { infra } from "@orch-ui/apis";
77
import {
88
Button,
99
ButtonGroup,
@@ -28,13 +28,13 @@ interface SshKeysAddEditDrawerProps {
2828
/** Is the drawer open in current state of UI. */
2929
isOpen?: boolean;
3030
/** Initial local account value (used in case of edit) */
31-
defaultLocalAccount?: eim.LocalAccountRead;
31+
defaultLocalAccount?: infra.LocalAccountRead;
3232
/** This will be executed when we ckick any of the close button or drawer backdrop. */
3333
onHide: () => void;
3434
/** This will be executed when we click the Add button */
35-
onAdd?: (ssh: eim.LocalAccount) => void;
35+
onAdd?: (ssh: infra.LocalAccount) => void;
3636
/** This will be executed when we click the Edit button */
37-
onEdit?: (ssh: eim.LocalAccountRead) => void;
37+
onEdit?: (ssh: infra.LocalAccountRead) => void;
3838
}
3939

4040
const SshKeysAddEditDrawer = ({
@@ -46,18 +46,17 @@ const SshKeysAddEditDrawer = ({
4646
}: SshKeysAddEditDrawerProps) => {
4747
const cy = { "data-cy": dataCy };
4848

49-
const resetValue: eim.LocalAccount = { username: "", sshKey: "" };
50-
const [localAccountWrite, setLocalAccountWrite] = useState<eim.LocalAccount>(
51-
defaultLocalAccount ?? resetValue,
52-
);
49+
const resetValue: infra.LocalAccount = { username: "", sshKey: "" };
50+
const [localAccountWrite, setLocalAccountWrite] =
51+
useState<infra.LocalAccount>(defaultLocalAccount ?? resetValue);
5352
const [isSshValid, setIsSshValid] = useState<boolean>(true);
5453

5554
const {
5655
control,
5756
handleSubmit,
5857
unregister,
5958
formState: { errors, isValid },
60-
} = useForm<eim.LocalAccount>({
59+
} = useForm<infra.LocalAccount>({
6160
mode: "all",
6261
values: localAccountWrite,
6362
});

apps/admin/src/components/organisms/SshKeysTable/SshKeysTable.pom.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { eim } from "@orch-ui/apis";
76
import { ApiErrorPom, EmptyPom, TablePom } from "@orch-ui/components";
87
import { SiTablePom } from "@orch-ui/poms";
98
import { CyApiDetails, CyPom } from "@orch-ui/tests";
@@ -22,7 +21,7 @@ type ApiAliases = SafeApiAliases | SshMutationApiAliases;
2221

2322
const sshListUrl = "**/localAccounts*";
2423

25-
const mockSsh: eim.LocalAccountRead = {
24+
const mockSsh: infra.LocalAccountRead = {
2625
resourceId: "ssh-abcd81",
2726
username: "test-key-name",
2827
sshKey: fakeSshKey,
@@ -37,7 +36,7 @@ const generateSshMocks = (size = 10, offset = 0, mock = mockSsh) =>
3736

3837
const safeEndpoints: CyApiDetails<
3938
SafeApiAliases,
40-
eim.GetV1ProjectsByProjectNameLocalAccountsApiResponse
39+
infra.GetV1ProjectsByProjectNameLocalAccountsApiResponse
4140
> = {
4241
getSshList: {
4342
route: sshListUrl,
@@ -63,8 +62,8 @@ const safeEndpoints: CyApiDetails<
6362

6463
const mutationEndpoints: CyApiDetails<
6564
SshMutationApiAliases,
66-
| eim.PostV1ProjectsByProjectNameLocalAccountsApiResponse
67-
| eim.DeleteV1ProjectsByProjectNameLocalAccountsAndLocalAccountIdApiResponse
65+
| infra.PostV1ProjectsByProjectNameLocalAccountsApiResponse
66+
| infra.DeleteV1ProjectsByProjectNameLocalAccountsAndLocalAccountIdApiResponse
6867
> = {
6968
postSsh: {
7069
method: "POST",

0 commit comments

Comments
 (0)