Merge pull request #2082 from ethereum/issue#2080-plugin_version_warning

Add warning for plugin version
pull/1/head
yann300 6 years ago committed by GitHub
commit 8c81a9a130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      src/app/components/plugin-manager-component.js
  2. 27
      src/app/components/side-panel.js
  3. 4
      src/app/editor/SourceHighlighters.js
  4. 4
      src/app/files/fileManager.js
  5. 5
      src/app/files/remixd-handle.js
  6. 4
      src/app/panels/file-panel.js
  7. 4
      src/app/panels/terminal.js
  8. 4
      src/app/tabs/analysis-tab.js
  9. 4
      src/app/tabs/compile-tab.js
  10. 4
      src/app/tabs/debugger-tab.js
  11. 4
      src/app/tabs/network-module.js
  12. 4
      src/app/tabs/run-tab.js
  13. 4
      src/app/tabs/settings-tab.js
  14. 4
      src/app/tabs/theme-module.js
  15. 4
      src/app/ui/landing-page/landing-page.js
  16. 4
      src/universal-dapp.js

@ -4,6 +4,7 @@ const EventEmitter = require('events')
const LocalPlugin = require('./local-plugin')
import { Plugin, BaseApi } from 'remix-plugin'
import { PluginManagerSettings } from './plugin-manager-settings'
import * as packageJson from '../../../package.json'
const addToolTip = require('../ui/tooltip')
const css = csjs`
@ -23,6 +24,9 @@ const css = csjs`
}
.displayName {
text-transform: capitalize;
display: flex;
flex-direction: column;
align-items: flex-start;
}
.description {
text-transform: capitalize;
@ -35,6 +39,14 @@ const css = csjs`
background-color: var(--primary);
color:
}
.versionWarning {
background-color: var(--light);
padding: 0 7px;
font-weight: bolder;
margin-top: 5px;
text-transform: lowercase;
cursor: default;
}
`
const profile = {
@ -46,7 +58,8 @@ const profile = {
description: 'Start/stop services, modules and plugins',
kind: 'settings',
location: 'sidePanel',
documentation: 'plugin_manager.html'
documentation: 'plugin_manager.html',
version: packageJson.version
}
class PluginManagerComponent extends BaseApi {
@ -80,6 +93,17 @@ class PluginManagerComponent extends BaseApi {
const isActive = this.store.actives.includes(name)
const displayName = (api.profile.displayName) ? api.profile.displayName : name
// Check version of the plugin
let versionWarning
// Alpha
if (api.profile.version && api.profile.version.match(/\b(\w*alpha\w*)\b/g)) {
versionWarning = yo`<small title="Version Alpha" class="${css.versionWarning}">alpha</small>`
}
// Beta
if (api.profile.version && api.profile.version.match(/\b(\w*beta\w*)\b/g)) {
versionWarning = yo`<small title="Version Beta" class="${css.versionWarning}">beta</small>`
}
const activationButton = isActive
? yo`
<button onclick="${_ => this.appManager.deactivateOne(name)}" class="btn btn-secondary btn-sm">
@ -93,7 +117,10 @@ class PluginManagerComponent extends BaseApi {
return yo`
<article id="remixPluginManagerListItem_${name}" class="list-group-item py-1" title="${displayName}" >
<div class="${css.row} justify-content-between align-items-center">
<h6 class="${css.displayName}">${displayName}</h6>
<h6 class="${css.displayName}">
${displayName}
${versionWarning}
</h6>
${activationButton}
</div>
<p class="${css.description}">${api.profile.description}</p>

@ -8,6 +8,7 @@ const css = csjs`
overflow-y: hidden;
}
.swapitTitle {
margin: 0;
text-transform: uppercase;
white-space: nowrap;
overflow: hidden;
@ -21,12 +22,7 @@ const css = csjs`
height: 35px;
padding: 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
justify-content: flex-start;
}
.swapitHeader h6 {
margin: 0;
}
.icons i {
height: 80%;
@ -39,6 +35,14 @@ const css = csjs`
.titleInfo {
padding-left: 10px;
}
.versionWarning {
background-color: var(--light);
padding: 0 7px;
font-weight: bolder;
margin-left: 5px;
text-transform: lowercase;
cursor: default;
}
`
const options = {
@ -66,17 +70,26 @@ export class SidePanel extends AbstractPanel {
renderHeader () {
let name = ' - '
let docLink = ''
let versionWarning
if (this.active) {
const { profile } = this.store.getOne(this.active)
name = profile.displayName ? profile.displayName : profile.name
const docsRoot = 'https://remix.readthedocs.io/en/latest/'
docLink = profile.documentation ? yo`<a href="${docsRoot}${profile.documentation}" class="${css.titleInfo}" title="link to documentation" target="_blank"><i aria-hidden="true" class="fas fa-book"></i></a>` : ''
if (profile.version && profile.version.match(/\b(\w*alpha\w*)\b/g)) {
versionWarning = yo`<small title="Version Alpha" class="${css.versionWarning}">alpha</small>`
}
// Beta
if (profile.version && profile.version.match(/\b(\w*beta\w*)\b/g)) {
versionWarning = yo`<small title="Version Beta" class="${css.versionWarning}">beta</small>`
}
}
return yo`
<header class="${css.swapitHeader}">
<h6 class="${css.swapitTitle}">${name}</h6>
${docLink}
<h6 class="${css.swapitTitle}">${name}</h6>
${docLink}
${versionWarning}
</header>
`
}

@ -2,11 +2,13 @@
const SourceHighlighter = require('./sourceHighlighter')
import { EditorApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
const profile = {
displayName: 'source highlighters',
name: 'editor',
description: 'service - highlight source code'
description: 'service - highlight source code',
version: packageJson.version
}
// EditorApi:

@ -6,6 +6,7 @@ var globalRegistry = require('../../global/registry')
var CompilerImport = require('../compiler/compiler-imports')
var toaster = require('../ui/tooltip')
import { FileSystemApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
/*
attach to files event (removed renamed)
@ -17,7 +18,8 @@ const profile = {
displayName: 'File manager',
description: 'Service - read/write to any files or folders, require giving permissions',
icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4=',
permission: true
permission: true,
version: packageJson.version
}
// File System profile

@ -1,6 +1,6 @@
let globalRegistry = require('../../global/registry')
import { BaseApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
var yo = require('yo-yo')
var modalDialog = require('../ui/modaldialog')
var modalDialogCustom = require('../ui/modal-dialog-custom')
@ -23,7 +23,8 @@ const profile = {
methods: [],
events: [],
description: 'using Remixd daemon, allow to access file system',
kind: 'other'
kind: 'other',
version: packageJson.version
}
export class RemixdHandle extends BaseApi {

@ -7,6 +7,7 @@ var globalRegistry = require('../../global/registry')
var css = require('./styles/file-panel-styles')
import { BaseApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
var canUpload = window.File || window.FileReader || window.FileList || window.Blob
@ -36,7 +37,8 @@ const profile = {
description: ' - ',
kind: 'fileexplorer',
location: 'sidePanel',
documentation: 'file_explorer.html'
documentation: 'file_explorer.html',
version: packageJson.version
}
module.exports = class Filepanel extends BaseApi {

@ -17,6 +17,7 @@ var csjs = require('csjs-inject')
var css = require('./styles/terminal-styles')
import { BaseApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
var packageV = require('../../../package.json')
@ -32,7 +33,8 @@ const profile = {
methods: [],
events: [],
description: ' - ',
required: false
required: false,
version: packageJson.version
}
class Terminal extends BaseApi {

@ -5,6 +5,7 @@ var css = require('./styles/analysis-tab-styles')
import { BaseApi } from 'remix-plugin'
import { EventEmitter } from 'events'
import * as packageJson from '../../../package.json'
const profile = {
name: 'solidityStaticAnalysis',
@ -15,7 +16,8 @@ const profile = {
description: 'Checks the contract code for security vulnerabilities and bad practices.',
kind: 'analysis',
location: 'sidePanel',
documentation: 'static_analysis.html'
documentation: 'static_analysis.html',
version: packageJson.version
}
class AnalysisTab extends BaseApi {

@ -18,6 +18,7 @@ const CompileTabLogic = require('./compileTab/compileTab.js')
const CompilerContainer = require('./compileTab/compilerContainer.js')
import { CompilerApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
const profile = {
name: 'solidity',
@ -27,7 +28,8 @@ const profile = {
kind: 'compile',
permission: true,
location: 'sidePanel',
documentation: 'solidity_editor.html'
documentation: 'solidity_editor.html',
version: packageJson.version
}
// EditorApi:

@ -4,6 +4,7 @@ var css = require('./styles/debugger-tab-styles')
var DebuggerUI = require('../debugger/debuggerUI')
import { BaseApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
const profile = {
name: 'debugger',
@ -14,7 +15,8 @@ const profile = {
description: 'Debug transactions',
kind: 'debugging',
location: 'sidePanel',
documentation: 'debugger.html'
documentation: 'debugger.html',
version: packageJson.version
}
class DebuggerTab extends BaseApi {

@ -1,9 +1,11 @@
const executionContext = require('../../execution-context')
import { NetworkApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
export const profile = {
name: 'network',
description: 'Manage the network (mainnet, ropsten, goerli...) and the provider (web3, vm, injected)'
description: 'Manage the network (mainnet, ropsten, goerli...) and the provider (web3, vm, injected)',
version: packageJson.version
}
// Network API has :

@ -15,6 +15,7 @@ var RecorderUI = require('./runTab/recorder.js')
const executionContext = require('../../execution-context')
import { BaseApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
const profile = {
name: 'run',
@ -25,7 +26,8 @@ const profile = {
description: 'execute and save transactions',
kind: 'run',
location: 'sidePanel',
documentation: 'run.html'
documentation: 'run.html',
version: packageJson.version
}
class RunTab extends BaseApi {

@ -5,6 +5,7 @@ var copyToClipboard = require('../ui/copy-to-clipboard')
var EventManager = require('../../lib/events')
var css = require('./styles/settings-tab-styles')
import { BaseApi } from 'remix-plugin'
import * as packageJson from '../../../package.json'
const profile = {
name: 'settings',
@ -15,7 +16,8 @@ const profile = {
description: 'Remix-IDE settings',
kind: 'settings',
location: 'sidePanel',
documentation: 'settings.html'
documentation: 'settings.html',
version: packageJson.version
}
module.exports = class SettingsTab extends BaseApi {

@ -1,5 +1,6 @@
import { BaseApi } from 'remix-plugin'
import { EventEmitter } from 'events'
import * as packageJson from '../../../package.json'
const themes = [
{name: 'Cerulean', quality: 'light', url: 'https://bootswatch.com/4/cerulean/bootstrap.min.css'},
@ -19,7 +20,8 @@ const themes = [
const profile = {
name: 'theme',
events: ['themeChanged'],
methods: ['switchTheme', 'getThemes', 'currentTheme']
methods: ['switchTheme', 'getThemes', 'currentTheme'],
version: packageJson.version
}
export class ThemeModule extends BaseApi {

File diff suppressed because one or more lines are too long

@ -9,12 +9,14 @@ var EventManager = remixLib.EventManager
var executionContext = remixLib.execution.executionContext
import { UdappApi } from 'remix-plugin'
import { EventEmitter } from 'events'
import * as packageJson from '../package.json'
const profile = {
name: 'udapp',
displayName: 'universal dapp',
description: 'service - run transaction and access account',
permission: true
permission: true,
version: packageJson.version
}
module.exports = class UniversalDApp extends UdappApi {

Loading…
Cancel
Save