Skip to content

SF-3708 Allow email sharing only on main host#3685

Merged
Nateowami merged 3 commits intomasterfrom
task/sf-3708-white-label-email
Feb 13, 2026
Merged

SF-3708 Allow email sharing only on main host#3685
Nateowami merged 3 commits intomasterfrom
task/sf-3708-white-label-email

Conversation

@RaymondLuong3
Copy link
Collaborator

@RaymondLuong3 RaymondLuong3 commented Feb 12, 2026

This PR hides the invite by email option if the administrator is using the white label site.

Before
Invite by email visible

After
Invite by email hidden


This change is Reviewable

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.84%. Comparing base (785f596) to head (9957cd5).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3685   +/-   ##
=======================================
  Coverage   81.84%   81.84%           
=======================================
  Files         618      619    +1     
  Lines       38603    38608    +5     
  Branches     6290     6314   +24     
=======================================
+ Hits        31594    31600    +6     
+ Misses       6048     6047    -1     
  Partials      961      961           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

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

@Nateowami reviewed 1 file and made 2 comments.
Reviewable status: 1 of 4 files reviewed, 2 unresolved discussions (waiting on @RaymondLuong3).


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.ts line 72 at r1 (raw file):

  readonly invalidEmailAddress: string = 'invalid-email-address';

  private readonly hostname: string = this.locationService.hostname;

I can't think of a good reason to cache this value on the component instead of just reading it directly from the service.


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.ts line 125 at r1 (raw file):

  get showEmailInvite(): boolean {
    return !this.hostname.includes('scribdocs');

This is not the way. We should have a utility function somewhere to check if on the whitelabeled site, and it should use similar logic as RazorPageSettings.cs.

For example:

const isMainSite = this.locationService.host === new URL(environment.masterUrl).host

You will not find the name of any white labeled version anywhere in the repo, and that is by design.

@RaymondLuong3 RaymondLuong3 force-pushed the task/sf-3708-white-label-email branch from 2e341e8 to fb5c980 Compare February 12, 2026 22:51
Copy link
Collaborator Author

@RaymondLuong3 RaymondLuong3 left a comment

Choose a reason for hiding this comment

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

@RaymondLuong3 made 2 comments.
Reviewable status: 0 of 5 files reviewed, 2 unresolved discussions (waiting on @Nateowami).


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.ts line 72 at r1 (raw file):

Previously, Nateowami wrote…

I can't think of a good reason to cache this value on the component instead of just reading it directly from the service.

Done.


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.ts line 125 at r1 (raw file):

Previously, Nateowami wrote…

This is not the way. We should have a utility function somewhere to check if on the whitelabeled site, and it should use similar logic as RazorPageSettings.cs.

For example:

const isMainSite = this.locationService.host === new URL(environment.masterUrl).host

You will not find the name of any white labeled version anywhere in the repo, and that is by design.

Good idea! I had not thought of using the environment, but that makes a lot of sense.

@RaymondLuong3 RaymondLuong3 added the e2e Run e2e tests for this pull request label Feb 12, 2026
Copy link
Collaborator

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

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

@Nateowami reviewed 5 files and all commit messages, made 3 comments, and resolved 2 discussions.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @RaymondLuong3).


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.ts line 125 at r1 (raw file):

Previously, RaymondLuong3 (Raymond Luong) wrote…

Good idea! I had not thought of using the environment, but that makes a lot of sense.

Look good; thanks. And I'm sorry if I was too blunt with my earlier response. One goal with the white-labeled site is to avoid publishing anything that can draw a connection from the public version to it. Also, we may have multiple white-labeled sites in the future, so any checks should be looking to see if it's the main site, not a particular white-labeled version.


src/SIL.XForge.Scripture/ClientApp/src/app/core/branding.service.ts line 10 at r2 (raw file):

  get useScriptureForgeBranding(): boolean {
    return this.locationService.host !== new URL(environment.masterUrl).host;

This logic is inverted


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.html line 8 at r2 (raw file):

  }
  <div class="invite-forms">
    @if (showEmailInvite) {

Could we move this below the share a link option? I've felt for a long time that the order here is wrong, and now that one of them is only conditionally shown, it seems to me to make more sense to have it come last. I realize this wasn't part of the original scope.

@RaymondLuong3 RaymondLuong3 removed the e2e Run e2e tests for this pull request label Feb 12, 2026
Copy link
Collaborator Author

@RaymondLuong3 RaymondLuong3 left a comment

Choose a reason for hiding this comment

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

@RaymondLuong3 made 3 comments.
Reviewable status: 3 of 5 files reviewed, 2 unresolved discussions (waiting on @Nateowami).


src/SIL.XForge.Scripture/ClientApp/src/app/core/branding.service.ts line 10 at r2 (raw file):

Previously, Nateowami wrote…

This logic is inverted

Done.


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.html line 8 at r2 (raw file):

Previously, Nateowami wrote…

Could we move this below the share a link option? I've felt for a long time that the order here is wrong, and now that one of them is only conditionally shown, it seems to me to make more sense to have it come last. I realize this wasn't part of the original scope.

Yes. This is how it looks.
image.png


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.ts line 125 at r1 (raw file):

Previously, Nateowami wrote…

Look good; thanks. And I'm sorry if I was too blunt with my earlier response. One goal with the white-labeled site is to avoid publishing anything that can draw a connection from the public version to it. Also, we may have multiple white-labeled sites in the future, so any checks should be looking to see if it's the main site, not a particular white-labeled version.

No worries. All good!

Copy link
Collaborator

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

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

:lgtm:

@Nateowami made 2 comments and resolved 2 discussions.
Reviewable status: 3 of 5 files reviewed, all discussions resolved (waiting on @RaymondLuong3).


src/SIL.XForge.Scripture/ClientApp/src/app/shared/share/share-control.component.html line 8 at r2 (raw file):

Previously, RaymondLuong3 (Raymond Luong) wrote…

Yes. This is how it looks.
image.png

Thanks

@Nateowami Nateowami merged commit 1cffd9b into master Feb 13, 2026
22 of 23 checks passed
@Nateowami Nateowami deleted the task/sf-3708-white-label-email branch February 13, 2026 02:15
@Nateowami
Copy link
Collaborator

By the way, @RaymondLuong3 the way to view the whitelabeled site locally is to go to http://127.0.0.1:5000/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants