diff --git a/web/src/ar/pages/version-details/GenericVersion/GenericVersionType.tsx b/web/src/ar/pages/version-details/GenericVersion/GenericVersionType.tsx index f88667f33..bfcbb551e 100644 --- a/web/src/ar/pages/version-details/GenericVersion/GenericVersionType.tsx +++ b/web/src/ar/pages/version-details/GenericVersion/GenericVersionType.tsx @@ -27,6 +27,7 @@ import GenericVersionHeader from './GenericVersionHeader' import GenericOverviewPage from './pages/overview/OverviewPage' import GenericArtifactDetailsPage from './pages/artifact-details/GenericArtifactDetailsPage' import GenericArtifactDeploymentsPage from './pages/deployments/GenericArtifactDeploymentsPage' +import OSSContentPage from './pages/oss-details/OSSContentPage' export class GenericVersionType extends VersionStep { protected packageType = RepositoryPackageType.GENERIC @@ -54,7 +55,7 @@ export class GenericVersionType extends VersionStep { case VersionDetailsTab.DEPLOYMENTS: return case VersionDetailsTab.OSS: - return <> + return default: return } diff --git a/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSArtifactDetailsContent.tsx b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSArtifactDetailsContent.tsx new file mode 100644 index 000000000..50232d869 --- /dev/null +++ b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSArtifactDetailsContent.tsx @@ -0,0 +1,34 @@ +/* + * Copyright 2024 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react' +import { Container, Text } from '@harnessio/uicore' +import { FontVariation } from '@harnessio/design-system' + +import { useStrings } from '@ar/frameworks/strings' +import GenericArtifactDetailsPage from '../artifact-details/GenericArtifactDetailsPage' + +export default function OSSArtifactDetailsContent() { + const { getString } = useStrings() + return ( + + + {getString('versionDetails.tabs.artifactDetails')} + + + + ) +} diff --git a/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSContentPage.tsx b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSContentPage.tsx new file mode 100644 index 000000000..7e4d5561c --- /dev/null +++ b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSContentPage.tsx @@ -0,0 +1,29 @@ +/* + * Copyright 2024 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react' +import { Layout } from '@harnessio/uicore' +import OSSGeneralInfoContent from './OSSGeneralInfoContent' +import OSSArtifactDetailsContent from './OSSArtifactDetailsContent' + +export default function OSSContentPage() { + return ( + + + + + ) +} diff --git a/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSGeneralInfoContent.tsx b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSGeneralInfoContent.tsx new file mode 100644 index 000000000..991f0bc38 --- /dev/null +++ b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/OSSGeneralInfoContent.tsx @@ -0,0 +1,60 @@ +/* + * Copyright 2024 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react' +import { Page } from '@harnessio/uicore' +import { useGetArtifactDetailsQuery } from '@harnessio/react-har-service-client' + +import { useDecodedParams, useGetSpaceRef } from '@ar/hooks' +import type { VersionDetailsPathParams } from '@ar/routes/types' + +import type { GenericArtifactDetails } from '../../types' +import GeneralInformationCard from '../overview/GeneralInformationCard' + +import css from './ossDetails.module.scss' + +export default function OSSGeneralInfoContent() { + const pathParams = useDecodedParams() + const spaceRef = useGetSpaceRef() + const { + data, + isFetching: loading, + error, + refetch + } = useGetArtifactDetailsQuery( + { + registry_ref: spaceRef, + artifact: pathParams.artifactIdentifier, + version: pathParams.versionIdentifier, + queryParams: {} + }, + { + enabled: false + } + ) + + const response = data?.content?.data as GenericArtifactDetails + + return ( + refetch()}> + {response && } + + ) +} diff --git a/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/ossDetails.module.scss b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/ossDetails.module.scss new file mode 100644 index 000000000..2d8932cbd --- /dev/null +++ b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/ossDetails.module.scss @@ -0,0 +1,28 @@ +/* + * Copyright 2024 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.pageBody { + height: auto; + min-height: 250px; + width: 100%; + padding: var(--spacing-large) !important; +} + +.cardContainer { + width: 100% !important; + padding: var(--spacing-7) !important; + background-color: var(--white); +} diff --git a/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/ossDetails.module.scss.d.ts b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/ossDetails.module.scss.d.ts new file mode 100644 index 000000000..8b495a36b --- /dev/null +++ b/web/src/ar/pages/version-details/GenericVersion/pages/oss-details/ossDetails.module.scss.d.ts @@ -0,0 +1,20 @@ +/* + * Copyright 2023 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* eslint-disable */ +// This is an auto-generated file +export declare const cardContainer: string +export declare const pageBody: string diff --git a/web/src/ar/pages/version-details/GenericVersion/pages/overview/GeneralInformationCard.tsx b/web/src/ar/pages/version-details/GenericVersion/pages/overview/GeneralInformationCard.tsx new file mode 100644 index 000000000..43df51274 --- /dev/null +++ b/web/src/ar/pages/version-details/GenericVersion/pages/overview/GeneralInformationCard.tsx @@ -0,0 +1,74 @@ +/* + * Copyright 2024 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react' +import { defaultTo } from 'lodash-es' +import { FontVariation } from '@harnessio/design-system' +import { Card, Container, Layout, Text } from '@harnessio/uicore' + +import { useStrings } from '@ar/frameworks/strings' +import { DEFAULT_DATE_TIME_FORMAT } from '@ar/constants' +import { getReadableDateTime } from '@ar/common/dateUtils' +import { LabelValueContent } from '@ar/pages/version-details/components/LabelValueContent/LabelValueContent' + +import type { GenericArtifactDetails } from '../../types' + +import css from './styles.module.scss' + +interface GeneralInformationCardProps { + data: GenericArtifactDetails + className?: string +} + +export default function GeneralInformationCard(props: GeneralInformationCardProps) { + const { data, className } = props + const { getString } = useStrings() + return ( + + + + {getString('versionDetails.overview.generalInformation.title')} + + + + + + {getString('versionDetails.overview.generalInformation.packageType')} + + + {getString('packageTypes.genericPackage')} + + + + + + + ) +} diff --git a/web/src/ar/pages/version-details/GenericVersion/pages/overview/OverviewPage.tsx b/web/src/ar/pages/version-details/GenericVersion/pages/overview/OverviewPage.tsx index b5b73e8f9..ea497db7f 100644 --- a/web/src/ar/pages/version-details/GenericVersion/pages/overview/OverviewPage.tsx +++ b/web/src/ar/pages/version-details/GenericVersion/pages/overview/OverviewPage.tsx @@ -15,27 +15,20 @@ */ import React from 'react' -import { defaultTo } from 'lodash-es' -import { FontVariation } from '@harnessio/design-system' -import { Card, Container, Layout, Page, Text } from '@harnessio/uicore' +import { Layout, Page } from '@harnessio/uicore' import { useGetArtifactDetailsQuery } from '@harnessio/react-har-service-client' -import { useStrings } from '@ar/frameworks/strings' -import { DEFAULT_DATE_TIME_FORMAT } from '@ar/constants' -import { getReadableDateTime } from '@ar/common/dateUtils' -import type { VersionDetailsPathParams } from '@ar/routes/types' import { useDecodedParams, useGetSpaceRef } from '@ar/hooks' +import type { VersionDetailsPathParams } from '@ar/routes/types' import { VersionOverviewCard } from '@ar/pages/version-details/components/OverviewCards/types' import VersionOverviewCards from '@ar/pages/version-details/components/OverviewCards/OverviewCards' -import { LabelValueContent } from '@ar/pages/version-details/components/LabelValueContent/LabelValueContent' import type { GenericArtifactDetails } from '../../types' +import GeneralInformationCard from './GeneralInformationCard' -import css from './styles.module.scss' import genericStyles from '../../styles.module.scss' export default function GenericOverviewPage() { - const { getString } = useStrings() const pathParams = useDecodedParams() const spaceRef = useGetSpaceRef() @@ -62,39 +55,7 @@ export default function GenericOverviewPage() { {response && ( - - - - {getString('versionDetails.overview.generalInformation.title')} - - - - - - {getString('versionDetails.overview.generalInformation.packageType')} - - - {getString('packageTypes.genericPackage')} - - - - - - + )}