Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support NuGet repositories hosted on Sonatype Nexus Repository #53

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3f68316
added options UI to add Sonatype Nexus Repository Manager URLs
madpah Jul 20, 2023
063c7d4
got content script working on added NXRM hosts
madpah Jul 20, 2023
f38f4db
detect a configured NXRM as a supported RepoType
madpah Jul 20, 2023
6752666
Merge branch 'main' into feat/support-sonatype-nexus-repository
madpah Jul 20, 2023
44361f8
wip attempting to parse NXRM browse page
madpah Jul 20, 2023
70f1ec6
working selectors for NXRM Maven2
madpah Jul 20, 2023
70a8f0c
displaying icon in repo
maurycupitt Jul 20, 2023
f5d50a4
work on NPM for NXRM and tests;
madpah Jul 21, 2023
1b61430
NXRM support for Maven, NPM and PyPI
madpah Jul 21, 2023
99ed731
updated selector and loading on connect
maurycupitt Jul 21, 2023
dd3d6c5
wip for RubyGems on NXRM
madpah Jul 21, 2023
e05f019
Merge branch 'feat/support-sonatype-nexus-repository' of github.com:s…
madpah Jul 21, 2023
21aef33
fix iq server link logo to platform
maurycupitt Jul 21, 2023
f876322
switch to parsing URI for NXRM - added RubyGem
madpah Jul 21, 2023
910d3e0
Merge branch 'feat/support-sonatype-nexus-repository' of github.com:s…
madpah Jul 21, 2023
8cce539
complete move to URI parsing
madpah Jul 21, 2023
2c45245
NXRM parsing for CocoaPods
madpah Jul 21, 2023
d390a96
get version and perform some shakedown checks when adding NXRM servers
madpah Jul 21, 2023
e98a67e
never try to sha an undefined
madpah Jul 21, 2023
b7bbe00
tighten manifest permissions
madpah Jul 21, 2023
a4435a9
wip to harden and ensure CSS removed in NXRM
madpah Jul 21, 2023
da7d7da
remove use of `crypto` which seems to cause issues
madpah Jul 21, 2023
0ba7a5f
ignore local ZIP files for GIT
madpah Aug 1, 2023
00ada7d
attempt to get SHA-1 hash for NuGet packages and include in PURL
madpah Aug 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated selector and loading on connect
maurycupitt committed Jul 21, 2023
commit 99ed73198bce40b21c5e39856e7876e02c96917c
13 changes: 11 additions & 2 deletions src/components/Options/IQServer/IQServerOptionsPage.tsx
Original file line number Diff line number Diff line change
@@ -30,11 +30,11 @@ import {
NxTile,
NxTextLink,
NxDivider,
NxTag,
NxTag
} from '@sonatype/react-shared-components'
import React, { useEffect, useState, useContext } from 'react'
import './IQServerOptionsPage.css'
import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons'
import { faQuestionCircle, faSpinner } from '@fortawesome/free-solid-svg-icons'
import { IconDefinition } from '@fortawesome/fontawesome-svg-core'
import { MESSAGE_REQUEST_TYPE, MESSAGE_RESPONSE_STATUS, MessageResponse } from '../../../types/Message'
import { DEFAULT_EXTENSION_SETTINGS, ExtensionConfiguration } from '../../../types/ExtensionConfiguration'
@@ -63,6 +63,7 @@ export default function IQServerOptionsPage(props: IqServerOptionsPageInterface)
const [iqAuthenticated, setIqAuthenticated] = useState<boolean | undefined>()
const [iqServerApplicationList, setiqServerApplicationList] = useState<Array<ApiApplicationDTO>>([])
const setExtensionConfig = props.setExtensionConfig
const [checkingConnection, setCheckingConnection] = useState(false)

/**
* Hook to check whether we already have permissions to IQ Server Host
@@ -144,6 +145,7 @@ export default function IQServerOptionsPage(props: IqServerOptionsPageInterface)
}

function handleLoginCheck() {
setCheckingConnection(true)
_browser.runtime
.sendMessage({
type: MESSAGE_REQUEST_TYPE.GET_APPLICATIONS,
@@ -153,6 +155,7 @@ export default function IQServerOptionsPage(props: IqServerOptionsPageInterface)
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.then((response: any) => {
setCheckingConnection(false)
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (_browser.runtime.lastError) {
logger.logMessage('Error handleLoginCheck', LogLevel.ERROR)
@@ -385,6 +388,12 @@ export default function IQServerOptionsPage(props: IqServerOptionsPageInterface)
</NxFormGroup>
<NxButton variant='primary' onClick={handleLoginCheck}>
{_browser.i18n.getMessage('OPTIONS_PAGE_SONATYPE_BUTTON_CONNECT_IQ')}
{checkingConnection === true && (
<React.Fragment>
&nbsp;&nbsp;&nbsp;<NxFontAwesomeIcon icon={faSpinner as IconDefinition} spin={true} />
</React.Fragment>

)}
</NxButton>
</div>
</div>
2 changes: 1 addition & 1 deletion src/utils/UrlParsing.ts
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ function findNxrmRepoType(url: string): Promise<RepoType | undefined> {
url: nxrmUrl,
repoFormat: FORMATS.NXRM,
repoID: `NXRM-${nxrmUrl}`,
titleSelector: "#nx-coreui-component-componentassetinfo-1200_header-title-textEl",
titleSelector: "[id^='nx-coreui-component-componentassetinfo'][id$='header-title-textEl']",
}
}
}