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

DYN-6375-Disable-Login #14580

Closed
wants to merge 8 commits into from
Closed

DYN-6375-Disable-Login #14580

wants to merge 8 commits into from

Conversation

jesusalvino
Copy link
Contributor

Purpose

Adding an option to the Splash Screen API to enable / disable the Sign in button

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Reviewers

@QilongTang
@reddyashish

FYIs

@RobertGlobant20
@Enzo707

@reddyashish reddyashish added this to the 3.0 milestone Nov 7, 2023
@zeusongit
Copy link
Contributor

Can you attach a screenshot/gif of the change?

@jesusalvino
Copy link
Contributor Author

jesusalvino commented Nov 7, 2023

Can you attach a screenshot/gif of the change?

Sign In enabled / disabled

image

/// Enable or not the SignIn button on the fly.
/// </summary>
/// <param name="enabled"></param>
internal async void SetSignInEnable(bool enabled)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to expose this as an API and provide an example of how to use it as part of this PR

Copy link
Contributor Author

@jesusalvino jesusalvino Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to expose this as an API and provide an example of how to use it as part of this PR

Sure, currently is just a method of the SplashScreen class, Do you want to extend it as part of the DynamoViewModel, like the RequestClose FYI @reddyashish ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please think about it in the integration context: https://github.com/DynamoDS/DynamoRevit/blob/master/src/DynamoRevit/DynamoRevit.cs#L334 how to disable it when trying to show it from integrations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to expose this as an API and provide an example of how to use it as part of this PR

@QilongTang @mjkkirschner @reddyashish , changing it to public is enough to expose it so can be called from other parts. Unfortunatelly after varioous tests on D4R deptly I have realized its method OnRequestDynamicSplashScreen is called before the splash creen is ready and it's being used by Revit on that way which IMHO is a bug because the splash screen is ready only when its web resources are completed loaded and ready to have access to the WV2's DOM. That's why an example over the current implementation of the flow between Dynamo and D4R doesn't work. Please let me know What Do you consider to complete this PR, thanks.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we sticking to a method, not some startup config for SplashScreen constructor? A method call is meant to fail after UI initialized?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we sticking to a method, not some startup config for SplashScreen constructor? A method call is meant to fail after UI initialized?

A method approach means the consumers can call it on demand / Yes because the consumers don't know when the UI is initialized properly (image above).

I have moved the responsibility to enable or not the SignIn button to the ctor so the consumers will be able to decide only at that time.

Now the Splashcreen is the responsible to enable or not the SignIn button only when the web resources are completely loaded.

The ctor will enable the SignIn button by default, otherwise it needs to set explicitly here https://github.com/DynamoDS/DynamoRevit/blob/master/src/DynamoRevit/DynamoRevit.cs#L334 according to the consumer's criteria.

image

Enabled
login1

Disabled
login2

@mjkkirschner
Copy link
Member

mjkkirschner commented Nov 15, 2023

IMO this should not be an API - Dynamo should determine this, putting all these considerations on integrators just makes their jobs harder for what benefit? Dynamo knows if the user is logged in or not - is that correct?

Perhaps I'm misunderstanding when the signIn button should be enabled and when it shouldn't be.

In general my feeling is that the splash screen is a burden for clients to integrate and we should be doing what we can to make it simpler, not more complex.

@jesusalvino
Copy link
Contributor Author

IMO this should not be an API - Dynamo should determine this, putting all these considerations on integrators just makes their jobs harder for what benefit? Dynamo knows if the user is logged in or not - is that correct?

Perhaps I'm misunderstanding when the signIn button should be enabled and when it shouldn't be.

In general my feeling is that the splash screen is a burden for clients to integrate and we should be doing what we can to make it simpler, not more complex.

@mjkkirschner about the benefit and your misunderstanding, kindly I guess is part of the Dynamo's strategy to have this feature, That's up to you guys @QilongTang

Yup, Dynamo knows if the user is logged in or not, that's already handled as part of the second AC of this task.

IMHO exposing this feature as part of its API doesn't mean mandatory for the consumer, just let me know your decision guys.

@QilongTang
Copy link
Contributor

Closing in favor of #14653

@QilongTang QilongTang closed this Dec 8, 2023
Copy link

github-actions bot commented Dec 8, 2023

UI Smoke Tests

Test: success. 2 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests - net8.0

Copy link

github-actions bot commented Dec 8, 2023

UI Smoke Tests

Test: success. 2 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests - net6.0

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.

5 participants