diff --git a/web/src/ar/MFEAppTypes.ts b/web/src/ar/MFEAppTypes.ts index e4fb586e2d..3c9928398a 100644 --- a/web/src/ar/MFEAppTypes.ts +++ b/web/src/ar/MFEAppTypes.ts @@ -154,5 +154,6 @@ export enum FeatureFlags { HAR_ENABLE_UNTAGGED_IMAGES_SUPPORT = 'HAR_ENABLE_UNTAGGED_IMAGES_SUPPORT', HAR_SUPPORT_LOCAL_REGISTRY_AS_UPSTREAM_PROXY = 'HAR_SUPPORT_LOCAL_REGISTRY_AS_UPSTREAM_PROXY', HAR_SOFT_DELETE_SUPPORT = 'HAR_SOFT_DELETE_SUPPORT', - HAR_DEPENDENCY_FIREWALL = 'HAR_DEPENDENCY_FIREWALL' + HAR_DEPENDENCY_FIREWALL = 'HAR_DEPENDENCY_FIREWALL', + HAR_SWIFT_PACKAGE = 'HAR_SWIFT_PACKAGE' } diff --git a/web/src/ar/common/types.ts b/web/src/ar/common/types.ts index 25e6f53647..832ce47967 100644 --- a/web/src/ar/common/types.ts +++ b/web/src/ar/common/types.ts @@ -67,7 +67,8 @@ export enum RepositoryPackageType { HUGGINGFACE = 'HUGGINGFACE', CONDA = 'CONDA', DART = 'DART', - COMPOSER = 'COMPOSER' + COMPOSER = 'COMPOSER', + SWIFT = 'SWIFT' } export enum RepositoryConfigType { diff --git a/web/src/ar/hooks/useGetRepositoryTypes.ts b/web/src/ar/hooks/useGetRepositoryTypes.ts index 43a360b6a7..810defc118 100644 --- a/web/src/ar/hooks/useGetRepositoryTypes.ts +++ b/web/src/ar/hooks/useGetRepositoryTypes.ts @@ -16,7 +16,7 @@ import type { IconName } from '@harnessio/icons' -import type { FeatureFlags } from '@ar/MFEAppTypes' +import { FeatureFlags } from '@ar/MFEAppTypes' import type { StringsMap } from '@ar/frameworks/strings' import { Parent, RepositoryPackageType } from '@ar/common/types' import { ThumbnailTagEnum } from '@ar/components/Tag/ThumbnailTags' @@ -98,6 +98,7 @@ const RepositoryTypes: RepositoryTypeListItem[] = [ value: RepositoryPackageType.CARGO, icon: 'rust-logo' }, + { label: 'repositoryTypes.go', value: RepositoryPackageType.GO, @@ -126,6 +127,16 @@ const RepositoryTypes: RepositoryTypeListItem[] = [ icon: 'php-composer-logo', parent: Parent.Enterprise }, + { + label: 'repositoryTypes.swift', + value: RepositoryPackageType.SWIFT, + icon: 'swift-logo', + disabled: true, + featureFlag: FeatureFlags.HAR_SWIFT_PACKAGE, + parent: Parent.Enterprise, + tooltip: 'Coming Soon!', + tag: ThumbnailTagEnum.ComingSoon + }, { label: 'repositoryTypes.debian', value: RepositoryPackageType.DEBIAN, diff --git a/web/src/ar/pages/repository-details/RepositoryFactory.tsx b/web/src/ar/pages/repository-details/RepositoryFactory.tsx index d8cc71fe84..b5d0e146da 100644 --- a/web/src/ar/pages/repository-details/RepositoryFactory.tsx +++ b/web/src/ar/pages/repository-details/RepositoryFactory.tsx @@ -29,6 +29,7 @@ import { HuggingfaceRepositoryType } from './HuggingfaceRepositoryType/Huggingfa import { CondaRepositoryType } from './CondaRepository/CondaRepositoryType' import { DartRepositoryType } from './DartRepository/DartRepositoryType' import { ComposerRepositoryType } from './ComposerRepository/ComposerRepositoryType' +import { SwiftRepositoryType } from './SwiftRepository/SwiftRepositoryType' repositoryFactory.registerStep(new DockerRepositoryType()) repositoryFactory.registerStep(new HelmRepositoryType()) @@ -44,3 +45,4 @@ repositoryFactory.registerStep(new HuggingfaceRepositoryType()) repositoryFactory.registerStep(new CondaRepositoryType()) repositoryFactory.registerStep(new DartRepositoryType()) repositoryFactory.registerStep(new ComposerRepositoryType()) +repositoryFactory.registerStep(new SwiftRepositoryType()) diff --git a/web/src/ar/pages/repository-details/SwiftRepository/SwiftRepositoryType.tsx b/web/src/ar/pages/repository-details/SwiftRepository/SwiftRepositoryType.tsx new file mode 100644 index 0000000000..cb478fd540 --- /dev/null +++ b/web/src/ar/pages/repository-details/SwiftRepository/SwiftRepositoryType.tsx @@ -0,0 +1,118 @@ +/* + * 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 type { IconName } from '@harnessio/icons' + +import { RepositoryConfigType, RepositoryPackageType } from '@ar/common/types' +import { + UpstreamProxyAuthenticationMode, + type UpstreamRegistryRequest, + UpstreamRepositoryURLInputSource +} from '@ar/pages/upstream-proxy-details/types' +import { + CreateRepositoryFormProps, + RepositoryActionsProps, + RepositoryConfigurationFormProps, + RepositoryDetailsHeaderProps, + RepositoryStep, + RepositoryTreeNodeProps, + RepositoySetupClientProps +} from '@ar/frameworks/RepositoryStep/Repository' + +import RepositoryDetails from '../RepositoryDetails' +import type { Repository, VirtualRegistryRequest } from '../types' +import RepositoryActions from '../components/Actions/RepositoryActions' +import RedirectPageView from '../components/RedirectPageView/RedirectPageView' +import RepositoryTreeNode from '../components/RepositoryTreeNode/RepositoryTreeNode' +import SetupClientContent from '../components/SetupClientContent/SetupClientContent' +import RepositoryConfigurationForm from '../components/Forms/RepositoryConfigurationForm' +import RepositoryCreateFormContent from '../components/FormContent/RepositoryCreateFormContent' +import RepositoryDetailsHeader from '../components/RepositoryDetailsHeader/RepositoryDetailsHeader' + +export class SwiftRepositoryType extends RepositoryStep { + protected packageType = RepositoryPackageType.SWIFT + protected repositoryName = 'Swift Repository' + protected repositoryIcon: IconName = 'swift-logo' + protected supportedScanners = [] + protected supportsUpstreamProxy = false + protected isWebhookSupported = true + + protected defaultValues: VirtualRegistryRequest = { + packageType: RepositoryPackageType.SWIFT, + identifier: '', + config: { + type: RepositoryConfigType.VIRTUAL + }, + scanners: [], + isPublic: false + } + + protected defaultUpstreamProxyValues: UpstreamRegistryRequest = { + packageType: RepositoryPackageType.SWIFT, + identifier: '', + config: { + type: RepositoryConfigType.UPSTREAM, + source: UpstreamRepositoryURLInputSource.Custom, + authType: UpstreamProxyAuthenticationMode.ANONYMOUS, + url: '' + }, + cleanupPolicy: [], + scanners: [], + isPublic: false + } + + renderCreateForm(_props: CreateRepositoryFormProps): JSX.Element { + return + } + + renderCofigurationForm(props: RepositoryConfigurationFormProps): JSX.Element { + return + } + + renderActions(props: RepositoryActionsProps): JSX.Element { + return + } + + renderSetupClient(props: RepositoySetupClientProps): JSX.Element { + const { repoKey, onClose, artifactKey, versionKey } = props + return ( + + ) + } + + renderRepositoryDetailsHeader(props: RepositoryDetailsHeaderProps): JSX.Element { + return + } + + renderRedirectPage(): JSX.Element { + return + } + + renderTreeNodeView(props: RepositoryTreeNodeProps): JSX.Element { + return + } + + renderTreeNodeDetails(): JSX.Element { + return + } +} diff --git a/web/src/ar/pages/version-details/SwiftVersion/SwiftVersionType.tsx b/web/src/ar/pages/version-details/SwiftVersion/SwiftVersionType.tsx new file mode 100644 index 0000000000..cce97d5998 --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/SwiftVersionType.tsx @@ -0,0 +1,152 @@ +/* + * 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 type { ArtifactVersionSummary } from '@harnessio/react-har-service-client' +import { + type ArtifactActionProps, + ArtifactRowSubComponentProps, + type VersionActionProps, + type ArtifactTreeNodeViewProps, + type VersionDetailsHeaderProps, + type VersionDetailsTabProps, + type VersionListTableProps, + VersionStep, + type VersionTreeNodeViewProps +} from '@ar/frameworks/Version/Version' +import { String } from '@ar/frameworks/strings' +import { PageType, RepositoryPackageType } from '@ar/common/types' +import VersionListTable, { + type CommonVersionListTableProps +} from '@ar/pages/version-list/components/VersionListTable/VersionListTable' +import { VersionListColumnEnum } from '@ar/pages/version-list/components/VersionListTable/types' +import ArtifactActions from '@ar/pages/artifact-details/components/ArtifactActions/ArtifactActions' +import ArtifactTreeNode from '@ar/pages/artifact-details/components/ArtifactTreeNode/ArtifactTreeNode' +import ArtifactTreeNodeDetailsContent from '@ar/pages/artifact-details/components/ArtifactTreeNode/ArtifactTreeNodeDetailsContent' +import { VersionDetailsTab } from '../components/VersionDetailsTabs/constants' +import VersionOverviewProvider from '../context/VersionOverviewProvider' +import SwiftOverviewPage from './pages/overview/SwiftOverviewPage' +import SwiftArtifactDetailsPage from './pages/artifact-details/SwiftArtifactDetailsPage' +import VersionTreeNode from '../components/VersionTreeNode/VersionTreeNode' +import VersionDetailsTabs from '../components/VersionDetailsTabs/VersionDetailsTabs' +import VersionDetailsHeaderContent from '../components/VersionDetailsHeaderContent/VersionDetailsHeaderContent' +import VersionFilesProvider from '../context/VersionFilesProvider' +import ArtifactFilesContent from '../components/ArtifactFileListTable/ArtifactFilesContent' +import VersionActions from '../components/VersionActions/VersionActions' +import { VersionAction } from '../components/VersionActions/types' + +export class SwiftVersionType extends VersionStep { + protected packageType = RepositoryPackageType.SWIFT + protected hasArtifactRowSubComponent = true + protected allowedVersionDetailsTabs: VersionDetailsTab[] = [ + VersionDetailsTab.OVERVIEW, + VersionDetailsTab.ARTIFACT_DETAILS + ] + + versionListTableColumnConfig: CommonVersionListTableProps['columnConfigs'] = { + [VersionListColumnEnum.Name]: { width: '150%' }, + [VersionListColumnEnum.Size]: { width: '100%' }, + [VersionListColumnEnum.FileCount]: { width: '100%' }, + [VersionListColumnEnum.DownloadCount]: { width: '100%' }, + [VersionListColumnEnum.PullCommand]: { width: '100%' }, + [VersionListColumnEnum.LastModified]: { width: '100%' }, + [VersionListColumnEnum.Actions]: { width: '30%' } + } + + protected allowedActionsOnVersion = [ + VersionAction.Delete, + VersionAction.SetupClient, + VersionAction.ViewVersionDetails, + VersionAction.Quarantine, + VersionAction.Download, + VersionAction.DownloadCommand + ] + protected allowedActionsOnVersionDetailsPage = [ + VersionAction.Delete, + VersionAction.Quarantine, + VersionAction.Download + ] + + renderVersionListTable(props: VersionListTableProps): JSX.Element { + return + } + + renderVersionDetailsHeader(props: VersionDetailsHeaderProps): JSX.Element { + return + } + + renderVersionDetailsTab(props: VersionDetailsTabProps): JSX.Element { + switch (props.tab) { + case VersionDetailsTab.OVERVIEW: + return ( + + + + ) + case VersionDetailsTab.ARTIFACT_DETAILS: + return ( + + + + ) + default: + return + } + } + + renderArtifactActions(props: ArtifactActionProps): JSX.Element { + return + } + + renderVersionActions(props: VersionActionProps): JSX.Element { + switch (props.pageType) { + case PageType.Details: + return + case PageType.Table: + case PageType.GlobalList: + default: + return + } + } + + renderArtifactRowSubComponent(props: ArtifactRowSubComponentProps): JSX.Element { + return ( + + + + ) + } + + renderArtifactTreeNodeView(props: ArtifactTreeNodeViewProps): JSX.Element { + return + } + + renderArtifactTreeNodeDetails(): JSX.Element { + return + } + + renderVersionTreeNodeView(props: VersionTreeNodeViewProps): JSX.Element { + return + } + + renderVersionTreeNodeDetails(): JSX.Element { + return + } +} diff --git a/web/src/ar/pages/version-details/SwiftVersion/pages/artifact-details/SwiftArtifactDetailsPage.tsx b/web/src/ar/pages/version-details/SwiftVersion/pages/artifact-details/SwiftArtifactDetailsPage.tsx new file mode 100644 index 0000000000..fac9d6bb12 --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/pages/artifact-details/SwiftArtifactDetailsPage.tsx @@ -0,0 +1,77 @@ +/* + * 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, { useCallback } from 'react' +import { Layout } from '@harnessio/uicore' + +import { useParentHooks } from '@ar/hooks' +import { useStrings } from '@ar/frameworks/strings' +import { ButtonTab, ButtonTabs } from '@ar/components/ButtonTabs/ButtonTabs' +import VersionFilesProvider from '@ar/pages/version-details/context/VersionFilesProvider' +import { useVersionOverview } from '@ar/pages/version-details/context/VersionOverviewProvider' +import ReadmeFileContent from '@ar/pages/version-details/components/ReadmeFileContent/ReadmeFileContent' +import ArtifactFilesContent from '@ar/pages/version-details/components/ArtifactFileListTable/ArtifactFilesContent' + +import SwiftVersionDependencyContent from './SwiftVersionDependencyContent' +import { SwiftArtifactDetails, SwiftArtifactDetailsTabEnum, type SwiftVersionDetailsQueryParams } from '../../types' + +export default function SwiftArtifactDetailsPage() { + const { getString } = useStrings() + const { useUpdateQueryParams, useQueryParams } = useParentHooks() + const { updateQueryParams } = useUpdateQueryParams() + const { detailsTab = SwiftArtifactDetailsTabEnum.ReadMe } = useQueryParams() + const { data } = useVersionOverview() + const { metadata } = data + + const handleTabChange = useCallback( + (nextTab: SwiftArtifactDetailsTabEnum): void => { + updateQueryParams({ detailsTab: nextTab }) + }, + [updateQueryParams] + ) + + return ( + + + } + title={getString('versionDetails.artifactDetails.tabs.readme')} + /> + + + + } + title={getString('versionDetails.artifactDetails.tabs.files')} + /> + } + title={getString('versionDetails.artifactDetails.tabs.dependencies')} + /> + + + ) +} diff --git a/web/src/ar/pages/version-details/SwiftVersion/pages/artifact-details/SwiftVersionDependencyContent.tsx b/web/src/ar/pages/version-details/SwiftVersion/pages/artifact-details/SwiftVersionDependencyContent.tsx new file mode 100644 index 0000000000..f914fd79cc --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/pages/artifact-details/SwiftVersionDependencyContent.tsx @@ -0,0 +1,41 @@ +/* + * 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, { useMemo } from 'react' +import { Text } from '@harnessio/uicore' + +import { useStrings } from '@ar/frameworks/strings' +import { useVersionOverview } from '@ar/pages/version-details/context/VersionOverviewProvider' +import type { IDependencyList } from '@ar/pages/version-details/components/ArtifactDependencyListTable/types' +import ArtifactDependencyListTable from '@ar/pages/version-details/components/ArtifactDependencyListTable/ArtifactDependencyListTable' + +import type { SwiftArtifactDetails } from '../../types' + +export default function SwiftVersionDependencyContent() { + const { getString } = useStrings() + const { data } = useVersionOverview() + + const dependencies = useMemo((): IDependencyList => { + const _dependencies = data.metadata?.dependencies || [] + return _dependencies.map(dep => ({ name: dep.name, version: dep.version })) + }, [data.metadata?.dependencies]) + + if (!dependencies.length) { + return {getString('versionDetails.noDependencies')} + } + + return +} diff --git a/web/src/ar/pages/version-details/SwiftVersion/pages/overview/SwiftOverviewPage.tsx b/web/src/ar/pages/version-details/SwiftVersion/pages/overview/SwiftOverviewPage.tsx new file mode 100644 index 0000000000..21a6c2254a --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/pages/overview/SwiftOverviewPage.tsx @@ -0,0 +1,25 @@ +/* + * 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 SwiftVersionGeneralInfo from './SwiftVersionGeneralInfo' + +import genericStyles from '../../styles.module.scss' + +export default function SwiftOverviewPage() { + return +} diff --git a/web/src/ar/pages/version-details/SwiftVersion/pages/overview/SwiftVersionGeneralInfo.tsx b/web/src/ar/pages/version-details/SwiftVersion/pages/overview/SwiftVersionGeneralInfo.tsx new file mode 100644 index 0000000000..d998540a71 --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/pages/overview/SwiftVersionGeneralInfo.tsx @@ -0,0 +1,92 @@ +/* + * 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, isEmpty } 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 { LabelValueTypeEnum } from '@ar/pages/version-details/components/LabelValueContent/type' +import { useVersionOverview } from '@ar/pages/version-details/context/VersionOverviewProvider' +import { LabelValueContent } from '@ar/pages/version-details/components/LabelValueContent/LabelValueContent' + +import type { SwiftArtifactDetails } from '../../types' + +import css from './styles.module.scss' + +interface SwiftVersionGeneralInfoProps { + className?: string +} + +export default function SwiftVersionGeneralInfo(props: SwiftVersionGeneralInfoProps) { + const { className } = props + const { data } = useVersionOverview() + const { getString } = useStrings() + + return ( + + + + {getString('versionDetails.overview.generalInformation.title')} + + + + + + + + + + + + + ) +} diff --git a/web/src/ar/pages/version-details/SwiftVersion/pages/overview/styles.module.scss b/web/src/ar/pages/version-details/SwiftVersion/pages/overview/styles.module.scss new file mode 100644 index 0000000000..457c2a3294 --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/pages/overview/styles.module.scss @@ -0,0 +1,22 @@ +.gridContainer { + align-items: center; + display: grid; + grid-template-columns: max-content auto; + row-gap: var(--spacing-medium); + column-gap: 30px; + + & :global(.StyledProps--font-variation-small-bold) { + font-size: 13px !important; + } + + & :global(.StyledProps--font-variation-small) { + font-size: 13px !important; + } + + & :global(.CopyToClipboard--copyIcon) { + & > svg { + height: 16px; + width: 16px; + } + } +} diff --git a/web/src/ar/pages/version-details/SwiftVersion/pages/overview/styles.module.scss.d.ts b/web/src/ar/pages/version-details/SwiftVersion/pages/overview/styles.module.scss.d.ts new file mode 100644 index 0000000000..9f8083f63b --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/pages/overview/styles.module.scss.d.ts @@ -0,0 +1,19 @@ +/* + * 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 gridContainer: string diff --git a/web/src/ar/pages/version-details/SwiftVersion/styles.module.scss b/web/src/ar/pages/version-details/SwiftVersion/styles.module.scss new file mode 100644 index 0000000000..bc2bfda261 --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/styles.module.scss @@ -0,0 +1,11 @@ +.pageBody { + --page-header-height: 137px; +} + +.cardContainer { + width: 60% !important; + min-width: 1040px; + padding: var(--spacing-7) !important; + background-color: var(--white); + margin: var(--spacing-large); +} diff --git a/web/src/ar/pages/version-details/SwiftVersion/styles.module.scss.d.ts b/web/src/ar/pages/version-details/SwiftVersion/styles.module.scss.d.ts new file mode 100644 index 0000000000..8b495a36bb --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/styles.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/SwiftVersion/types.ts b/web/src/ar/pages/version-details/SwiftVersion/types.ts new file mode 100644 index 0000000000..35213b1ee2 --- /dev/null +++ b/web/src/ar/pages/version-details/SwiftVersion/types.ts @@ -0,0 +1,37 @@ +/* + * 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 type { ArtifactDetail } from '@harnessio/react-har-service-client' +import type { VersionDetailsQueryParams } from '../types' + +export enum SwiftArtifactDetailsTabEnum { + ReadMe = 'readme', + Files = 'files', + Dependencies = 'dependencies' +} + +export interface SwiftVersionDetailsQueryParams extends VersionDetailsQueryParams { + detailsTab: SwiftArtifactDetailsTabEnum +} + +export interface LocalSwiftArtifactDetailConfig { + description?: string + metadata?: { + readme?: string + dependencies?: Array<{ name: string; version: string }> + } +} + +export type SwiftArtifactDetails = ArtifactDetail & LocalSwiftArtifactDetailConfig diff --git a/web/src/ar/pages/version-details/VersionFactory.tsx b/web/src/ar/pages/version-details/VersionFactory.tsx index b2c4b4c4a2..d9384fcf41 100644 --- a/web/src/ar/pages/version-details/VersionFactory.tsx +++ b/web/src/ar/pages/version-details/VersionFactory.tsx @@ -29,6 +29,7 @@ import { HuggingfaceVersionType } from './HuggingfaceVersion/HuggingfaceVersionT import { CondaVersionType } from './CondaVersion/CondaVersionType' import { DartVersionType } from './DartVersion/DartVersionType' import { ComposerVersionType } from './ComposerVersion/ComposerVersionType' +import { SwiftVersionType } from './SwiftVersion/SwiftVersionType' versionFactory.registerStep(new DockerVersionType()) versionFactory.registerStep(new HelmVersionType()) @@ -44,3 +45,4 @@ versionFactory.registerStep(new HuggingfaceVersionType()) versionFactory.registerStep(new CondaVersionType()) versionFactory.registerStep(new DartVersionType()) versionFactory.registerStep(new ComposerVersionType()) +versionFactory.registerStep(new SwiftVersionType()) diff --git a/web/src/ar/strings/strings.en.yaml b/web/src/ar/strings/strings.en.yaml index c281c731be..226aa205aa 100644 --- a/web/src/ar/strings/strings.en.yaml +++ b/web/src/ar/strings/strings.en.yaml @@ -112,6 +112,7 @@ packageTypes: nugetPackage: NuGet Package rpmPackage: RPM Package cargoPackage: Cargo Package + swiftPackage: Swift Package goPackage: Go Package huggingfacePackage: Huggingface Package condaPackage: Conda Package @@ -130,6 +131,7 @@ repositoryTypes: go: Go debian: Debian cargo: Cargo + swift: Swift alpine: Alpine huggingface: Huggingface conda: Conda diff --git a/web/src/ar/strings/types.ts b/web/src/ar/strings/types.ts index 919a4f705b..89a0dcf770 100644 --- a/web/src/ar/strings/types.ts +++ b/web/src/ar/strings/types.ts @@ -605,6 +605,7 @@ export interface StringsMap { 'packageTypes.package': string 'packageTypes.pythonPackage': string 'packageTypes.rpmPackage': string + 'packageTypes.swiftPackage': string plaintext: string plusNewName: string prod: string @@ -629,6 +630,7 @@ export interface StringsMap { 'repositoryTypes.nuget': string 'repositoryTypes.pypi': string 'repositoryTypes.rpm': string + 'repositoryTypes.swift': string restore: string retriableError: string save: string diff --git a/web/yarn.lock b/web/yarn.lock index eb11c555da..d8f0f544eb 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -1922,9 +1922,9 @@ integrity sha512-ZwAGM1srOZ49/6YkwyjkczUv4v91CN0rCecRYnV3/g+xdSV5ycrUvkJjl9nHub6jw2eCGC0GdyNgAtAJnLmGfQ== "@harnessio/icons@^2.1.18": - version "2.1.18" - resolved "https://registry.yarnpkg.com/@harnessio/icons/-/icons-2.1.18.tgz#0e66b4ef5d92fd2dcd3c319707d78c6bbc2a087d" - integrity sha512-mR0XV8jAleijEUy/7+jbcA42RMOgDToE8PpsAZZbOzkGfH2c06RBW5UHPiF+TS/BRv9VgJ0RKiLJkLfos82l3w== + version "2.1.20" + resolved "https://registry.yarnpkg.com/@harnessio/icons/-/icons-2.1.20.tgz#e3d95107ff70f635009e87f28d61adaa64d9ebc0" + integrity sha512-3wtngGnVltw/Y89cmBRMQVwFO/p+lixHG/ROU/pVtTqCooBr/fiSk6uqkQLzhqde7g7W1FWbdFFdyBeKBG8k2w== "@harnessio/oats-cli@^3.0.0": version "3.0.0"