Merge pull request #1936 from ethereum/swap_it_style_fixes_l

status update key has been renamed
pull/1/head
yann300 6 years ago committed by GitHub
commit 5d56e7d1f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/app/components/vertical-icons-component.js
  2. 2
      src/app/tabs/analysis-tab.js
  3. 6
      src/app/tabs/compile-tab.js

@ -53,7 +53,7 @@ class VerticalIconComponent {
if (!api.events) return if (!api.events) return
// the list of supported keys. 'none' will remove the status // the list of supported keys. 'none' will remove the status
const keys = ['edited', 'success', 'none', 'spinner', 'fail'] const keys = ['edited', 'succeed', 'none', 'loading', 'failed']
const types = ['error', 'warning', 'success', 'info', ''] const types = ['error', 'warning', 'success', 'info', '']
const fn = (status) => { const fn = (status) => {
if (!types.includes(status.type) && status.type) throw new Error(`type should be ${keys.join()}`) if (!types.includes(status.type) && status.type) throw new Error(`type should be ${keys.join()}`)
@ -92,16 +92,16 @@ class VerticalIconComponent {
resolveClasses (key, type) { resolveClasses (key, type) {
let classes = css.status let classes = css.status
switch (key) { switch (key) {
case 'success': case 'succeed':
classes += ' fas fa-check-circle text-' + type + ' ' + css.statusCheck classes += ' fas fa-check-circle text-' + type + ' ' + css.statusCheck
break break
case 'edited': case 'edited':
classes += ' fas fa-sync text-' + type + ' ' + css.statusCheck classes += ' fas fa-sync text-' + type + ' ' + css.statusCheck
break break
case 'spinner': case 'loading':
classes += ' fas fa-spinner text-' + type + ' ' + css.statusCheck classes += ' fas fa-spinner text-' + type + ' ' + css.statusCheck
break break
case 'fail': case 'failed':
classes += ' fas fa-exclamation-triangle text-' + type + ' ' + css.statusCheck classes += ' fas fa-exclamation-triangle text-' + type + ' ' + css.statusCheck
break break
default: { default: {

@ -32,7 +32,7 @@ class AnalysisTab extends BaseApi {
if (count > 0) { if (count > 0) {
this.events.emit('statusChanged', {key: count, title: `${count} warning${count === 1 ? '' : 's'}`, type: 'warning'}) this.events.emit('statusChanged', {key: count, title: `${count} warning${count === 1 ? '' : 's'}`, type: 'warning'})
} else if (count === 0) { } else if (count === 0) {
this.events.emit('statusChanged', {key: 'success', title: 'no warning', type: 'success'}) this.events.emit('statusChanged', {key: 'succeed', title: 'no warning', type: 'success'})
} else { } else {
// count ==-1 no compilation result // count ==-1 no compilation result
this.events.emit('statusChanged', {key: 'none'}) this.events.emit('statusChanged', {key: 'none'})

@ -83,7 +83,7 @@ class CompileTab extends CompilerApi {
this.editor.event.register('sessionSwitched', onContentChanged) this.editor.event.register('sessionSwitched', onContentChanged)
this.compiler.event.register('loadingCompiler', () => { this.compiler.event.register('loadingCompiler', () => {
this.events.emit('statusChanged', {key: 'spinner', title: 'loading compiler...', type: 'info'}) this.events.emit('statusChanged', {key: 'loading', title: 'loading compiler...', type: 'info'})
}) })
this.compiler.event.register('compilerLoaded', () => { this.compiler.event.register('compilerLoaded', () => {
@ -94,7 +94,7 @@ class CompileTab extends CompilerApi {
if (this._view.errorContainer) { if (this._view.errorContainer) {
this._view.errorContainer.innerHTML = '' this._view.errorContainer.innerHTML = ''
} }
this.events.emit('statusChanged', {key: 'spinner', title: 'compiling...', type: 'info'}) this.events.emit('statusChanged', {key: 'loading', title: 'compiling...', type: 'info'})
}) })
this.fileManager.events.on('currentFileChanged', (name) => { this.fileManager.events.on('currentFileChanged', (name) => {
@ -123,7 +123,7 @@ class CompileTab extends CompilerApi {
title: `compilation finished successful with warning${data.errors.length > 1 ? 's' : ''}`, title: `compilation finished successful with warning${data.errors.length > 1 ? 's' : ''}`,
type: 'warning' type: 'warning'
}) })
} else this.events.emit('statusChanged', {key: 'success', title: 'compilation successful', type: 'success'}) } else this.events.emit('statusChanged', {key: 'succeed', title: 'compilation successful', type: 'success'})
// Store the contracts // Store the contracts
this.data.contractsDetails = {} this.data.contractsDetails = {}
this.compiler.visitContracts((contract) => { this.compiler.visitContracts((contract) => {

Loading…
Cancel
Save