Browse Source

Explicit menu item to open in new tab.

pull/1073/head
Sebastian Stehle 3 years ago
parent
commit
fcb3392714
  1. 3
      backend/i18n/frontend_en.json
  2. 3
      backend/i18n/frontend_fr.json
  3. 3
      backend/i18n/frontend_it.json
  4. 3
      backend/i18n/frontend_nl.json
  5. 3
      backend/i18n/frontend_pt.json
  6. 3
      backend/i18n/frontend_zh.json
  7. 1
      backend/i18n/source/backend_en.json
  8. 3
      backend/i18n/source/frontend_en.json
  9. 4
      backend/i18n/translator/Squidex.Translator/Processes/CheckFrontend.cs
  10. 6
      backend/i18n/translator/Squidex.Translator/Processes/Helper.cs
  11. 6
      backend/i18n/translator/Squidex.Translator/Processes/TranslateTemplates.cs
  12. 4
      backend/i18n/translator/Squidex.Translator/State/Old/OldTranslatedText.cs
  13. 6
      backend/i18n/translator/Squidex.Translator/State/Old/OldTranslationState.cs
  14. 7
      backend/i18n/translator/Squidex.Translator/State/TranslationService.cs
  15. 8
      backend/src/Squidex.Domain.Apps.Entities/Jobs/JobProcessor.cs
  16. 26
      backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerJob.cs
  17. 6
      backend/src/Squidex.Infrastructure/Reflection/SimpleMapper.cs
  18. 3
      backend/src/Squidex.Shared/Texts.fr.resx
  19. 3
      backend/src/Squidex.Shared/Texts.it.resx
  20. 3
      backend/src/Squidex.Shared/Texts.nl.resx
  21. 3
      backend/src/Squidex.Shared/Texts.pt.resx
  22. 3
      backend/src/Squidex.Shared/Texts.resx
  23. 3
      backend/src/Squidex.Shared/Texts.zh.resx
  24. 4
      frontend/src/app/features/content/shared/list/content.component.html
  25. 5
      frontend/src/app/features/content/shared/list/content.component.ts

3
backend/i18n/frontend_en.json

@ -251,6 +251,7 @@
"common.documentation": "Documentation",
"common.edit": "Edit",
"common.editing": "Editing",
"common.editInNewTab": "Open in new tab",
"common.email": "Email",
"common.empty": "No results.",
"common.enable": "Enable",
@ -598,8 +599,6 @@
"jobs.deleted": "Job is about to be deleted.",
"jobs.deleteFailed": "Failed to delete job.",
"jobs.empty": "No jobs created yet.",
"jobs.jobDownload": "Download",
"jobs.jobDownloadLink": "Ready",
"jobs.jobDuration": "Duration",
"jobs.loadFailed": "Failed to load jobs.",
"jobs.refreshTooltip": "Refresh jobs",

3
backend/i18n/frontend_fr.json

@ -251,6 +251,7 @@
"common.documentation": "Documentation",
"common.edit": "Modifier",
"common.editing": "Édition",
"common.editInNewTab": "Open in new tab",
"common.email": "E-mail",
"common.empty": "Aucun résultat.",
"common.enable": "Activer",
@ -598,8 +599,6 @@
"jobs.deleted": "Job is about to be deleted.",
"jobs.deleteFailed": "Failed to delete job.",
"jobs.empty": "No jobs created yet.",
"jobs.jobDownload": "Download",
"jobs.jobDownloadLink": "Ready",
"jobs.jobDuration": "Duration",
"jobs.loadFailed": "Failed to load jobs.",
"jobs.refreshTooltip": "Refresh jobs",

3
backend/i18n/frontend_it.json

@ -251,6 +251,7 @@
"common.documentation": "Documentation",
"common.edit": "Modifica",
"common.editing": "Editing",
"common.editInNewTab": "Open in new tab",
"common.email": "Email",
"common.empty": "No results.",
"common.enable": "Enable",
@ -598,8 +599,6 @@
"jobs.deleted": "Job is about to be deleted.",
"jobs.deleteFailed": "Failed to delete job.",
"jobs.empty": "No jobs created yet.",
"jobs.jobDownload": "Download",
"jobs.jobDownloadLink": "Ready",
"jobs.jobDuration": "Duration",
"jobs.loadFailed": "Failed to load jobs.",
"jobs.refreshTooltip": "Refresh jobs",

3
backend/i18n/frontend_nl.json

@ -251,6 +251,7 @@
"common.documentation": "Documentation",
"common.edit": "Bewerken",
"common.editing": "Bewerken",
"common.editInNewTab": "Open in new tab",
"common.email": "E-mail",
"common.empty": "No results.",
"common.enable": "Aanzetten",
@ -598,8 +599,6 @@
"jobs.deleted": "Job is about to be deleted.",
"jobs.deleteFailed": "Failed to delete job.",
"jobs.empty": "No jobs created yet.",
"jobs.jobDownload": "Download",
"jobs.jobDownloadLink": "Ready",
"jobs.jobDuration": "Duration",
"jobs.loadFailed": "Failed to load jobs.",
"jobs.refreshTooltip": "Refresh jobs",

3
backend/i18n/frontend_pt.json

@ -251,6 +251,7 @@
"common.documentation": "Documentação",
"common.edit": "Editar",
"common.editing": "Edição",
"common.editInNewTab": "Open in new tab",
"common.email": "Email",
"common.empty": "Sem resultados.",
"common.enable": "Ativar",
@ -598,8 +599,6 @@
"jobs.deleted": "Job is about to be deleted.",
"jobs.deleteFailed": "Failed to delete job.",
"jobs.empty": "No jobs created yet.",
"jobs.jobDownload": "Download",
"jobs.jobDownloadLink": "Ready",
"jobs.jobDuration": "Duration",
"jobs.loadFailed": "Failed to load jobs.",
"jobs.refreshTooltip": "Refresh jobs",

3
backend/i18n/frontend_zh.json

@ -251,6 +251,7 @@
"common.documentation": "Documentation",
"common.edit": "编辑",
"common.editing": "Editing",
"common.editInNewTab": "Open in new tab",
"common.email": "电子邮件",
"common.empty": "No results.",
"common.enable": "Enable",
@ -598,8 +599,6 @@
"jobs.deleted": "Job is about to be deleted.",
"jobs.deleteFailed": "Failed to delete job.",
"jobs.empty": "No jobs created yet.",
"jobs.jobDownload": "Download",
"jobs.jobDownloadLink": "Ready",
"jobs.jobDuration": "Duration",
"jobs.loadFailed": "Failed to load jobs.",
"jobs.refreshTooltip": "Refresh jobs",

1
backend/i18n/source/backend_en.json

@ -47,6 +47,7 @@
"common.defaultValue": "Default value",
"common.displayName": "Display name",
"common.documentation": "Documentation",
"common.editInNewTab": "Open in new tab",
"common.editor": "Editor",
"common.email": "Email",
"common.errorNoPermission": "You do not have the necessary permission.",

3
backend/i18n/source/frontend_en.json

@ -251,6 +251,7 @@
"common.documentation": "Documentation",
"common.edit": "Edit",
"common.editing": "Editing",
"common.editInNewTab": "Open in new tab",
"common.email": "Email",
"common.empty": "No results.",
"common.enable": "Enable",
@ -598,8 +599,6 @@
"jobs.deleted": "Job is about to be deleted.",
"jobs.deleteFailed": "Failed to delete job.",
"jobs.empty": "No jobs created yet.",
"jobs.jobDownload": "Download",
"jobs.jobDownloadLink": "Ready",
"jobs.jobDuration": "Duration",
"jobs.loadFailed": "Failed to load jobs.",
"jobs.refreshTooltip": "Refresh jobs",

4
backend/i18n/translator/Squidex.Translator/Processes/CheckFrontend.cs

@ -91,7 +91,7 @@ public class CheckFrontend
{
var matches = Regex.Matches(content, regex, RegexOptions.Singleline | RegexOptions.ExplicitCapture);
foreach (Match match in matches)
foreach (Match match in matches.OfType<Match>())
{
translations.Add(match.Groups["Key"].Value);
}
@ -115,7 +115,7 @@ public class CheckFrontend
{
var matches = Regex.Matches(content, regex, RegexOptions.Singleline | RegexOptions.ExplicitCapture);
foreach (Match match in matches)
foreach (Match match in matches.OfType<Match>())
{
translations.Add(match.Groups["Key"].Value);
}

6
backend/i18n/translator/Squidex.Translator/Processes/Helper.cs

@ -25,7 +25,7 @@ public static class Helper
public static string RelativeName(FileInfo file, DirectoryInfo folder)
{
return file.FullName[folder.FullName.Length..].Replace("\\", "/", StringComparison.Ordinal);
return file.FullName[folder.FullName.Length..].Replace('\\', '/');
}
public static void CheckOtherLocales(TranslationService service)
@ -157,14 +157,14 @@ public static class Helper
if (HasInvalidPrefixes(prefixes))
{
Console.WriteLine(" > Multiple prefixes found: {0}", string.Join(",", prefixes));
Console.WriteLine(" * Multiple prefixes found: {0}", string.Join(',', prefixes));
}
if (translations.Count > 0)
{
foreach (var key in translations)
{
Console.Write(" * ");
Console.Write(" * Missing: ");
Console.WriteLine(key);
}
}

6
backend/i18n/translator/Squidex.Translator/Processes/TranslateTemplates.cs

@ -13,13 +13,13 @@ namespace Squidex.Translator.Processes;
public partial class TranslateTemplates
{
private static readonly HashSet<string> TagsToIgnore = new HashSet<string>
{
private static readonly HashSet<string> TagsToIgnore =
[
"code",
"script",
"sqx-code",
"style"
};
];
private static readonly HashSet<string> AttributesToTranslate = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{

4
backend/i18n/translator/Squidex.Translator/State/Old/OldTranslatedText.cs

@ -9,7 +9,7 @@ namespace Squidex.Translator.State.Old;
public class OldTranslatedText
{
public SortedDictionary<string, string> Texts { get; set; } = new SortedDictionary<string, string>();
public SortedDictionary<string, string> Texts { get; set; } = [];
public SortedSet<TextOrigin> Origins { get; set; } = new SortedSet<TextOrigin>();
public SortedSet<TextOrigin> Origins { get; set; } = [];
}

6
backend/i18n/translator/Squidex.Translator/State/Old/OldTranslationState.cs

@ -9,9 +9,9 @@ namespace Squidex.Translator.State.Old;
public class OldTranslationState
{
public SortedDictionary<string, OldTranslatedText> Texts { get; set; } = new SortedDictionary<string, OldTranslatedText>();
public SortedDictionary<string, OldTranslatedText> Texts { get; set; } = [];
public HashSet<string> Ignores { get; set; } = new HashSet<string>();
public HashSet<string> Ignores { get; set; } = [];
public SortedDictionary<string, SortedSet<string>> Todos { get; set; } = new SortedDictionary<string, SortedSet<string>>();
public SortedDictionary<string, SortedSet<string>> Todos { get; set; } = [];
}

7
backend/i18n/translator/Squidex.Translator/State/TranslationService.cs

@ -10,7 +10,6 @@ using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
using Squidex.Translator.State.Old;
using static System.Net.Mime.MediaTypeNames;
namespace Squidex.Translator.State;
@ -25,7 +24,7 @@ public sealed class TranslationService
WriteIndented = true
};
private readonly Dictionary<string, TranslatedTexts> translations = new Dictionary<string, TranslatedTexts>();
private readonly Dictionary<string, TranslatedTexts> translations = [];
private readonly TranslationTodos translationsTodo;
private readonly TranslationsToIgnore translationToIgnore;
private readonly DirectoryInfo sourceDirectory;
@ -320,7 +319,7 @@ public sealed class TranslationService
{
if (!translationToIgnore.TryGetValue(name, out var ignores))
{
ignores = new SortedSet<string>();
ignores = [];
translationToIgnore[name] = ignores;
}
@ -332,7 +331,7 @@ public sealed class TranslationService
{
if (!translationsTodo.TryGetValue(name, out var todos))
{
todos = new SortedSet<string>();
todos = [];
translationsTodo[name] = todos;
}

8
backend/src/Squidex.Domain.Apps.Entities/Jobs/JobProcessor.cs

@ -157,11 +157,11 @@ public sealed class JobProcessor
{
await ProcessAsync(context, runner, context.CancellationToken);
await NotifyAsync(request, context, "jobs.notifySuccess");
await NotifyAsync(request, T.Get("jobs.notifySuccess", new { job = context.Job.Description }));
}
catch
{
await NotifyAsync(request, context, "jobs.notifyFailed");
await NotifyAsync(request, T.Get("jobs.notifyFailed", new { job = context.Job.Description }));
throw;
}
finally
@ -173,14 +173,14 @@ public sealed class JobProcessor
}, ct);
}
private async Task NotifyAsync(JobRequest request, JobRunContext context, string text)
private async Task NotifyAsync(JobRequest request, string text)
{
if (request.AppId == null || request.Actor.IsClient)
{
return;
}
var notificationText = T.Get(text, new { job = context.Job.Description });
var notificationText = text;
var notificationUrl = new Uri(urlGenerator.JobsUI(request.AppId));
await collaboration.NotifyAsync(request.Actor.Identifier, notificationText, request.Actor, notificationUrl, false, default);

26
backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerJob.cs

@ -121,19 +121,25 @@ public sealed class RuleRunnerJob : IJobRunner
{
if (!string.IsNullOrWhiteSpace(rule.Name))
{
var key = fromSnapshot ?
"jobs.ruleRunNamedSnapshot" :
"jobs.ruleRunName";
run.Job.Description = T.Get(key, new { name = rule.Name });
if (fromSnapshot)
{
run.Job.Description = T.Get("jobs.ruleRunNamedSnapshot", new { name = rule.Name });
}
else
{
run.Job.Description = T.Get("jobs.ruleRunNamed", new { name = rule.Name });
}
}
else
{
var key = fromSnapshot ?
"jobs.ruleRunSnapshot" :
"jobs.ruleRun";
run.Job.Description = T.Get(key);
if (fromSnapshot)
{
run.Job.Description = T.Get("jobs.ruleRunSnapshot");
}
else
{
run.Job.Description = T.Get("jobs.ruleRun");
}
}
}

6
backend/src/Squidex.Infrastructure/Reflection/SimpleMapper.cs

@ -218,9 +218,9 @@ public static class SimpleMapper
{
private static readonly MethodInfo CreateMethod =
typeof(TypeConverterPropertyMapper)
.GetMethod(nameof(CreateCore),
BindingFlags.Static |
BindingFlags.NonPublic)!;
.GetMethod(nameof(CreateCore),
BindingFlags.Static |
BindingFlags.NonPublic)!;
public static IPropertyMapper<TSource, TTarget> Create<TSource, TTarget>(Type sourceType, PropertyInfo sourceProperty, Type targetType, PropertyInfo targetProperty, TypeConverter typeConverter)
{

3
backend/src/Squidex.Shared/Texts.fr.resx

@ -226,6 +226,9 @@
<data name="common.documentation" xml:space="preserve">
<value>Documentation</value>
</data>
<data name="common.editInNewTab" xml:space="preserve">
<value>Open in new tab</value>
</data>
<data name="common.editor" xml:space="preserve">
<value>Éditeur</value>
</data>

3
backend/src/Squidex.Shared/Texts.it.resx

@ -226,6 +226,9 @@
<data name="common.documentation" xml:space="preserve">
<value>Documentation</value>
</data>
<data name="common.editInNewTab" xml:space="preserve">
<value>Open in new tab</value>
</data>
<data name="common.editor" xml:space="preserve">
<value>Redattore</value>
</data>

3
backend/src/Squidex.Shared/Texts.nl.resx

@ -226,6 +226,9 @@
<data name="common.documentation" xml:space="preserve">
<value>Documentatie</value>
</data>
<data name="common.editInNewTab" xml:space="preserve">
<value>Open in new tab</value>
</data>
<data name="common.editor" xml:space="preserve">
<value>Editor</value>
</data>

3
backend/src/Squidex.Shared/Texts.pt.resx

@ -226,6 +226,9 @@
<data name="common.documentation" xml:space="preserve">
<value>Documentação</value>
</data>
<data name="common.editInNewTab" xml:space="preserve">
<value>Open in new tab</value>
</data>
<data name="common.editor" xml:space="preserve">
<value>Editor</value>
</data>

3
backend/src/Squidex.Shared/Texts.resx

@ -226,6 +226,9 @@
<data name="common.documentation" xml:space="preserve">
<value>Documentation</value>
</data>
<data name="common.editInNewTab" xml:space="preserve">
<value>Open in new tab</value>
</data>
<data name="common.editor" xml:space="preserve">
<value>Editor</value>
</data>

3
backend/src/Squidex.Shared/Texts.zh.resx

@ -226,6 +226,9 @@
<data name="common.documentation" xml:space="preserve">
<value>Documentation</value>
</data>
<data name="common.editInNewTab" xml:space="preserve">
<value>Open in new tab</value>
</data>
<data name="common.editor" xml:space="preserve">
<value>编辑器</value>
</data>

4
frontend/src/app/features/content/shared/list/content.component.html

@ -27,6 +27,10 @@
</button>
<sqx-dropdown-menu *sqxModal="dropdown;closeAlways:true" [sqxAnchoredTo]="buttonOptions" scrollY="true" position="bottom-start">
<a class="dropdown-item" [routerLink]="link" target="_blank" sqxExternalLink>
{{ 'common.editInNewTab' | sqxTranslate }}
</a>
<a class="dropdown-item" *ngFor="let info of content.statusUpdates" (click)="statusChange.emit(info.status)">
{{ 'common.statusChangeTo' | sqxTranslate }}

5
frontend/src/app/features/content/shared/list/content.component.ts

@ -11,7 +11,8 @@
import { NgFor, NgIf } from '@angular/common';
import { booleanAttribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, QueryList, ViewChildren } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppLanguageDto, ConfirmClickDirective, ContentDto, ContentListCellDirective, ContentListCellResizeDirective, ContentListFieldComponent, ContentsState, ContentStatusComponent, DropdownMenuComponent, ModalDirective, ModalModel, ModalPlacementDirective, PatchContentForm, SchemaDto, StopClickDirective, TableField, TableSettings, TabRouterlinkDirective, TranslatePipe, TypedSimpleChanges } from '@app/shared';
import { RouterLink } from '@angular/router';
import { AppLanguageDto, ConfirmClickDirective, ContentDto, ContentListCellDirective, ContentListCellResizeDirective, ContentListFieldComponent, ContentsState, ContentStatusComponent, DropdownMenuComponent, ExternalLinkDirective, ModalDirective, ModalModel, ModalPlacementDirective, PatchContentForm, SchemaDto, StopClickDirective, TableField, TableSettings, TabRouterlinkDirective, TranslatePipe, TypedSimpleChanges } from '@app/shared';
@Component({
standalone: true,
@ -26,11 +27,13 @@ import { AppLanguageDto, ConfirmClickDirective, ContentDto, ContentListCellDirec
ContentListFieldComponent,
ContentStatusComponent,
DropdownMenuComponent,
ExternalLinkDirective,
FormsModule,
ModalDirective,
ModalPlacementDirective,
NgFor,
NgIf,
RouterLink,
StopClickDirective,
TabRouterlinkDirective,
TranslatePipe,

Loading…
Cancel
Save