Skip to content

Commit

Permalink
Support class names in editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Oct 27, 2023
1 parent 323c9db commit 552acb5
Show file tree
Hide file tree
Showing 19 changed files with 196 additions and 120 deletions.
2 changes: 2 additions & 0 deletions backend/i18n/frontend_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@
"schemas.fieldTypes.string.characters": "Characters",
"schemas.fieldTypes.string.charactersMax": "Max Characters",
"schemas.fieldTypes.string.charactersMin": "Min Characters",
"schemas.fieldTypes.string.classNames": "Class Names",
"schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.",
"schemas.fieldTypes.string.contentType": "Content Type",
"schemas.fieldTypes.string.description": "Titles, names, paragraphs.",
"schemas.fieldTypes.string.folderId": "Asset folder",
Expand Down
2 changes: 2 additions & 0 deletions backend/i18n/frontend_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@
"schemas.fieldTypes.string.characters": "Personnages",
"schemas.fieldTypes.string.charactersMax": "Caractères maximum",
"schemas.fieldTypes.string.charactersMin": "Caractères minimum",
"schemas.fieldTypes.string.classNames": "Class Names",
"schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.",
"schemas.fieldTypes.string.contentType": "Type de contenu",
"schemas.fieldTypes.string.description": "Titres, noms, paragraphes.",
"schemas.fieldTypes.string.folderId": "Dossier d'actifs",
Expand Down
2 changes: 2 additions & 0 deletions backend/i18n/frontend_it.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@
"schemas.fieldTypes.string.characters": "Caratteri",
"schemas.fieldTypes.string.charactersMax": "Max numero di Caratteri",
"schemas.fieldTypes.string.charactersMin": "Min numero di Caratteri",
"schemas.fieldTypes.string.classNames": "Class Names",
"schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.",
"schemas.fieldTypes.string.contentType": "Content Type",
"schemas.fieldTypes.string.description": "Titoli, nomi, paragrafi.",
"schemas.fieldTypes.string.folderId": "Asset folder",
Expand Down
2 changes: 2 additions & 0 deletions backend/i18n/frontend_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@
"schemas.fieldTypes.string.characters": "Karakters",
"schemas.fieldTypes.string.charactersMax": "Max. karakters",
"schemas.fieldTypes.string.charactersMin": "Min. karakters",
"schemas.fieldTypes.string.classNames": "Class Names",
"schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.",
"schemas.fieldTypes.string.contentType": "Inhoudstype",
"schemas.fieldTypes.string.description": "Titels, namen, alinea's.",
"schemas.fieldTypes.string.folderId": "Documenten map",
Expand Down
2 changes: 2 additions & 0 deletions backend/i18n/frontend_pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@
"schemas.fieldTypes.string.characters": "Personagens",
"schemas.fieldTypes.string.charactersMax": "Personagens Max",
"schemas.fieldTypes.string.charactersMin": "Personagens de Min",
"schemas.fieldTypes.string.classNames": "Class Names",
"schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.",
"schemas.fieldTypes.string.contentType": "Tipo de Conteúdo",
"schemas.fieldTypes.string.description": "Títulos, nomes, parágrafos.",
"schemas.fieldTypes.string.folderId": "Pasta de ativos",
Expand Down
2 changes: 2 additions & 0 deletions backend/i18n/frontend_zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@
"schemas.fieldTypes.string.characters": "字符",
"schemas.fieldTypes.string.charactersMax": "最大字符数",
"schemas.fieldTypes.string.charactersMin": "最小字符数",
"schemas.fieldTypes.string.classNames": "Class Names",
"schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.",
"schemas.fieldTypes.string.contentType": "内容类型",
"schemas.fieldTypes.string.description": "标题、名称、段落。",
"schemas.fieldTypes.string.folderId": "资源文件夹",
Expand Down
2 changes: 2 additions & 0 deletions backend/i18n/source/frontend_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@
"schemas.fieldTypes.string.characters": "Characters",
"schemas.fieldTypes.string.charactersMax": "Max Characters",
"schemas.fieldTypes.string.charactersMin": "Min Characters",
"schemas.fieldTypes.string.classNames": "Class Names",
"schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.",
"schemas.fieldTypes.string.contentType": "Content Type",
"schemas.fieldTypes.string.description": "Titles, names, paragraphs.",
"schemas.fieldTypes.string.folderId": "Asset folder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public sealed record StringFieldProperties : FieldProperties
{
public ReadonlyList<string>? AllowedValues { get; init; }

public ReadonlyList<string>? ClassNames { get; set; }

public LocalizedValue<string?> DefaultValues { get; init; }

public string? DefaultValue { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public sealed class StringFieldPropertiesDto : FieldPropertiesDto
/// </summary>
public int? MaxWords { get; set; }

/// <summary>
/// The class names for the editor.
/// </summary>
public ReadonlyList<string>? ClassNames { get; set; }

/// <summary>
/// The allowed values for the field value.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public static void AddSquidexIdentityServer(this IServiceCollection services)
})
.AddServer(builder =>
{
builder.AddEventHandler<ValidateTokenRequestContext>(builder =>
{
builder.UseSingletonHandler<TestHandler>()
.SetOrder(int.MinValue);
});

builder.AddEventHandler<ProcessSignInContext>(builder =>
{
builder.UseSingletonHandler<AlwaysAddScopeHandler>()
Expand Down Expand Up @@ -171,3 +177,11 @@ private static void SetEndpoint(this List<Uri> endpointUris, Uri uri)
endpointUris.Add(uri);
}
}

public sealed class TestHandler : IOpenIddictServerHandler<ValidateTokenRequestContext>
{
public ValueTask HandleAsync(ValidateTokenRequestContext context)
{
return default;
}
}
2 changes: 1 addition & 1 deletion backend/src/Squidex/wwwroot/editor/squidex-editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 552acb5

Please sign in to comment.