-
Notifications
You must be signed in to change notification settings - Fork 106
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
Merge TS context isolation branch onto Typescript master branch #598
Merge TS context isolation branch onto Typescript master branch #598
Conversation
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.
Please handle the below points
- Surround all
if
statements with braces. - Update the logger code to include rotation based on date & remove max size
- Add comments where the logic is complex
@@ -132,7 +132,9 @@ <h1>Symphony Electron API Demo</h1> | |||
|
|||
num++; | |||
|
|||
var notf = new ssf.Notification(title, { |
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.
Can we retain this till we completely move to context isolation?
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.
No. In this branch, ssf
does not exist
demo/index.html
Outdated
|
||
notf.addEventListener('click', onclick); | ||
/*notf.addEventListener('click', onclick); |
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.
remove commented code
if (this.screenSharingIndicatorWindow | ||
&& this.windowExists(this.screenSharingIndicatorWindow)) this.screenSharingIndicatorWindow.close(); | ||
if (winKey) { | ||
const browserWindow = this.windows[ winKey ]; |
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.
remove extra spaces inside the array
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 is TS
recommended
displayId.includes(d.id.toString()))[ 0 ]) || electron.screen.getPrimaryDisplay(); | ||
|
||
const screenRect = indicatorScreen.workArea; | ||
let opts = { ...WindowHandler.getScreenSharingIndicatorOpts(), ...{ winKey: streamId } }; |
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.
can you add a comment above explaining what this logic is about
src/common/animation-queue.ts
Outdated
* @param object | ||
*/ | ||
public animate(object) { | ||
object.func.apply(null, object.args) |
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.
can we not use async await?
*/ | ||
public setWindowPosition(window: Electron.BrowserWindow, x: number, y: number) { | ||
if (window && !window.isDestroyed()) { | ||
window.setPosition(parseInt(String(x), 10), parseInt(String(y), 10)); |
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.
what happens if parseInt fails? wouldn't it be better to have defaults?
src/renderer/notification-handler.ts
Outdated
*/ | ||
public setupNotificationPosition() { | ||
// This feature only applies to windows | ||
if (!isMac) { |
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.
let's invert the condition. If it is mac, return.
constructor(opts) { | ||
super(opts); | ||
ipcMain.on('close-notification', (_event, windowId) => { | ||
this.hideNotification(windowId); |
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.
does this destroy the browser window or just hide it?
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 just hides the browser window
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.
But won't that be waste of resources. What happens if we close it?
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.
Approx 200mb will be reserved based on the display width for about a min. Without this, every notification will be rendered a fresh which looks delayed
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.
Understood, thanks for the explanation.
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.
Please, fix this variable in /.../SymphonyElectron/spec/screenSharingIndicator.spec.ts
wrapper.setState({ streamId: 'id-123' }); // add this
const closeIpcRendererMock = {
cmd: 'close-window',
windowType: 'screen-sharing-indicator',
winKey: 'id-123', // add this
};
this unit test is failing: 'should call close
correctly'
src/common/api-interface.ts
Outdated
} | ||
|
||
export type LogLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly'; |
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.
could you insert a newline at end file ?
src/app/window-utils.ts
Outdated
* @param window {BrowserWindow} | ||
* @return boolean | ||
*/ | ||
export const windowExists = (window: BrowserWindow): boolean => !!window && typeof window.isDestroyed === 'function' && !window.isDestroyed(); |
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.
could you insert a newline at end file ?
src/renderer/app-bridge.ts
Outdated
window.postMessage({ method, data }, this.origin); | ||
} | ||
|
||
} |
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.
could you insert a newline at end file ?
private updateState(_event, data): void { | ||
this.setState(data as IState); | ||
} | ||
} |
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.
could you insert a newline at end file ?
src/renderer/notification-handler.ts
Outdated
this.nextInsertPos.y = this.settings.firstPos.y; | ||
} | ||
|
||
} |
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.
could you insert a newline at end file ?
opacity: 0.6; | ||
width: 43px; | ||
content: var(--logo-bg); | ||
} |
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.
could you insert a newline at end file ?
@VishwasShashidhar @vrbsm I've updated PR as per the changes. Please review. Thanks 🙂 |
Add code documentation Add pre-commit hooks
* adding enzyme * download manager unit test
* screen picker unit test * screen sharing indicator unit test
5b38c72
to
6f9c315
Compare
2b77554
to
c2c8b13
Compare
…-1022 # Conflicts: # gulpfile.js # spec/screenSharingIndicator.spec.ts # src/app/activity-detection.ts # src/app/app-cache-handler.ts # src/app/auto-launch-controller.ts # src/app/child-window-handler.ts # src/app/chrome-flags.ts # src/app/config-handler.ts # src/app/crypto-handler.ts # src/app/dialog-handler.ts # src/app/main-api-handler.ts # src/app/main.ts # src/app/protocol-handler.ts # src/app/reports-handler.ts # src/app/screen-snippet-handler.ts # src/app/spell-check-handler.ts # src/app/window-actions.ts # src/app/window-handler.ts # src/app/window-utils.ts # src/common/api-interface.ts # src/common/env.ts # src/common/i18n-preload.ts # src/common/i18n.ts # src/common/logger.ts # src/common/utils.ts # src/renderer/components/about-app.tsx # src/renderer/components/download-manager.tsx # src/renderer/components/loading-screen.tsx # src/renderer/components/more-info.tsx # src/renderer/components/screen-picker.tsx # src/renderer/components/screen-sharing-indicator.tsx # src/renderer/components/snack-bar.tsx # src/renderer/desktop-capturer.ts # src/renderer/preload-component.ts # src/renderer/preload-main.ts # src/renderer/ssf-api.ts # src/renderer/styles/about-app.less # src/renderer/styles/screen-sharing-indicator.less # tslint.json
…s#598) * Typescript 🎉 * Typescript 🎉 (logger, get-guid, string-format and throttle) * Refactor typescript code * consolidate all the utility functions to one file * refactor protocol handler feature * Typescript: Add code documentation Add pre-commit hooks * Typescript: Fix logger formatting * Typescript: Add support for react * Typescript: Completed about app * Typescript: Completed about app * Typescript: Completed about app * Typescript - Fix issues with about-app and add login to convert less to css * Typescript - Fix loading screen * Typescript - Add custom title bar * Typescript - Add method to get locale * Typescript - Add logic to clean up old logs * Typescript - Add set badge count api * Typescript - Complete application menu * Typescript - Add logic to translate menu items * Typescript - freeze window.ssf api * Typescript - Handle popup menu on alt key press * Typescript - Completed activity detection * Typescript - Completed screen snippet * Typescript - Add login to close screen snippet * Typescript - Completed window actions & snackbar, Updated i18n module * Typescript - Completed native crypto implementation & fixed bugs * Typescript - Completed Desktop capturer & screen picker implementation * Typescript - Optimize window actions * Typescript - Add support for child window * Typescript - fix pop url validation issue & browserify preload * Typescript - Completed context menu implementation and fixed screen snippet * Typescript - Completed screen sharing indicator and fixed i18n usage issue * Typescript - Fix i18n locale setting issue * Typescript - Completed download manager * Typescript - Completed Basic auth * Typescript - Network connectivity dialog * Typescript - Handle certificate error * Typescript - Add translation for certificate error dialog buttons * Typescript - Add gulp tasks to compile less, typescript and copy files * Typescript - Fix some issues with custom title bar, loading screen & screen snippet * Typescript - Remove ES2015 lib * :typescript: - Do not inject custom title bar for mac * :typescript: - Fix screen sharing indicator text and format string * Typescript - Fix esc to full screen * Typescript - handle multiple/single instance of the client and add safety checks * Typescript - Refactor code base * Typescript - Optimize window validation and fix screen picker issue * Typescript - Optimize protocol handler * typescript: logger unit test * typescript: activityDetection unit test (finos#560) * ELECTRON-1022 - Create app bridge that communicates between renderer and preload via postMessage * ELECTRON-1024 - Add support for screen share and screen sharing indicator * config unit test (finos#566) * ELECTRON-1024 - Fix screen sharing indicator close issue * ELECTRON-1022 - Bump Symphony version to 5.0.0 (1.55) * fixing jest coverage output report (finos#575) * protocol handle unit test (finos#576) * Typescript - Remove unwanted checks in protocol handler and add test cases * added more tests to increase coverage to 100 for protocol handler * Typescript download manager unit test (finos#579) * adding enzyme * download manager unit test * Typescript - Completed notification workflow * about app unit test * Typescript - Fix notification styles * fixing Compiler error: Generic type ReactElement<P, T> (finos#583) * fix app path on windows (finos#580) * basic auth unit test (finos#582) * screen picker unit test (finos#587) * screen picker unit test * screen sharing indicator unit test * loading screen unit test (finos#588) * improving snapshot using snapshotSerializers to remove unnecessary things (finos#596) * Typescript - Enforce braces for if/for/do/while statements. * Typescript - Fix Lint issues and Unit test * Typescript - Enable eofline (Ensure the file ends with a newline.) * Typescript - Update logger logic and format * Typescript - Provide option for user to set custom log path * Typescript - Fix eofline in css files * Typescript - ignore spec from compiling and remove unwanted rebuild command
* Typescript 🎉 * Typescript 🎉 (logger, get-guid, string-format and throttle) * Refactor typescript code * consolidate all the utility functions to one file * refactor protocol handler feature * Typescript: Add code documentation Add pre-commit hooks * Typescript: Fix logger formatting * Typescript: Add support for react * Typescript: Completed about app * Typescript: Completed about app * Typescript: Completed about app * Typescript - Fix issues with about-app and add login to convert less to css * Typescript - Fix loading screen * Typescript - Add custom title bar * Typescript - Add method to get locale * Typescript - Add logic to clean up old logs * Typescript - Add set badge count api * Typescript - Complete application menu * Typescript - Add logic to translate menu items * Typescript - freeze window.ssf api * Typescript - Handle popup menu on alt key press * Typescript - Completed activity detection * Typescript - Completed screen snippet * Typescript - Add login to close screen snippet * Typescript - Completed window actions & snackbar, Updated i18n module * Typescript - Completed native crypto implementation & fixed bugs * Typescript - Completed Desktop capturer & screen picker implementation * Typescript - Optimize window actions * Typescript - Add support for child window * Typescript - fix pop url validation issue & browserify preload * Typescript - Completed context menu implementation and fixed screen snippet * Typescript - Completed screen sharing indicator and fixed i18n usage issue * Typescript - Fix i18n locale setting issue * Typescript - Completed download manager * Typescript - Completed Basic auth * Typescript - Network connectivity dialog * Typescript - Handle certificate error * Typescript - Add translation for certificate error dialog buttons * Typescript - Add gulp tasks to compile less, typescript and copy files * Typescript - Fix some issues with custom title bar, loading screen & screen snippet * Typescript - Remove ES2015 lib * :typescript: - Do not inject custom title bar for mac * :typescript: - Fix screen sharing indicator text and format string * Typescript - Fix esc to full screen * Typescript - handle multiple/single instance of the client and add safety checks * Typescript - Refactor code base * Typescript - Optimize window validation and fix screen picker issue * Typescript - Optimize protocol handler * typescript: logger unit test * typescript: activityDetection unit test (#560) * ELECTRON-1022 - Create app bridge that communicates between renderer and preload via postMessage * ELECTRON-1024 - Add support for screen share and screen sharing indicator * config unit test (#566) * ELECTRON-1024 - Fix screen sharing indicator close issue * ELECTRON-1022 - Bump Symphony version to 5.0.0 (1.55) * fixing jest coverage output report (#575) * protocol handle unit test (#576) * Typescript - Remove unwanted checks in protocol handler and add test cases * added more tests to increase coverage to 100 for protocol handler * Typescript download manager unit test (#579) * adding enzyme * download manager unit test * Typescript - Completed notification workflow * about app unit test * Typescript - Fix notification styles * fixing Compiler error: Generic type ReactElement<P, T> (#583) * fix app path on windows (#580) * basic auth unit test (#582) * screen picker unit test (#587) * screen picker unit test * screen sharing indicator unit test * loading screen unit test (#588) * improving snapshot using snapshotSerializers to remove unnecessary things (#596) * Typescript - Enforce braces for if/for/do/while statements. * Typescript - Fix Lint issues and Unit test * Typescript - Enable eofline (Ensure the file ends with a newline.) * Typescript - Update logger logic and format * Typescript - Provide option for user to set custom log path * Typescript - Fix eofline in css files * Typescript - ignore spec from compiling and remove unwanted rebuild command
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Merge
Typescript context isolation
branch ontoTypescript master
branchUnit test result