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

Rename Twitter/X workflow task to match updated view names #15930

Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
66864b5
Rename workflow task to match updated view names to resolve missing s…
davidpuplava Apr 30, 2024
62af19b
Add data migration to update existing workflows to use updated Twiite…
davidpuplava May 2, 2024
ae4d618
Refactor content item migrations to match how it's done in Lucene Sea…
davidpuplava May 3, 2024
b3dd976
Refactor unnecessary method call inline to calling method to remove w…
davidpuplava May 8, 2024
c55b807
Merge branch 'main' into davidpuplava/update-x-status-task-shape-not-…
MikeAlhayek May 16, 2024
5ba3d09
Merge branch 'main' into davidpuplava/update-x-status-task-shape-not-…
Piedone Jun 20, 2024
41e5642
Merge tag 'before-formatting
davidpuplava Aug 15, 2024
b95fec7
Format code
davidpuplava Aug 16, 2024
7941494
Merge tag 'formatting'
davidpuplava Aug 16, 2024
17160a6
Refactor Twitter to X migration to simplify database logic; edited na…
davidpuplava Aug 16, 2024
7133943
Merge remote-tracking branch 'upstream/main' into davidpuplava/update…
davidpuplava Aug 16, 2024
2916586
Simplify using expressions for database operations
davidpuplava Aug 16, 2024
43419a9
Merge remote-tracking branch 'upstream/main' into davidpuplava/update…
davidpuplava Aug 17, 2024
ba89043
Rename types/classes/ids back to before X/Twitter rebrand; removed mi…
davidpuplava Aug 17, 2024
e1679a4
Update X/Twitter documentation links in Admin UI
davidpuplava Aug 19, 2024
9a1d3d4
Merge remote-tracking branch 'upstream/main' into davidpuplava/update…
davidpuplava Aug 19, 2024
14e60dc
Remove reference to YesSql project previously added when Migration ex…
davidpuplava Aug 20, 2024
c9cecb0
Remove unused using statement
davidpuplava Aug 20, 2024
84542b9
Fix typo in documentation link to X/Twitter integration docs
davidpuplava Aug 20, 2024
31100c5
Merge remote-tracking branch 'upstream/main' into davidpuplava/update…
davidpuplava Aug 20, 2024
a4504f3
Remove another unused using statement
davidpuplava Aug 20, 2024
8d16b9d
Merge branch 'main' into davidpuplava/update-x-status-task-shape-not-…
hishamco Aug 20, 2024
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
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 @@ -29,9 +29,9 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Security"], security => security
.Add(S["Authentication"], authentication => authentication
.Add(S["Sign in with X"], S["Sign in with X"].PrefixPosition(), x => x
.AddClass("x")
.Id("x")
.Add(S["Sign in with X (Twitter)"], S["Sign in with X (Twitter)"].PrefixPosition(), twitter => twitter
.AddClass("twitter")
.Id("twitter")
.Action("Index", "Admin", _routeValues)
.Permission(Permissions.ManageTwitterSignin)
.LocalNav())
Expand Down Expand Up @@ -67,8 +67,8 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Configuration"], configuration => configuration
.Add(S["Settings"], settings => settings
.Add(S["X"], S["X"].PrefixPosition(), twitter => twitter
.AddClass("x").Id("x")
.Add(S["X (Twitter)"], S["X (Twitter)"].PrefixPosition(), twitter => twitter
.AddClass("twitter").Id("twitter")
.Action("Index", "Admin", _routeValues)
.Permission(Permissions.ManageTwitter)
.LocalNav()
Expand Down
10 changes: 5 additions & 5 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 = "X"
Category = "X (Twitter)"
)]

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

[assembly: Feature(
Id = TwitterConstants.Features.Signin,
Name = "Sign in with X (Twitter)",
Category = "X",
Description = "Authenticates users with their X Account.",
Category = "X (Twitter)",
Description = "Authenticates users with their X (Twitter) Account.",
Dependencies = [TwitterConstants.Features.Twitter]
)]
4 changes: 2 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Twitter/Permissions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace OrchardCore.Twitter;

public sealed class Permissions : IPermissionProvider
{
public static readonly Permission ManageTwitter = new("ManageTwitter", "Manage Twitter settings");
public static readonly Permission ManageTwitter = new("ManageTwitter", "Manage X (Twitter) settings");

public static readonly Permission ManageTwitterSignin = new("ManageTwitterSignin", "Manage Sign in with Twitter settings");
public static readonly Permission ManageTwitterSignin = new("ManageTwitterSignin", "Manage Sign in with X (Twitter) settings");

private readonly IEnumerable<Permission> _allPermissions =
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private async Task<TwitterSettings> GetTwitterSettingsAsync()
{
if (_shellSettings.IsRunning())
{
_logger.LogWarning("Twitter is not correctly configured.");
_logger.LogWarning("X (Twitter) is not correctly configured.");
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public void Configure(AuthenticationOptions options)
if (string.IsNullOrWhiteSpace(settings.Item1.ConsumerKey) ||
string.IsNullOrWhiteSpace(settings.Item1.ConsumerSecret))
{
_logger.LogWarning("The Twitter login provider is enabled but not configured.");
_logger.LogWarning("The X (Twitter) login provider is enabled but not configured.");

return;
}

options.AddScheme(TwitterDefaults.AuthenticationScheme, builder =>
{
builder.DisplayName = "Twitter";
builder.DisplayName = "X (Twitter)";
builder.HandlerType = typeof(TwitterHandler);
});
}
Expand All @@ -91,7 +91,7 @@ public void Configure(string name, TwitterOptions options)
}
catch
{
_logger.LogError("The Twitter Consumer Secret could not be decrypted. It may have been encrypted using a different key.");
_logger.LogError("The X (Twitter) Consumer Secret could not be decrypted. It may have been encrypted using a different key.");
}

if (settings.Item2.CallbackPath.HasValue)
Expand All @@ -114,7 +114,7 @@ private async Task<Tuple<TwitterSettings, TwitterSigninSettings>> GetSettingsAsy
{
if (_shellSettings.IsRunning())
{
_logger.LogWarning("Integration with Twitter is not correctly configured.");
_logger.LogWarning("Integration with X (Twitter) is not correctly configured.");
}

return null;
Expand Down
1 change: 1 addition & 0 deletions src/OrchardCore.Modules/OrchardCore.Twitter/Startup.cs
Piedone marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Http.Resilience;
using Microsoft.Extensions.Options;
using OrchardCore.Data.Migration;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.Modules;
using OrchardCore.Navigation;
Expand Down
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-x-twitter" aria-hidden="true"></i>@Model.Activity.GetTitleOrDefault(() => T["Update X Status"])</h4>
<h4><i class="fa-brands fa-x-twitter" aria-hidden="true"></i>@Model.Activity.GetTitleOrDefault(() => T["Update X (Twitter) Status"])</h4>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@model UpdateTwitterStatusTaskViewModel

<div class="mb-3" asp-validation-class-for="StatusTemplate">
<label asp-for="StatusTemplate" class="form-label">@T["Template for updating twitter status"]</label>
<label asp-for="StatusTemplate" class="form-label">@T["Template for updating X (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 post."]</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<h4 class="card-title"><i class="fa-brands fa-x-twitter" aria-hidden="true"></i>@T["Update X Status"]</h4>
<h4 class="card-title"><i class="fa-brands fa-x-twitter" aria-hidden="true"></i>@T["Update X (Twitter) Status"]</h4>
<p>@T["Create a post"]</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span class="icon"><i class="fa-brands fa-x-twitter" aria-hidden="true"></i></span><span class="title">@T["X"]</span>
<span class="icon"><i class="fa-brands fa-x-twitter" aria-hidden="true"></i></span><span class="title">@T["X (Twitter)"]</span>
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

<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/#twitter-integration" target="_blank">@T["See documentation"]</a>
<a class="seedoc" href="@(OrchardCore.Admin.Constants.DocsUrl)reference/modules/X/#-xtwitter-integration" target="_blank">@T["See documentation"]</a>
davidpuplava marked this conversation as resolved.
Show resolved Hide resolved
</p>

@if (Model.HasDecryptionError)
{
<p class="alert alert-danger">@T["An error occurred while decrypting a setting. Please apply and save."]</p>
}

<h3>@T["X Integration Settings"]</h3>
<h3>@T["X (Twitter) 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">
<label asp-for="APIKey" class="form-label">@T["API key"]</label>
<input asp-for="APIKey" class="form-control" autocomplete="off" />
<span asp-validation-for="APIKey"></span>
<span class="hint">@T["The API key defined in the Keys and tokens tab of twitter app dashboard."]</span>
<span class="hint">@T["The API key defined in the Keys and tokens tab of X (Twitter) app dashboard."]</span>
</div>
</div>

Expand All @@ -27,7 +27,7 @@
<label asp-for="APISecretKey" class="form-label">@T["API secret key"]</label>
<input asp-for="APISecretKey" class="form-control" type="password" value="@Model.APISecretKey" autocomplete="off" />
<span asp-validation-for="APISecretKey"></span>
<span class="hint">@T["The API secret defined in the Keys and tokens tab of twitter app dashboard."]</span>
<span class="hint">@T["The API secret defined in the Keys and tokens tab of X (Twitter) app dashboard."]</span>
</div>
</div>

Expand All @@ -36,7 +36,7 @@
<label asp-for="AccessToken" class="form-label">@T["Access Token"]</label>
<input asp-for="AccessToken" class="form-control" autocomplete="off" />
<span asp-validation-for="AccessToken"></span>
<span class="hint">@T["The Access Token defined in the Keys and tokens tab of twitter app dashboard."]</span>
<span class="hint">@T["The Access Token defined in the Keys and tokens tab of X (Twitter) app dashboard."]</span>
</div>
</div>

Expand All @@ -45,6 +45,6 @@
<label asp-for="AccessTokenSecret" class="form-label">@T["Access Token Secret"]</label>
<input asp-for="AccessTokenSecret" class="form-control" type="password" value="@Model.AccessTokenSecret" autocomplete="off" />
<span asp-validation-for="AccessTokenSecret"></span>
<span class="hint">@T["The Access Token Secret in the Keys and tokens tab of twitter app dashboard."]</span>
<span class="hint">@T["The Access Token Secret in the Keys and tokens tab of X (Twitter) app dashboard."]</span>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

<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-x" target="_blank">@T["See documentation"]</a>
<a class="seedoc" href="@(OrchardCore.Admin.Constants.DocsUrl)reference/modules/X/#sign-in-with-x-twitter" target="_blank">@T["See documentation"]</a>
</p>

<h3>@T["Sign in with X Settings"]</h3>
<h3>@T["Sign in with X (Twitter) 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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ IStringLocalizer<UpdateTwitterStatusTask> localizer
S = localizer;
}

public override LocalizedString DisplayText => S["Update X Status Task"];
public override LocalizedString DisplayText => S["Update X (Twitter) 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Data.Migration;
davidpuplava marked this conversation as resolved.
Show resolved Hide resolved
using OrchardCore.Modules;
using OrchardCore.Twitter.Workflows.Activities;
using OrchardCore.Twitter.Workflows.Drivers;
Expand Down