pull/2668/head
filip mertens 3 years ago
parent 72c819024a
commit 1e4c047652
  1. 8
      apps/remix-ide-e2e/src/tests/file_decorator.test.ts
  2. 6
      libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx
  3. 6
      libs/remix-ui/file-decorators/src/lib/helper/index.tsx
  4. 2
      libs/remix-ui/file-decorators/src/lib/types/index.ts

@ -48,7 +48,7 @@ const testScript = `
text: '2', text: '2',
owner: 'code-parser', owner: 'code-parser',
bubble: true, bubble: true,
commment: 'error on owner', comment: 'error on owner',
} }
let decorator2: any = { let decorator2: any = {
path: 'contracts/2_Owner.sol', path: 'contracts/2_Owner.sol',
@ -60,7 +60,7 @@ const testScript = `
text: '', text: '',
owner: 'code-parser', owner: 'code-parser',
bubble: true, bubble: true,
commment: 'modified', comment: 'modified',
} }
remix.call('fileDecorator' as any, 'setFileDecorators', [decorator, decorator2]) remix.call('fileDecorator' as any, 'setFileDecorators', [decorator, decorator2])
@ -74,7 +74,7 @@ const testScript = `
text: '2', text: '2',
owner: 'code-parser', owner: 'code-parser',
bubble: true, bubble: true,
commment: 'warning on storage', comment: 'warning on storage',
} }
remix.call('fileDecorator' as any, 'setFileDecorators', decorator) remix.call('fileDecorator' as any, 'setFileDecorators', decorator)
@ -88,7 +88,7 @@ const testScript = `
text: 'w', text: 'w',
owner: 'dgit', owner: 'dgit',
bubble: true, bubble: true,
commment: '', comment: '',
} }
remix.call('fileDecorator' as any, 'setFileDecorators', decorator) remix.call('fileDecorator' as any, 'setFileDecorators', decorator)

@ -9,9 +9,9 @@ const FileDecorationTooltip = (props: {
}, },
) => { ) => {
const getComments = function (fileDecoration: fileDecoration) { const getComments = function (fileDecoration: fileDecoration) {
if (fileDecoration.commment) { if (fileDecoration.comment) {
const commments = Array.isArray(fileDecoration.commment) ? fileDecoration.commment : [fileDecoration.commment] const comments = Array.isArray(fileDecoration.comment) ? fileDecoration.comment : [fileDecoration.comment]
return commments.map((comment, index) => { return comments.map((comment, index) => {
return <div key={index}>{comment}<br></br></div> return <div key={index}>{comment}<br></br></div>
}) })
} }

@ -2,9 +2,9 @@ import React from "react"
import { fileDecoration } from "../types" import { fileDecoration } from "../types"
export const getComments = function (fileDecoration: fileDecoration) { export const getComments = function (fileDecoration: fileDecoration) {
if(fileDecoration.commment){ if(fileDecoration.comment){
const commments = Array.isArray(fileDecoration.commment) ? fileDecoration.commment : [fileDecoration.commment] const comments = Array.isArray(fileDecoration.comment) ? fileDecoration.comment : [fileDecoration.comment]
return commments.map((comment, index) => { return comments.map((comment, index) => {
return <div key={index}>{comment}<br></br></div> return <div key={index}>{comment}<br></br></div>
}) })
} }

@ -17,7 +17,7 @@ export enum fileDecorationType {
owner: string, owner: string,
workspace?: any workspace?: any
tooltip?: string tooltip?: string
commment?: string[] | string comment?: string[] | string
} }
export interface FileType { export interface FileType {

Loading…
Cancel
Save