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

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

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

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

Loading…
Cancel
Save