Skip to content

Commit

Permalink
Fixes for day 2 of .NET Conf (#302)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
csharpfritz and github-actions[bot] authored Nov 15, 2023
1 parent c4fdd7d commit 69a5bc3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/TagzApp.Providers.YouTubeChat/YouTubeChatProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public async Task<IEnumerable<Content>> GetContentForHashtag(Hashtag tag, DateTi
}

_Status = SocialMediaStatus.Healthy;
_StatusMessage = "OK";
_StatusMessage = $"OK -- adding ({contents.Items.Count}) messages at {DateTimeOffset.UtcNow}";

return contents.Items.Select(i => new Content
{
Expand Down
3 changes: 2 additions & 1 deletion src/TagzApp.Storage.Postgres/AzureSafetyModeration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public void NotifyNewContent(string hashtag, Content content)
catch (RequestFailedException ex)
{
_AzureSafetyLogger.LogError(ex, "Analyze text failed.\nStatus code: {0}, Error code: {1}, Error message: {2}", ex.Status, ex.ErrorCode, ex.Message);
throw;
_NotifyNewMessages.NotifyNewContent(hashtag, content);
return;
}

if (response != null && (response.Value.SexualResult.Severity > 0 || response.Value.HateResult.Severity > 0 || response.Value.SelfHarmResult.Severity > 0 || response.Value.ViolenceResult.Severity > 0))
Expand Down
1 change: 1 addition & 0 deletions src/TagzApp.Web/Areas/Admin/Pages/Providers.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
aria-labelledby="heading-@provider.Id"
data-bs-parent="#providerAccordion">
<p class="ps-3 pt-3 mb-1">@provider.Description</p>
<p class="ps-3 pt-3 mb-1"><b>Status:</b> @health.Status - @health.Message</p>
<p class="ps-3 pt-3 mb-0 fst-italic">Please fill in the configuration values below:</p>
<form method="post" class="p-3" id="@($"{provider.Id}-form")">
<input type="hidden" id="Name" name="Name" value="@provider.DisplayName" />
Expand Down
14 changes: 14 additions & 0 deletions src/TagzApp.Web/wwwroot/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
var approvedFilterStatus = ApprovalFilter.All;
var providerFilter = [];
var cursorProviderId = null;
var currentModal = null;

const waterfallMaxEntries = 100;
const moderationMaxEntries = 500;
Expand Down Expand Up @@ -156,6 +157,9 @@
newMessage.addEventListener('click', function (ev) {
var el = ev.target.closest('article');

if (currentModal == content.providerId) return;
currentModal = content.providerId;

connection.invoke(
'SendMessageToOverlay',
window.TagzApp.Tags[0],
Expand Down Expand Up @@ -984,6 +988,16 @@
});
});

// Listen for the DisplayOverlay event and display the modal for the selected message
connection.on('DisplayOverlay', (content) => {
var item = document.querySelector(
`[data-providerid='${content.providerId}']`,
);
if (item) {
item.click();
}
});

// Start the connection.
await start();

Expand Down

0 comments on commit 69a5bc3

Please sign in to comment.