Skip to content

Commit

Permalink
fix: Obtain version of this extension from the manifest
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <phorton@sonatype.com>
  • Loading branch information
madpah committed Jul 12, 2023
1 parent 4c639df commit a89c48c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"assets": "build/*.tgz"
}],
["@semantic-release/git", {
"assets": ["CHANGELOG.md"]
"assets": ["CHANGELOG.md", "package.json"]
}]
]
}
9 changes: 4 additions & 5 deletions src/options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import {
} from '@sonatype/react-shared-components'
import React from 'react'
import ReactDOM from 'react-dom/client'
import { homepage as packageHomepage, version as packageVersion } from '../package.json'
import { NexusOptionsContainer } from './NexusOptionsContainer'
import { logger, LogLevel } from './logger/Logger'
import { MESSAGE_REQUEST_TYPE } from './types/Message'
import { readExtensionConfiguration } from './messages/SettingsMessages'

// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions, @typescript-eslint/no-explicit-any
const _browser: any = chrome ? chrome : browser
const extension = _browser.runtime.getManifest()

const container = document.getElementById('ui')
const root = ReactDOM.createRoot(container)
Expand All @@ -49,8 +49,7 @@ root.render(
toggleOpenIcon={faArrowLeft as IconDefinition}
logoImg='images/sonatype-lifecycle-logo-nav-white.svg'
logoAltText='Sonatype Browser Extension'
logoLink='#'
>
logoLink='#'>
<NxGlobalSidebarNavigation>
<NxGlobalSidebarNavigationLink
icon={faPlay as IconDefinition}
Expand All @@ -66,8 +65,8 @@ root.render(
</NxGlobalSidebarNavigation>
<NxGlobalSidebarFooter
supportText={`Request Support`}
supportLink={packageHomepage}
releaseText={`Release ${packageVersion}`}
supportLink={extension.homepage_url}
releaseText={`Release ${extension.version}`}
productTagLine='Powered by Sonatype IQ Server & Sonatype OSS Index'
showCreatedBy={true}
/>
Expand Down
5 changes: 4 additions & 1 deletion src/utils/UserAgentHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const extension = chrome.runtime.getManifest()

// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions, @typescript-eslint/no-explicit-any
const _browser: any = chrome ? chrome : browser
const extension = _browser.runtime.getManifest()

export class UserAgentHelper {
public static getUserAgent(): string {
Expand Down

0 comments on commit a89c48c

Please sign in to comment.