diff --git a/web/src/ar/pages/version-details/PythonVersion/PythonVersion.module.scss b/web/src/ar/pages/version-details/PythonVersion/PythonVersion.module.scss new file mode 100644 index 000000000..106f7cdc3 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/PythonVersion.module.scss @@ -0,0 +1,23 @@ +/* + * 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. + */ + +.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/PythonVersion/PythonVersion.module.scss.d.ts b/web/src/ar/pages/version-details/PythonVersion/PythonVersion.module.scss.d.ts new file mode 100644 index 000000000..f39ae0981 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/PythonVersion.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 cardContainer: string diff --git a/web/src/ar/pages/version-details/PythonVersion/PythonVersionType.tsx b/web/src/ar/pages/version-details/PythonVersion/PythonVersionType.tsx new file mode 100644 index 000000000..e37757fb3 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/PythonVersionType.tsx @@ -0,0 +1,94 @@ +/* + * 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 type { ArtifactVersionSummary } from '@harnessio/react-har-service-client' + +import { String } from '@ar/frameworks/strings' +import { RepositoryPackageType } from '@ar/common/types' +import { VersionListColumnEnum } from '@ar/pages/version-list/components/VersionListTable/types' +import ArtifactActions from '@ar/pages/artifact-details/components/ArtifactActions/ArtifactActions' +import VersionListTable, { + type CommonVersionListTableProps +} from '@ar/pages/version-list/components/VersionListTable/VersionListTable' +import { + type ArtifactActionProps, + type VersionActionProps, + type VersionDetailsHeaderProps, + type VersionDetailsTabProps, + type VersionListTableProps, + VersionStep +} from '@ar/frameworks/Version/Version' + +import VersionActions from '../components/VersionActions/VersionActions' +import { VersionDetailsTab } from '../components/VersionDetailsTabs/constants' +import PythonVersionOverviewPage from './pages/overview/PythonVersionOverviewPage' +import PythonVersionArtifactDetailsPage from './pages/artifact-dertails/PythonVersionArtifactDetailsPage' +import VersionDetailsHeaderContent from '../components/VersionDetailsHeaderContent/VersionDetailsHeaderContent' + +export class PythonVersionType extends VersionStep { + protected packageType = RepositoryPackageType.PYTHON + protected allowedVersionDetailsTabs: VersionDetailsTab[] = [ + VersionDetailsTab.OVERVIEW, + VersionDetailsTab.ARTIFACT_DETAILS, + VersionDetailsTab.CODE + ] + + 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%' } + } + + 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 + case VersionDetailsTab.OSS: + return ( + + + + + ) + default: + return + } + } + + renderArtifactActions(props: ArtifactActionProps): JSX.Element { + return + } + + renderVersionActions(props: VersionActionProps): JSX.Element { + return + } +} diff --git a/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionArtifactDetailsPage.tsx b/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionArtifactDetailsPage.tsx new file mode 100644 index 000000000..adc4db669 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionArtifactDetailsPage.tsx @@ -0,0 +1,66 @@ +/* + * 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 PythonVersionFilesContent from './PythonVersionFilesContent' +import PythonVersionReadmeContent from './PythonVersionReadmeContent' +import { PythonArtifactDetailsTabEnum, type PythonVersionDetailsQueryParams } from '../../types' + +export default function PythonVersionArtifactDetailsPage() { + const { getString } = useStrings() + const { useUpdateQueryParams, useQueryParams } = useParentHooks() + const { updateQueryParams } = useUpdateQueryParams() + const { detailsTab = PythonArtifactDetailsTabEnum.ReadMe } = useQueryParams() + + const handleTabChange = useCallback( + (nextTab: PythonArtifactDetailsTabEnum): void => { + updateQueryParams({ detailsTab: nextTab }) + }, + [updateQueryParams] + ) + + return ( + + + } + title={getString('versionDetails.artifactDetails.tabs.readme')} + /> + + + + } + title={getString('versionDetails.artifactDetails.tabs.files')} + /> + + + ) +} diff --git a/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionFilesContent.tsx b/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionFilesContent.tsx new file mode 100644 index 000000000..0fed80c81 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionFilesContent.tsx @@ -0,0 +1,35 @@ +/* + * 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, { useContext } from 'react' + +import { DEFAULT_PAGE_INDEX } from '@ar/constants' +import { VersionFilesContext } from '@ar/pages/version-details/context/VersionFilesProvider' +import ArtifactFileListTable from '@ar/pages/version-details/components/ArtifactFileListTable/ArtifactFileListTable' + +export default function PythonVersionFilesContent() { + const { data, updateQueryParams, sort } = useContext(VersionFilesContext) + return ( + updateQueryParams({ page: pageNumber })} + setSortBy={sortArr => { + updateQueryParams({ sort: sortArr, page: DEFAULT_PAGE_INDEX }) + }} + sortBy={sort} + /> + ) +} diff --git a/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionReadmeContent.tsx b/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionReadmeContent.tsx new file mode 100644 index 000000000..0e28eb562 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/PythonVersionReadmeContent.tsx @@ -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. + */ + +import React from 'react' +import { Container } from '@harnessio/uicore' +import ReadmeFileContent from '@ar/pages/version-details/components/ReadmeFileContent/ReadmeFileContent' +import { MOCK_README_CONTENT } from './mockData' + +export default function PythonVersionReadmeContent() { + return ( + + + + ) +} diff --git a/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/mockData.ts b/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/mockData.ts new file mode 100644 index 000000000..314ab7db9 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/pages/artifact-dertails/mockData.ts @@ -0,0 +1,18 @@ +/* + * 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. + */ + +export const MOCK_README_CONTENT = + "[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)\n\n**Fast, unopinionated, minimalist web framework for [Node.js](http://nodejs.org).**\n\n**This project has a [Code of Conduct][].**\n\n## Table of contents\n\n* [Installation](#Installation)\n* [Features](#Features)\n* [Docs & Community](#docs--community)\n* [Quick Start](#Quick-Start)\n* [Running Tests](#Running-Tests)\n* [Philosophy](#Philosophy)\n* [Examples](#Examples)\n* [Contributing to Express](#Contributing)\n* [TC (Technical Committee)](#tc-technical-committee)\n* [Triagers](#triagers)\n* [License](#license)\n\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Install Size][npm-install-size-image]][npm-install-size-url]\n[![NPM Downloads][npm-downloads-image]][npm-downloads-url]\n[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]\n\n\n```js\nconst express = require('express')\nconst app = express()\n\napp.get('/', function (req, res) {\n res.send('Hello World')\n})\n\napp.listen(3000)\n```\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/).\n\nBefore installing, [download and install Node.js](https://nodejs.org/en/download/).\nNode.js 0.10 or higher is required.\n\nIf this is a brand new project, make sure to create a `package.json` first with\nthe [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file).\n\nInstallation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```console\n$ npm install express\n```\n\nFollow [our installing guide](http://expressjs.com/en/starter/installing.html)\nfor more information.\n\n## Features\n\n * Robust routing\n * Focus on high performance\n * Super-high test coverage\n * HTTP helpers (redirection, caching, etc)\n * View system supporting 14+ template engines\n * Content negotiation\n * Executable for generating applications quickly\n\n## Docs & Community\n\n * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)]\n * [#express](https://web.libera.chat/#express) on [Libera Chat](https://libera.chat) IRC\n * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules\n * Visit the [Wiki](https://github.com/expressjs/express/wiki)\n * [Google Group](https://groups.google.com/group/express-js) for discussion\n * [Gitter](https://gitter.im/expressjs/express) for support and discussion\n\n**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x).\n\n## Quick Start\n\n The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below:\n\n Install the executable. The executable's major version will match Express's:\n\n```console\n$ npm install -g express-generator@4\n```\n\n Create the app:\n\n```console\n$ express /tmp/foo && cd /tmp/foo\n```\n\n Install dependencies:\n\n```console\n$ npm install\n```\n\n Start the server:\n\n```console\n$ npm start\n```\n\n View the website at: http://localhost:3000\n\n## Philosophy\n\n The Express philosophy is to provide small, robust tooling for HTTP servers, making\n it a great solution for single page applications, websites, hybrids, or public\n HTTP APIs.\n\n Express does not force you to use any specific ORM or template engine. With support for over\n 14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js),\n you can quickly craft your perfect framework.\n\n## Examples\n\n To view the examples, clone the Express repo and install the dependencies:\n\n```console\n$ git clone https://github.com/expressjs/express.git --depth 1\n$ cd express\n$ npm install\n```\n\n Then run whichever example you want:\n\n```console\n$ node examples/content-negotiation\n```\n\n## Contributing\n\n [![Linux Build][github-actions-ci-image]][github-actions-ci-url]\n [![Windows Build][appveyor-image]][appveyor-url]\n [![Test Coverage][coveralls-image]][coveralls-url]\n\nThe Express.js project welcomes all constructive contributions. Contributions take many forms,\nfrom code for bug fixes and enhancements, to additions and fixes to documentation, additional\ntests, triaging incoming pull requests and issues, and more!\n\nSee the [Contributing Guide](Contributing.md) for more technical details on contributing.\n\n### Security Issues\n\nIf you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).\n\n### Running Tests\n\nTo run the test suite, first install the dependencies, then run `npm test`:\n\n```console\n$ npm install\n$ npm test\n```\n\n## People\n\nThe original author of Express is [TJ Holowaychuk](https://github.com/tj)\n\n[List of all contributors](https://github.com/expressjs/express/graphs/contributors)\n\n### TC (Technical Committee)\n\n* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him)\n* [jonchurch](https://github.com/jonchurch) - **Jon Church**\n* [wesleytodd](https://github.com/wesleytodd) - **Wes Todd**\n* [LinusU](https://github.com/LinusU) - **Linus Unnebäck**\n* [blakeembrey](https://github.com/blakeembrey) - **Blake Embrey**\n* [sheplu](https://github.com/sheplu) - **Jean Burellier**\n* [crandmck](https://github.com/crandmck) - **Rand McKinney**\n* [ctcpip](https://github.com/ctcpip) - **Chris de Almeida**\n\n
\nTC emeriti members\n\n#### TC emeriti members\n\n * [dougwilson](https://github.com/dougwilson) - **Douglas Wilson**\n * [hacksparrow](https://github.com/hacksparrow) - **Hage Yaapa**\n * [jonathanong](https://github.com/jonathanong) - **jongleberry**\n * [niftylettuce](https://github.com/niftylettuce) - **niftylettuce**\n * [troygoode](https://github.com/troygoode) - **Troy Goode**\n
\n\n\n### Triagers\n\n* [aravindvnair99](https://github.com/aravindvnair99) - **Aravind Nair**\n* [carpasse](https://github.com/carpasse) - **Carlos Serrano**\n* [CBID2](https://github.com/CBID2) - **Christine Belzie**\n* [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim**\n* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him)\n* [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin**\n* [0ss](https://github.com/0ss) - **Salah**\n* [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him)\n* [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi**\n* [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him)\n* [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego**\n* [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him)\n* [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger**\n\n
\nTriagers emeriti members\n\n#### Emeritus Triagers\n\n * [AuggieH](https://github.com/AuggieH) - **Auggie Hudak**\n * [G-Rath](https://github.com/G-Rath) - **Gareth Jones**\n * [MohammadXroid](https://github.com/MohammadXroid) - **Mohammad Ayashi**\n * [NawafSwe](https://github.com/NawafSwe) - **Nawaf Alsharqi**\n * [NotMoni](https://github.com/NotMoni) - **Moni**\n * [VigneshMurugan](https://github.com/VigneshMurugan) - **Vignesh Murugan**\n * [davidmashe](https://github.com/davidmashe) - **David Ashe**\n * [digitaIfabric](https://github.com/digitaIfabric) - **David**\n * [e-l-i-s-e](https://github.com/e-l-i-s-e) - **Elise Bonner**\n * [fed135](https://github.com/fed135) - **Frederic Charette**\n * [firmanJS](https://github.com/firmanJS) - **Firman Abdul Hakim**\n * [getspooky](https://github.com/getspooky) - **Yasser Ameur**\n * [ghinks](https://github.com/ghinks) - **Glenn**\n * [ghousemohamed](https://github.com/ghousemohamed) - **Ghouse Mohamed**\n * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil**\n * [jake32321](https://github.com/jake32321) - **Jake Reed**\n * [jonchurch](https://github.com/jonchurch) - **Jon Church**\n * [lekanikotun](https://github.com/lekanikotun) - **Troy Goode**\n * [marsonya](https://github.com/marsonya) - **Lekan Ikotun**\n * [mastermatt](https://github.com/mastermatt) - **Matt R. Wilson**\n * [maxakuru](https://github.com/maxakuru) - **Max Edell**\n * [mlrawlings](https://github.com/mlrawlings) - **Michael Rawlings**\n * [rodion-arr](https://github.com/rodion-arr) - **Rodion Abdurakhimov**\n * [sheplu](https://github.com/sheplu) - **Jean Burellier**\n * [tarunyadav1](https://github.com/tarunyadav1) - **Tarun yadav**\n * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe**\n
\n\n\n## License\n\n [MIT](LICENSE)\n\n[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/express/master?label=windows\n[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express\n[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/express/master\n[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master\n[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/express/master?label=linux\n[github-actions-ci-url]: https://github.com/expressjs/express/actions/workflows/ci.yml\n[npm-downloads-image]: https://badgen.net/npm/dm/express\n[npm-downloads-url]: https://npmcharts.com/compare/express?minimal=true\n[npm-install-size-image]: https://badgen.net/packagephobia/install/express\n[npm-install-size-url]: https://packagephobia.com/result?p=express\n[npm-url]: https://npmjs.org/package/express\n[npm-version-image]: https://badgen.net/npm/v/express\n[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/express/badge\n[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/express\n[Code of Conduct]: https://github.com/expressjs/express/blob/master/Code-Of-Conduct.md\n" diff --git a/web/src/ar/pages/version-details/PythonVersion/pages/overview/PythonVersionGeneralInfo.tsx b/web/src/ar/pages/version-details/PythonVersion/pages/overview/PythonVersionGeneralInfo.tsx new file mode 100644 index 000000000..b9370a731 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/pages/overview/PythonVersionGeneralInfo.tsx @@ -0,0 +1,97 @@ +/* + * 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, { useContext } from 'react' +import { defaultTo } from 'lodash-es' +import { FontVariation } from '@harnessio/design-system' +import { Card, Container, Layout, Text } from '@harnessio/uicore' +import type { ArtifactDetail, PythonArtifactDetailConfig } 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 { LabelValueTypeEnum } from '@ar/pages/version-details/components/LabelValueContent/type' +import { VersionOverviewContext } from '@ar/pages/version-details/context/VersionOverviewProvider' +import { LabelValueContent } from '@ar/pages/version-details/components/LabelValueContent/LabelValueContent' + +import css from './overview.module.scss' + +interface PythonVersionGeneralInfoProps { + className?: string +} + +export default function PythonVersionGeneralInfo(props: PythonVersionGeneralInfoProps) { + const { className } = props + const contextValue = useContext(VersionOverviewContext) + const data = contextValue.data as ArtifactDetail & PythonArtifactDetailConfig + const { getString } = useStrings() + return ( + + + + {getString('versionDetails.overview.generalInformation.title')} + + + + + + + + + + + + + + + ) +} diff --git a/web/src/ar/pages/version-details/PythonVersion/pages/overview/PythonVersionOverviewPage.tsx b/web/src/ar/pages/version-details/PythonVersion/pages/overview/PythonVersionOverviewPage.tsx new file mode 100644 index 000000000..02b541275 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/pages/overview/PythonVersionOverviewPage.tsx @@ -0,0 +1,31 @@ +/* + * 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 VersionOverviewProvider from '@ar/pages/version-details/context/VersionOverviewProvider' + +import PythonVersionGeneralInfo from './PythonVersionGeneralInfo' + +import genericStyles from '../../PythonVersion.module.scss' + +export default function PythonVersionOverviewPage() { + return ( + + + + ) +} diff --git a/web/src/ar/pages/version-details/PythonVersion/pages/overview/overview.module.scss b/web/src/ar/pages/version-details/PythonVersion/pages/overview/overview.module.scss new file mode 100644 index 000000000..4f57ff207 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/pages/overview/overview.module.scss @@ -0,0 +1,23 @@ +/* + * 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. + */ + +.gridContainer { + align-items: center; + display: grid; + grid-template-columns: max-content auto; + row-gap: var(--spacing-medium); + column-gap: 30px; +} diff --git a/web/src/ar/pages/version-details/PythonVersion/pages/overview/overview.module.scss.d.ts b/web/src/ar/pages/version-details/PythonVersion/pages/overview/overview.module.scss.d.ts new file mode 100644 index 000000000..9f8083f63 --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/pages/overview/overview.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/PythonVersion/types.ts b/web/src/ar/pages/version-details/PythonVersion/types.ts new file mode 100644 index 000000000..44d30e5ef --- /dev/null +++ b/web/src/ar/pages/version-details/PythonVersion/types.ts @@ -0,0 +1,26 @@ +/* + * 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 { VersionDetailsQueryParams } from '../types' + +export enum PythonArtifactDetailsTabEnum { + ReadMe = 'readme', + Files = 'files' +} +export interface PythonVersionDetailsQueryParams extends VersionDetailsQueryParams { + detailsTab: PythonArtifactDetailsTabEnum + digest: string +} diff --git a/web/src/ar/pages/version-details/VersionFactory.tsx b/web/src/ar/pages/version-details/VersionFactory.tsx index b7a05e404..34ff6df92 100644 --- a/web/src/ar/pages/version-details/VersionFactory.tsx +++ b/web/src/ar/pages/version-details/VersionFactory.tsx @@ -20,9 +20,11 @@ import { HelmVersionType } from './HelmVersion/HelmVersionType' import { GenericVersionType } from './GenericVersion/GenericVersionType' import { MavenVersionType } from './MavenVersion/MavenVersion' import { NpmVersionType } from './NpmVersion/NpmVersionType' +import { PythonVersionType } from './PythonVersion/PythonVersionType' versionFactory.registerStep(new DockerVersionType()) versionFactory.registerStep(new HelmVersionType()) versionFactory.registerStep(new GenericVersionType()) versionFactory.registerStep(new MavenVersionType()) versionFactory.registerStep(new NpmVersionType()) +versionFactory.registerStep(new PythonVersionType()) diff --git a/web/src/ar/strings/strings.en.yaml b/web/src/ar/strings/strings.en.yaml index 99d2fac16..d0a1771e1 100644 --- a/web/src/ar/strings/strings.en.yaml +++ b/web/src/ar/strings/strings.en.yaml @@ -77,6 +77,7 @@ packageTypes: genericPackage: Generic mavenPackage: Maven Package npmPackage: npm + pythonPackage: Python Package repositoryTypes: docker: Docker helm: Helm diff --git a/web/src/ar/strings/types.ts b/web/src/ar/strings/types.ts index c5292ad2e..d6c55afa1 100644 --- a/web/src/ar/strings/types.ts +++ b/web/src/ar/strings/types.ts @@ -354,6 +354,7 @@ export interface StringsMap { 'packageTypes.helmPackage': string 'packageTypes.mavenPackage': string 'packageTypes.npmPackage': string + 'packageTypes.pythonPackage': string plaintext: string plusNewName: string prod: string