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

Brand Twitter to X #15528

Merged
merged 9 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ nav:
- Authentication:
- Microsoft: docs/reference/modules/Microsoft.Authentication/README.md
- Facebook: docs/reference/modules/Facebook/README.md
- Twitter: docs/reference/modules/Twitter/README.md
- X (Twitter): docs/reference/modules/X/README.md
- GitHub: docs/reference/modules/GitHub/README.md
- Google: docs/reference/modules/Google/README.md
- Users:
Expand Down
2 changes: 1 addition & 1 deletion src/OrchardCore.Cms.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
// "CallbackPath": "/signin-google",
// "SaveTokens": false
//},
//"OrchardCore_Twitter": {
//"OrchardCore_X": {
// "ConsumerKey": "",
// "ConsumerSecret": "",
// "AccessToken": "",
Expand Down
10 changes: 5 additions & 5 deletions src/OrchardCore.Modules/OrchardCore.Twitter/AdminMenuSignin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Security"], security => security
.Add(S["Authentication"], authentication => authentication
.Add(S["Sign in with Twitter"], S["Sign in with Twitter"].PrefixPosition(), twitter => twitter
.AddClass("twitter")
.Id("twitter")
.Add(S["Sign in with X"], S["Sign in with X"].PrefixPosition(), x => x
.AddClass("x")
.Id("x")
.Action("Index", "Admin", _routeValues)
.Permission(Permissions.ManageTwitterSignin)
.LocalNav())
Expand Down Expand Up @@ -71,8 +71,8 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Configuration"], configuration => configuration
.Add(S["Settings"], settings => settings
.Add(S["Twitter"], S["Twitter"].PrefixPosition(), twitter => twitter
.AddClass("twitter").Id("twitter")
.Add(S["X"], S["X"].PrefixPosition(), twitter => twitter
.AddClass("x").Id("x")
.Action("Index", "Admin", _routeValues)
.Permission(Permissions.ManageTwitter)
.LocalNav()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public override async Task<IDisplayResult> EditAsync(TwitterSettings settings, B
return null;
}

return Initialize<TwitterSettingsViewModel>("TwitterSettings_Edit", model =>
return Initialize<TwitterSettingsViewModel>("XSettings_Edit", model =>
{
model.APIKey = settings.ConsumerKey;
if (!string.IsNullOrWhiteSpace(settings.ConsumerSecret))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ public static OrchardCoreBuilder ConfigureTwitterSettings(this OrchardCoreBuilde
{
builder.ConfigureServices((tenantServices, serviceProvider) =>
{
var configurationSection = serviceProvider.GetRequiredService<IShellConfiguration>().GetSection("OrchardCore_Twitter");
var configuration = serviceProvider.GetRequiredService<IShellConfiguration>();
var configurationSection = configuration.GetSection("OrchardCore_X");

if (configurationSection.Value is null)
{
configurationSection = configuration.GetSection("OrchardCore_Twitter");
}

tenantServices.PostConfigure<TwitterSettings>(settings => configurationSection.Bind(settings));
});
Expand Down
14 changes: 7 additions & 7 deletions src/OrchardCore.Modules/OrchardCore.Twitter/Manifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
Author = ManifestConstants.OrchardCoreTeam,
Website = ManifestConstants.OrchardCoreWebsite,
Version = ManifestConstants.OrchardCoreVersion,
Category = "Twitter"
Category = "X"
)]

[assembly: Feature(
Id = TwitterConstants.Features.Twitter,
Name = "Twitter Integration",
Category = "Twitter",
Description = "Provides a TwitterClient and Workflow Activities to integrate with twitter"
Name = "X Integration",
Category = "X",
Description = "Provides a TwitterClient and Workflow Activities to integrate with X"
)]

[assembly: Feature(
Id = TwitterConstants.Features.Signin,
Name = "Sign in with Twitter",
Category = "Twitter",
Description = "Authenticates users with their Twitter Account.",
Name = "Sign in with X",
Category = "X",
Description = "Authenticates users with their X Account.",
Dependencies = [TwitterConstants.Features.Twitter]
)]
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public override async Task<IDisplayResult> EditAsync(TwitterSigninSettings setti
return null;
}

return Initialize<TwitterSigninSettingsViewModel>("TwitterSigninSettings_Edit", model =>
return Initialize<TwitterSigninSettingsViewModel>("XSigninSettings_Edit", model =>
{
if (settings.CallbackPath.HasValue)
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
@model ActivityViewModel<UpdateTwitterStatusTask>

<header>
<h4><i class="fa-brands fa-twitter" aria-hidden="true"></i>@Model.Activity.GetTitleOrDefault(() => T["Update Twitter Status"])</h4>
<h4><i class="fa-brands fa-x-twitter" aria-hidden="true"></i>@Model.Activity.GetTitleOrDefault(() => T["Update X Status"])</h4>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
<label asp-for="StatusTemplate" class="form-label">@T["Template for updating twitter status"]</label>
<input type="text" asp-for="StatusTemplate" class="form-control code" />
<span asp-validation-for="StatusTemplate"></span>
<span class="hint">@T["The status text of the tweet."]</span>
<span class="hint">@T["The status text of the post."]</span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h4 class="card-title"><i class="fa-brands fa-x-twitter" aria-hidden="true"></i>@T["Update X Status"]</h4>
<p>@T["Create a post"]</p>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span class="icon"><i class="fa-brands fa-x-twitter" aria-hidden="true"></i></span><span class="title">@T["X"]</span>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<p class="alert alert-danger">@T["An error occurred while decrypting a setting. Please apply and save."]</p>
}

<h3>@T["Twitter Integration Settings"]</h3>
<h3>@T["X Integration Settings"]</h3>

<div class="mb-3 row" asp-validation-class-for="APIKey">
<div class="col-large col-12 col-sm-12 col-md-12 col-lg-12 col-xl-9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

<p class="alert alert-warning" role="alert">
@T["The website might be restarted upon saving the settings, potentially leading to temporary unresponsiveness during the process."]
<a class="seedoc" href="@(OrchardCore.Admin.Constants.DocsUrl)reference/modules/Twitter/#sign-in-with-twitter" target="_blank">@T["See documentation"]</a>
<a class="seedoc" href="@(OrchardCore.Admin.Constants.DocsUrl)reference/modules/Twitter/#sign-in-with-x" target="_blank">@T["See documentation"]</a>
</p>

<h3>@T["Sign in with Twitter Settings"]</h3>
<h3>@T["Sign in with X Settings"]</h3>

<div class="mb-3 row" asp-validation-class-for="CallbackPath">
<div class="col-large col-12 col-sm-12 col-md-12 col-lg-12 col-xl-9">
<label asp-for="CallbackPath" class="form-label">@T["CallbackPath"]</label>
<input asp-for="CallbackPath" class="form-control" placeholder="/signin-twitter" />
<input asp-for="CallbackPath" class="form-control" placeholder="/signin-x" />
<span asp-validation-for="CallbackPath"></span>
<span class="hint">@T["The request path within the application's base path where the user-agent will be returned. The middleware will process this request when it arrives."]</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IStringLocalizer<UpdateTwitterStatusTask> localizer
S = localizer;
}

public override LocalizedString DisplayText => S["Update Twitter Status Task"];
public override LocalizedString DisplayText => S["Update X Status Task"];

// The category to which this activity belongs. The activity picker groups activities by this category.
public override LocalizedString Category => S["Social"];
Expand Down
2 changes: 1 addition & 1 deletion src/docs/reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Here's a categorized overview of all built-in Orchard Core features at a glance.
- Authentication:
- [Microsoft](modules/Microsoft.Authentication/README.md)
- [Facebook](modules/Facebook/README.md)
- [Twitter](modules/Twitter/README.md)
- [X (Twitter)](modules/X/README.md)
- [GitHub](modules/GitHub/README.md)
- [Google](modules/Google/README.md)
- Users:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Twitter (`OrchardCore.Twitter`)
# X (Twitter) (`OrchardCore.Twitter`)

This module adds Twitter for Websites features to OrchardCore.

## Twitter Integration
## X (Twitter) Integration

Integrate with Twitter. Provides a client to integrate with Twitter API
Configuration can be set through the _Twitter -> Twitter Integration_ menu in the admin dashboard.
Integrate with X. Provides a client to integrate with X API
Configuration can be set through the _X -> X Integration_ menu in the admin dashboard.

Available settings are:

Expand All @@ -16,37 +16,37 @@ Available settings are:

### Workflows

If the OrchardCore.Workflows is enabled, a new Task is added to Update Twitter Status
If the OrchardCore.Workflows is enabled, a new Task is added to Update X Status

## Sign in with Twitter
## Sign in with X (Twitter)

Authenticates users with their Twitter Account.
Authenticates users with their X Account.

Create an app in the [Twitter Developer Platform](https://developer.twitter.com) and enable Sign in with Twitter.
In the app details, you must configure the Callback URL. The default url in OrchardCore is [tenant]/signin-twitter.
Create an app in the [Twitter Developer Platform](https://developer.x.com) and enable Sign in with X.
In the app details, you must configure the Callback URL. The default url in OrchardCore is [tenant]/signin-x.

Configuration can be set through the _Twitter -> Sign in with Twitter_ settings menu in the admin dashboard.
Configuration can be set through the _X -> Sign in with X_ settings menu in the admin dashboard.

Available settings are:

- ConsumerKey: API key found in the keys and tokens tab of your twitter app.
- ConsumerSecret: The API secret key of your twitter app.
- CallbackPath: The request path within the application's base path where the user-agent will be returned. The middleware will process this request when it arrives.
If no value is provided, setup Callback URL in Twitter app to use the default path /signin-twitter.
If no value is provided, setup Callback URL in Twitter app to use the default path /signin-x.

### Users Registration

- If you want to enable new users to register to the site through their Twitter account, the `OrchardCore.Users.Registration` feature must be enabled and setup accordingly.
- An existing user can link his account to his Twitter account through the External Logins link from User menu.

## Twitter Settings Configuration
## X (Twitter) Settings Configuration

The `OrchardCore.Twitter` module allows the user to use configuration values to override the settings configured from the admin area by calling the `ConfigureTwitterSettings()` extension method on `OrchardCoreBuilder` when initializing the app.

The following configuration values can be customized:

```json
"OrchardCore_Twitter": {
"OrchardCore_X": {
"ConsumerKey": "",
"ConsumerSecret": "",
"AccessToken": "",
Expand Down
6 changes: 6 additions & 0 deletions src/docs/releases/1.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ services.AddJsonDerivedTypeInfo<SqlQuery, Query>();
}
```

### Twitter Module

The `Twitter` module has been rebranded to `X`.

If you were using the `OrchardCore_Twitter` configuration key to configure the module, please update the configuration key to `OrchardCore_X`. The `OrchardCore_Twitter` key continues to work but will be deprecated in a future release.

### Users Module

The `Login.cshtml` has undergone a significant revamp. The previous `AfterLogin` zone, which allowed filters for injecting shapes, has been replaced. Now, you can inject shapes using drivers by implementing `IDisplayDriver<LoginForm>`. For example, the 'Forgot Password?' link is injected using the following driver:
Expand Down