Skip to content
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

feat: add opt in handling for teams v2 #1160

Merged
merged 10 commits into from Mar 31, 2024

Conversation

mhenselin
Copy link
Contributor

No description provided.

Marcel S. Henselin and others added 2 commits March 28, 2024 10:48
…1157)

* add support for changing idle (away) state in Teams2

* package.json: bump version to 1.4.16
@IsmaelMartinez
Copy link
Owner

nice one! Can you rebase from "develop" (I really should change the name to main) and increase the package.json version to end in 17? Thanks a lot!

@bastidest
Copy link
Contributor

This looks like it unconditionally reloads the window independent of whether the user already has Teams 2.0. Can we check if the user already has Teams 2.0? Or at least check if the local storage item is already set.

@mhenselin
Copy link
Contributor Author

This looks like it unconditionally reloads the window independent of whether the user already has Teams 2.0. Can we check if the user already has Teams 2.0? Or at least check if the local storage item is already set.

Will do :-)

@mhenselin
Copy link
Contributor Author

mhenselin commented Mar 28, 2024

Do I need a version bump here? Version updated to .17.

@IsmaelMartinez
Copy link
Owner

17 is fine. 16 is in pre-release state and will probably be like this for a couple of days, just to make sure we don't break the app for over 150k users.

I might make it faster if I see a few people confirming it works fine, but only got released today.

@joakim-tjernlund
Copy link

How do I enable this v2 feature?
Can I write some config snippet in /etc/chromium ?

@helgso
Copy link

helgso commented Mar 28, 2024

How do I enable this v2 feature? Can I write some config snippet in /etc/chromium ?

See here: #1156 (comment)

@joakim-tjernlund
Copy link

How do I enable this v2 feature? Can I write some config snippet in /etc/chromium ?

See here: #1156 (comment)

Looking but that is manual editing of config in teams, can you paste a drop-in file I can use in /etc/chromium ?

@neclimdul
Copy link

I'm going to go out on a limb and say no because this hasn't been merged and this is code that allows you to switch to v2.

@joakim-tjernlund
Copy link

I'm going to go out on a limb and say no because this hasn't been merged and this is code that allows you to switch to v2.

I know, I just want to be prepared. I maintain Linux/Teams at work but I can wait. I guess that Teams for Linux will
switch to v2 automatically if the user already have v2 enabled?

@IsmaelMartinez
Copy link
Owner

I think it will happen automatically when the date arrives. They will basically do the opposite of now and default to V2. That might or might not come with the move to react. I have been using teams v2 since Xmas and I am still in angularland. Apologies for making this wait but the user base is a bit big so being a bit cautious (mainly with the other change)

@jijojosephk
Copy link
Collaborator

I'm not in a position to review the changes but adding new changes with existing angular hacks might break certain things. It will be better if the new changes are part of a separate folder/module like react and conditionally load based on v1 or v2. I don't suggest executeJavaScript, preload script would be ideal.

@IsmaelMartinez
Copy link
Owner

I'm not in a position to review the changes but adding new changes with existing angular hacks might break certain things. It will be better if the new changes are part of a separate folder/module like react and conditionally load based on v1 or v2. I don't suggest executeJavaScript, preload script would be ideal.

Thanks @jijojosephk for the comments. The moving those helper functions into a "react" module sounds reasonable (maybe call it reactHandler). I will not consider that blocking this change as I can do this in another PR and that part of the code (browser) can benefit with a bit of refactoring (specially the activityHub.js file).

I had a look at the preload script option, as it does seems like a good idea, but I am not sure if it will work as it runs before the URL loads, meaning I don't think we will have the locaStorage values MS puts it might not have the localStorage set yet, as they load before the URL loads. As this is a temporary change only necessary for a couple of months, I don't mind it been a bit less optimal and triggering a refresh (as long as it doesn't trigger it all the time!!)

@IsmaelMartinez
Copy link
Owner

I believe some of those changes are from the 1.4.16 (the react helpers etc) so I will see if I can push them in here.

app/config/index.js Outdated Show resolved Hide resolved
@IsmaelMartinez
Copy link
Owner

tried to push some changes but failed as I don't have permission in your branch, but is ok, I will put them in another PR once I have the time.

I have put the ones that are for your changes as code suggestions. Thanks again!

mhenselin and others added 2 commits March 30, 2024 09:11
wording change - accepted

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>
fix: fix some codeBeat failures
@mhenselin
Copy link
Contributor Author

updated to use the recommended option 'optInTeamsV2' and refactored into separate function to avoid codeBeat failures

app/config/index.js Outdated Show resolved Hide resolved
app/mainAppWindow/index.js Outdated Show resolved Hide resolved
app/mainAppWindow/index.js Outdated Show resolved Hide resolved
app/mainAppWindow/index.js Outdated Show resolved Hide resolved
app/config/index.js Outdated Show resolved Hide resolved
app/mainAppWindow/index.js Outdated Show resolved Hide resolved
@IsmaelMartinez IsmaelMartinez merged commit 134d579 into IsmaelMartinez:develop Mar 31, 2024
3 checks passed
@IsmaelMartinez
Copy link
Owner

https://github.com/IsmaelMartinez/teams-for-linux/releases/tag/v1.4.17 pre-release created. I will leave it for a few days and see how it does but, as it is under a "feature flag/config option" it is safer.

Thanks @mhenselin again for contributing!

@mhenselin mhenselin deleted the feat_add_v2_opt_in branch April 3, 2024 21:45
@jhoermann
Copy link

How do I enable this v2 feature? Can I write some config snippet in /etc/chromium ?

See #1156 (comment) for how its done with Ubuntu & Snap.

kristianmagas added a commit to kristianmagas/teams-for-linux that referenced this pull request Apr 4, 2024
* removing the angular recurring call to disable some promotions as I suspect is creating a wee leak (IsmaelMartinez#1152)

* Hotfix/remove recurring angular call (IsmaelMartinez#1153)

* removing the angular recurring call to disable some promotions as I suspect is creating a wee leak

* missing removal of angular in the index.js browser section

* Hotfix/remove recurring angular call (IsmaelMartinez#1154)

* removing the angular recurring call to disable some promotions as I suspect is creating a wee leak

* missing removal of angular in the index.js browser section

* only retry 5 times to get the angular instances

* add support for changing idle (away) state in Teams2 (IsmaelMartinez#1157)

* add support for changing idle (away) state in Teams2

* package.json: bump version to 1.4.16

* feat: add opt in handling for teams v2 (IsmaelMartinez#1160)

* feat: add opt in handling for teams v2

* add support for changing idle (away) state in Teams2 (IsmaelMartinez#1157)

* add support for changing idle (away) state in Teams2

* package.json: bump version to 1.4.16

* feat: add opt in handling for teams v2

* fix: handle both cases and avoid unnecessary reloads

* chore: version bump

* Update app/config/index.js

wording change - accepted

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

* chore: updated README

fix: fix some codeBeat failures

* fix: missing passed option object

* Update app/config/index.js

---------

Co-authored-by: Marcel S. Henselin <marcel.henselin@mmmake.com>
Co-authored-by: Sebastian Hiebl <bastidest@mailbox.org>
Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>

---------

Co-authored-by: IsmaelMartinez <ISMAELMARTINEZ@GMAIL.COM>
Co-authored-by: Sebastian Hiebl <bastidest@mailbox.org>
Co-authored-by: Marcel S. Henselin <marcel@henselin.net>
Co-authored-by: Marcel S. Henselin <marcel.henselin@mmmake.com>
Co-authored-by: Kristian Magaš <km@appon.net>
@Zahrun
Copy link
Contributor

Zahrun commented Apr 4, 2024

This PR adds the "optInTeamsV2" configuration option.
So you can use it at commandline with teams-for-linux --optInTeamsV2 true
or add

{
    "optInTeamsV2": true
}

in ~/.config/teams-for-linux/config.json. For Snap installations, the file is located in ~/snap/teams-for-linux/current/.config/teams-for-linux/config.json and for Flatpak it is located in ~/.var/app/com.github.IsmaelMartinez.teams_for_linux/config/teams-for-linux/config.json.

See https://github.com/IsmaelMartinez/teams-for-linux/blob/develop/app/config/README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants