Commit Graph

1282 Commits

Author SHA1 Message Date
Devin Binnie
f3a4417464 [MM-52139] Force user to reset default downloads directory when the app is not allowed to access it (#2699)
* [MM-52139] Force user to reset default downloads directory when the app is not allowed to access it

* Fix a bug where a different download location choice would cause a problem

* Missed i18n
2023-05-02 14:37:14 -04:00
Claudio Costa
09fe196bc6 Prevent calls widget window from showing native shadow (#2693) 2023-05-02 14:45:24 +02:00
Devin Binnie
509c1a7be0 [MM-52380] Fix unhandled rejection when clearing app cache (#2696)
* [MM-52380] Fix unhandled rejection when clearing app cache

* Make sure the window is loaded first

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-05-01 12:09:52 -04:00
Devin Binnie
0f94b7d510 Fixed Snap issue with resizing on Windows 11 (#2686)
* Fixed Snap issue with resizing on Windows 11

* Run on focus/blur as well

* Whoops, left my logging changes

* Fix tests
2023-04-21 18:09:20 -04:00
Devin Binnie
73edb2fe48 Fixed bad mention counts in the dropdown menu (#2687) 2023-04-21 16:57:44 -04:00
Devin Binnie
f4f4511cc7 Remove WindowManager, separate functionality into smaller modules (#2682)
* Move sendToRenderer to respective singletons

* Move to using ViewManager call for getting view by webContentsId

* Move show and create logic to main window, handle deep linking seperately

* Move resizing logic and event handing to mainWindow

* Move server switching logic to main/app

* Move tab switching logic to main/app, rely on showById for most usage

* Migrate remaining functions, remove windowManager objects, set up imports for self-contained singletons

* Fix E2E tests

* Update src/main/app/servers.ts

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

---------

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2023-04-19 11:04:26 -04:00
Devin Binnie
a141d3cde4 Migrate downloads dropdown menus to singletons (#2680) 2023-04-18 09:14:18 -04:00
Devin Binnie
b71322a682 Migrate teamDropdownView to singleton (#2677) 2023-04-14 12:14:11 -04:00
Devin Binnie
1428ba694b Clean up appState module, move to common, simplify events (#2676)
* Refactor appState into class, simplify events

* Move appState to common module, make case for object consistent

* Naming change

* Update name
2023-04-14 12:09:33 -04:00
Devin Binnie
686b4ac9f1 [MM-50485] Migrate app to ServerManager, remove view names and replace with IDs (#2672)
* Migrate app to ServerManager, remove view names and replace with IDs

* Fixed a test

* Fixed a bug when adding the initial server

* Merge'd

* Bug fixes and PR feedback
2023-04-12 12:52:34 -04:00
Devin Binnie
661099dd28 [MM-51961] Migrate calls widget to singleton (#2667)
* Migrate callsWidgetWindow to singleton

* REVERT ME: removed references to ServerManager
2023-04-12 07:50:34 -04:00
Devin Binnie
741087cb55 Refactor config, move ipc calls to app module, some cleanup (#2669) 2023-04-06 11:24:57 -04:00
Devin Binnie
88eb2e2c70 [MM-51964] Clean up MattermostView, remove tuple in preparation for id (#2668)
undefined
2023-04-06 11:17:33 -04:00
Devin Binnie
53fb8c8fd3 [MM-50485] Implement ServerManager, introduce id concept for identifying servers/views (#2654)
* Implement ServerManager, introduce id concept for identifying servers/views

* REVERT ME (eventually): Move back to old logging

* PR feedback

* PR feedback

* Revert "REVERT ME (eventually): Move back to old logging"

This reverts commit 46954a5bbed4dd29e89ca9d5217bb75af2837bb3.

* Merge'd

* Use the correct method for Logger in ServerManager
2023-04-05 16:30:50 -04:00
Devin Binnie
862287edff Migrate viewManager to singleton (#2656) 2023-04-05 13:01:09 -04:00
Devin Binnie
245215c678 [MM-51873] Create central logging module for adding prefixes to differentiate logs between modules (#2652)
* Create central logging module for adding prefixes to differentiate logs between modules

* Turn logger into class

* Merge'd

* Rework to use class more intelligently

* Fix modalView

* Fix webContentEvents

* Update src/main/app/intercom.ts

Co-authored-by: Daniel Espino García <larkox@gmail.com>

* Shorten prefixes on object creation

---------

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2023-04-05 12:09:56 -04:00
Devin Binnie
39150137b6 [MM-51874] Migrate loading screen to singleton (#2655)
* Migrate loadingScreen to singleton

* REVERT ME when MainWindow singleton changes are merged

* Revert "REVERT ME when MainWindow singleton changes are merged"

This reverts commit 2de5520117b9aefb8eeb161d493de7cb275f7a5b.
2023-04-04 11:49:40 -04:00
Devin Binnie
22ec280945 [MM-51871] Migrate mainWindow and settingsWindow to singletons (#2650)
* Migrate mainWindow to singleton

* Migrate settingsWindow to singleton

* PR feedback

* Missed a couple unwrapping cases
2023-04-04 10:01:40 -04:00
Devin Binnie
112a591796 Move Validator to common module (#2651) 2023-04-04 08:05:40 -04:00
Christopher Poile
4fe66b298d MM-51850 - Calls: Fix for crash after closing popout (#2647) 2023-03-31 11:46:27 -04:00
Christopher Poile
d18e3e2251 MM-51535 - Calls: Fix unrestricted redirect from calls widget (#2635)
* add will-redirect handler to prevent unrestricted redirect

* import ordering

* simplify onWillRedirect handler; tests

* Adding punctuation to force tests to run again.
2023-03-28 09:53:30 -04:00
Claudio Costa
cc706f7a97 Escape regexp input in isCallsPopOutURL (#2629) 2023-03-23 10:56:47 -06:00
Claudio Costa
9570e030e7 Allow starting a call from existing thread (#2630) 2023-03-21 14:01:41 -04:00
Devin Binnie
c85a4497b6 Fix the issue where we sometimes need to wait for GPO teams properly (#2621) 2023-03-20 16:24:07 -04:00
Devin Binnie
cf8aa6499c [MM-51406] Update node-abi, fix some server modal bugs (#2617)
* Update node-abi so tests can run

* [MM-51392] Fix modal ping bugs
2023-03-15 09:12:53 -04:00
Jon Seager
69831bbe13 fix: use XDG_DOWNLOAD_DIR as default download dir (#2615)
On Linux machines that are using a desktop env which conforms to
the FreeDesktop spec, users should have the XDG_DOWNLOAD_DIR
variable set to specify their default download directory.

This patch ensures that this directory is used if the variable is
present.

Hoping this will fix the following issue in the Mattermost snap:
https://github.com/snapcrafters/mattermost-desktop/issues/65
2023-03-15 09:12:16 -04:00
Devin Binnie
37e7fb1100 [MM-51406] Check for other server URLs when trying to navigate (#2616) 2023-03-15 09:08:33 -04:00
Claudio Costa
49ed221659 Fix race condition on switching calls (#2591) 2023-03-07 18:23:21 -06:00
Devin Binnie
12ec2748b4 Refactor webContentsEvents and popup listeners (#2587) 2023-03-07 08:50:39 -05:00
Devin Binnie
99a84a0fd7 [GH-2534] Refocus the popup window if already exists (#2581)
* [GH-2534] Refocus the popup window if already exists

* PR feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-03-06 11:49:15 -05:00
Devin Binnie
417e53cb13 [MM-50948] Prevent popup windows from navigating outside of the plugin/managed resource URLs (#2580) 2023-03-06 09:11:39 -05:00
Antonis Stamatiou
b62b25fdda feat(ci): CircleCI migration to Github Actions (#2516)
* Deprecated trigger-desktop-nightly repo from gitlab
* Migrated Nightly builds URLs from CircleCI to S3
* Full CI/CD is handled by Github Actions

---------

Co-authored-by: Tasos Boulis <tboulis@hotmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-03-06 11:51:25 +02:00
Devin Binnie
5342507954 Restore URL checking code 2023-03-02 17:03:55 -05:00
Claudio Costa
a52e96694d [MM-50973] Harden Calls windows URL navigation checks (#2573)
* Harden Calls windows URL navigation checks

* Update src/main/windows/callsWidgetWindow.ts

Co-authored-by: Eva Sarafianou <eva.sarafianou@gmail.com>

* Fix bad merge

* Extract team name to use isUrlType

* Simplify

---------

Co-authored-by: Eva Sarafianou <eva.sarafianou@gmail.com>
2023-03-02 13:10:47 -05:00
Devin Binnie
ec4a733507 [MM-50527] Explicitly allow the Mattermost views access to write to the clipboard using Copy Link (#2565)
* [MM-50527] Explicitly allow the Mattermost views access to write to the clipboard using Copy Link

* Include calls widget window

* Add calls popout to the list as well

* Update src/main/app/initialize.ts

Co-authored-by: Christopher Poile <cpoile@gmail.com>

---------

Co-authored-by: Christopher Poile <cpoile@gmail.com>
2023-03-01 22:48:55 -05:00
Claudio Costa
cd051fe679 [MM-50995] Harden Calls events handling (#2571)
* Simplify server switching logic in calls events

* Harden calls events handling

* Fix subpath
2023-03-01 16:01:39 -06:00
Alexander Griesser
7d109b9084 Fix typo in error message (#2572)
stumbled upon that while debugging a problem with a community user
2023-03-01 10:20:09 -05:00
Devin Binnie
e6a93dcc69 [MM-50569] Fix insecure win32 path regex (#2566) 2023-02-28 10:14:57 -05:00
Devin Binnie
2009d0290b [MM-50712] Fix local prototype pollution flaw (#2567)
* [MM-50712] Fix local prototype pollution flaw

* Update src/main/diagnostics/steps/internal/loggerHooks.test.js

Co-authored-by: Daniel Espino García <larkox@gmail.com>

---------

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2023-02-28 09:48:48 -05:00
Claudio Costa
d1f6fc5a5f [MM-46980] Improve screensharing permissions flow (#2556)
* Little improvements and simplification

* Improve MacOS screen permissions handling flow

* Add missing error event

* Propagate calls client errors (#2557)
2023-02-17 15:07:29 -05:00
Christopher Poile
ec8e0b9cc2 MM-49079 - Calls: process link clicks from Calls popout (#2558)
* process link clicks from Calls popout

* add a mock for windows tests
2023-02-17 13:41:01 -05:00
Claudio Costa
7127ec153a Send error to global widget if missing screen sharing permissions (#2554) 2023-02-16 10:20:50 -06:00
Devin Binnie
5cc2e98a1d Merge and migrate locally-trusted preload scripts to contextBridge API (#2553)
* Migrate intl_provider to contextBridge

* Migrate modalPreload to contextBridge

* Migrate loadingScreenPreload to contextBridge

* Migrate downloadDropdown preloads to contextBridge

* Migrate server dropdown preload to contextBridge

* Migrate urlView preload to contextBridge

* Merge all desktop API scripts into one

* Remove unused communication channel constants
2023-02-15 13:42:53 -05:00
Claudio Costa
562ef14aef Fix media permissions failure on Calls window (#2550) 2023-02-10 11:13:31 -06:00
Devin Binnie
8dbdb0a75e [MM-50409] Stop the main window from creating its own uncontrolled child windows (#2549) 2023-02-09 09:04:02 -05:00
Devin Binnie
6dca4a5095 [MM-50410] Allow any unhandled target=_blank links to open in the browser (#2548) 2023-02-09 09:03:32 -05:00
Claudio Costa
06eb76dc21 [MM-48658] Improve global widget resizing logic (#2545)
* Improved global widget resizing

* Remove min width/height

* Fix test
2023-02-07 11:00:42 -05:00
Devin Binnie
07e41ec678 Remove use of getView() and replace with getViewByURL() where necessary. (#2544)
* WIP

* Replace getView with getViewByURL
2023-02-07 08:59:35 -05:00
Claudio Costa
9213083335 [MM-49739] Set parent window on calls expanded popout view (#2539)
* Set parent window on calls expanded popout view

* Fix focus on calls popout window

* Unregister event
2023-02-06 10:31:50 -05:00
Tasos Boulis
9b45935bee Use location as is when displaying thumbnails inside downloads dropdown in MAS builds (#2536) 2023-02-02 19:37:04 +02:00