-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split viewer-prototype in packages #172
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
], | ||
"env": { | ||
"browser": true, | ||
"mocha": true, | ||
"node": true | ||
}, | ||
"ignorePatterns": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
parser: "@typescript-eslint/parser", // Specifies the ESLint parser | ||
parserOptions: { | ||
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features | ||
sourceType: "module", // Allows for the use of imports | ||
tsconfigRootDir: __dirname, | ||
project: 'tsconfig.json', | ||
projectFolderIgnoreList: [ | ||
'/lib/' | ||
] | ||
}, | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'../../configs/base.eslintrc.json', | ||
'../../configs/warnings.eslintrc.json', | ||
'../../configs/errors.eslintrc.json' | ||
], | ||
ignorePatterns: [ | ||
'node_modules', | ||
'lib', | ||
'.eslintrc.js', | ||
'plugins' | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@trace-viewer/base", | ||
"version": "0.0.0", | ||
"description": "Trace Compass base package, contains trace management utilities", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/theia-ide/theia-trace-extension" | ||
}, | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"dependencies": { | ||
"tsp-typescript-client": "next" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^3.4.0", | ||
"@typescript-eslint/parser": "^3.4.0", | ||
"eslint": "^7.3.0", | ||
"eslint-plugin-import": "^2.21.2", | ||
"eslint-plugin-no-null": "^1.0.2", | ||
"eslint-plugin-react": "^7.20.0", | ||
"rimraf": "latest", | ||
"typescript": "latest" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"clean": "rimraf lib", | ||
"lint": "eslint .", | ||
"prepare": "yarn clean && yarn build", | ||
"test": "echo 'test'", | ||
"watch": "tsc -w" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
export enum MessageCategory { | ||
TRACE_CONTEXT, | ||
SERVER_MESSAGE, | ||
SERVER_STATUS, | ||
} | ||
|
||
export enum MessageSeverity { | ||
ERROR, | ||
WARNING, | ||
INFO, | ||
DEBUG | ||
} | ||
|
||
export interface StatusMessage { | ||
text: string; | ||
category?: MessageCategory; | ||
severity?: MessageSeverity; | ||
} | ||
|
||
export declare interface MessageManager { | ||
|
||
addStatusMessage(messageKey: string, message: StatusMessage): void; | ||
removeStatusMessage(messageKey: string): void; | ||
|
||
} | ||
|
||
export class MessageManager implements MessageManager { | ||
|
||
addStatusMessage(messageKey: string, {text, | ||
category = MessageCategory.SERVER_MESSAGE, | ||
severity = MessageSeverity.INFO }: StatusMessage): void { | ||
console.log('New status message', messageKey, text, category, severity); | ||
} | ||
|
||
removeStatusMessage(messageKey: string): void { | ||
console.log('Removing status message status message', messageKey); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { EventEmitter } from 'events'; | ||
|
||
export declare interface SignalManager { | ||
|
||
fireTooltipSignal(tooltip: { [key: string]: string }): void; | ||
|
||
} | ||
|
||
export const Signals = { | ||
TRACE_OPENED : 'trace opened', | ||
TRACE_CLOSED : 'trace closed', | ||
EXPERIMENT_OPENED: 'experiment opened', | ||
EXPERIMENT_CLOSED: 'experiment closed', | ||
EXPERIMENT_SELECTED: 'experiment selected', | ||
TOOLTIP_UPDATED: 'tooltip updated' | ||
}; | ||
|
||
export class SignalManager extends EventEmitter implements SignalManager { | ||
|
||
fireTooltipSignal(tooltip: { [key: string]: string; }): void { | ||
this.emit(Signals.TOOLTIP_UPDATED, {tooltip}); | ||
} | ||
|
||
} | ||
|
||
let instance: SignalManager = new SignalManager(); | ||
|
||
export const setSignalManagerInstance = (sm: SignalManager) => { | ||
instance = sm; | ||
}; | ||
|
||
export const signalManager = (): SignalManager => instance; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see the Tooltip window in the trace viewer, but it's not populated anymore. I wonder if the removal of that functionality should be in this patch or separate. Maybe, it should be done in a separate PR so that this PR is only about the restructuring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't figure out yet about how to send tooltip signals from the react-component. Or actually, I did think of something, but wondered if it was a good idea to keep it or not, or if it should be another kind of signal (like in the Properties, so that whichever element is selected, we can display stuff in the window we now call Tooltip. Should I bring back the tooltip functionality now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be put back, right?