plugins offline

pull/4346/head
filip mertens 12 months ago
parent cbf2e03adc
commit 66dfc27872
  1. 11
      .circleci/config.yml
  2. 3
      apps/remix-ide/src/app/tabs/locales/en/pluginManager.json
  3. 2
      libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCardContainer.tsx
  4. 27
      libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCard.tsx
  5. 2
      libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCardContainer.tsx
  6. 6
      libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx

@ -135,16 +135,6 @@ jobs:
path: apps/remixdesktop/release/
destination: remixdesktop-linux
SSM_Signing:
executor: win/server-2022
steps:
- run:
name: "Client-Tool-Setup"
command: |
cd C:\
curl.exe -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:$env:SM_API_KEY" -o smtools-windows-x64.msi
msiexec.exe /i smtools-windows-x64.msi /quiet /qn
build-remixdesktop-windows:
executor:
name: win/default # executor type
@ -447,7 +437,6 @@ workflows:
build_all:
unless: << pipeline.parameters.run_flaky_tests >>
jobs:
- SSM_Signing
- build
- build-desktop:
filters:

@ -39,5 +39,6 @@
"pluginManager.deactivatePlugin": "Deactivate {pluginName}",
"pluginManager.activatePlugin": "Activate {pluginName}",
"pluginManager.search": "Search",
"pluginManager.managePluginsPermissions": "Manage plugins Permissions"
"pluginManager.managePluginsPermissions": "Manage plugins Permissions",
"pluginManager.UnavailableOffline": "Unavailable Offline"
}

@ -8,8 +8,6 @@ import ModuleHeading from './moduleHeading'
interface ActivePluginCardContainerProps {
pluginComponent: PluginManagerComponent
setActiveProfiles: React.Dispatch<React.SetStateAction<Profile<any>[]>>
activeProfiles: Profile[]
}
function ActivePluginCardContainer({pluginComponent}: ActivePluginCardContainerProps) {
const deactivatePlugin = (pluginName: string) => {

@ -1,18 +1,32 @@
import {Profile} from '@remixproject/plugin-utils'
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-use-before-define
import React from 'react'
import {FormattedMessage} from 'react-intl'
import React, { useContext, useEffect, useState } from 'react'
import {FormattedMessage, useIntl} from 'react-intl'
import '../remix-ui-plugin-manager.css'
import {CustomTooltip} from '@remix-ui/helper'
import { AppContext } from '@remix-ui/app'
interface PluginCardProps {
profile: Profile & {
icon?: string
}
profile: any
buttonText: string
activatePlugin: (plugin: string) => void
}
function InactivePluginCard({profile, buttonText, activatePlugin}: PluginCardProps) {
const {online} = useContext(AppContext)
const [canBeActivated, setCanBeActivated] = useState(false)
const intl = useIntl()
useEffect(() => {
if(!online) {
if(profile.url && (!profile.url.includes('http') || profile.url.includes('localhost') || profile.url.includes('127.0.0.1'))) {
setCanBeActivated(true)
}else{
setCanBeActivated(false)
}
}else{
setCanBeActivated(true)
}
},[online])
return (
<div className="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile">
<article className="list-group-item py-1 mb-1 plugins-list-group-item">
@ -69,6 +83,7 @@ function InactivePluginCard({profile, buttonText, activatePlugin}: PluginCardPro
tooltipClasses="text-nowrap"
tooltipText={<FormattedMessage id="pluginManager.activatePlugin" values={{pluginName: profile.displayName || profile.name}} />}
>
{!canBeActivated ? <button className="btn btn-secondary btn-sm">{intl.formatMessage({id: 'pluginManager.UnavailableOffline'})}</button> : (
<button
onClick={() => {
activatePlugin(profile.name)
@ -77,7 +92,7 @@ function InactivePluginCard({profile, buttonText, activatePlugin}: PluginCardPro
data-id={`pluginManagerComponentActivateButton${profile.name}`}
>
{buttonText}
</button>
</button>)}
</CustomTooltip>
}
</h6>

@ -8,8 +8,6 @@ import ModuleHeading from './moduleHeading'
interface InactivePluginCardContainerProps {
pluginComponent: PluginManagerComponent
setInactiveProfiles: React.Dispatch<React.SetStateAction<Profile<any>[]>>
inactiveProfiles: Profile<any>[]
}
function InactivePluginCardContainer({pluginComponent}: InactivePluginCardContainerProps) {

@ -8,13 +8,11 @@ import RootView from './components/rootView'
import './remix-ui-plugin-manager.css'
export const RemixUiPluginManager = ({pluginComponent}: RemixUiPluginManagerProps) => {
const [activeProfiles, setActiveProfiles] = useState<Profile[]>(pluginComponent.activePlugins)
const [inactiveProfiles, setinactiveProfiles] = useState<Profile[]>(pluginComponent.inactivePlugins)
return (
<RootView pluginComponent={pluginComponent}>
<section data-id="pluginManagerComponentPluginManagerSection">
<ActivePluginCardContainer pluginComponent={pluginComponent} setActiveProfiles={setActiveProfiles} activeProfiles={activeProfiles} />
<InactivePluginCardContainer pluginComponent={pluginComponent} setInactiveProfiles={setinactiveProfiles} inactiveProfiles={inactiveProfiles} />
<ActivePluginCardContainer pluginComponent={pluginComponent} />
<InactivePluginCardContainer pluginComponent={pluginComponent} />
</section>
</RootView>
)

Loading…
Cancel
Save