Skip to content

Commit

Permalink
Add new buttons. (#1124)
Browse files Browse the repository at this point in the history
* Add new buttons.

* Harden tests

* Make screenshots.

* Enable screenshots.

* Fix close?
  • Loading branch information
SebastianStehle committed Sep 4, 2024
1 parent 7cdd551 commit a746d23
Show file tree
Hide file tree
Showing 33 changed files with 379 additions and 131 deletions.
14 changes: 11 additions & 3 deletions backend/i18n/frontend_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"common.more": "More",
"common.name": "Name",
"common.next": "Continue",
"common.nextPage": "Next Page",
"common.no": "No",
"common.nothingChanged": "Nothing has been changed.",
"common.notSupported": "Not Supported",
Expand All @@ -320,6 +321,7 @@
"common.pagerInfo": "{itemFirst}-{itemLast} of {numberOfItems}",
"common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?",
"common.pagerReload": "Click to reload view and get total number of items",
"common.pageSize": "Page Size",
"common.password": "Password",
"common.passwordConfirm": "Confirm Password",
"common.pattern": "Pattern",
Expand All @@ -328,6 +330,7 @@
"common.permissions": "Permissions",
"common.prev": "Back",
"common.preview": "Preview",
"common.prevPage": "Previous Page",
"common.product": "Squidex Headless CMS",
"common.project": "Project",
"common.queryOperators.contains": "contains",
Expand Down Expand Up @@ -359,6 +362,9 @@
"common.rules": "Rules",
"common.sampleCodeLabel": "Sample Code at",
"common.save": "Save",
"common.saveAdd": "Save & add another",
"common.saveClose": "Save & close",
"common.saveEdit": "Save & editor",
"common.schema": "Schema",
"common.schemas": "Schemas",
"common.search": "Search",
Expand Down Expand Up @@ -480,6 +486,8 @@
"contents.removeConfirmText": "Do you really want to remove the content?",
"contents.removeConfirmTitle": "Remove content",
"contents.saveAndPublish": "Save and Publish",
"contents.saveAndPublishAdd": "Save and Publish & add another",
"contents.saveAndPublishClose": "Save and Publish & close",
"contents.scheduledAt": "at",
"contents.scheduledBy": "by",
"contents.scheduledTo": "to",
Expand Down Expand Up @@ -785,9 +793,9 @@
"rules.updateFailed": "Failed to update rule. Please reload.",
"rules.when": "When",
"schemas.addField": "Add Field",
"schemas.addFieldAndClose": "Create and close",
"schemas.addFieldAndCreate": "Create and add field",
"schemas.addFieldAndEdit": "Create and edit field",
"schemas.addFieldAndClose": "Create",
"schemas.addFieldAndCreate": "Create & add another",
"schemas.addFieldAndEdit": "Create & edit properties",
"schemas.addFieldButton": "Add Field",
"schemas.addFieldFailed": "Failed to add field. Please reload.",
"schemas.addNestedField": "Add Nested Field",
Expand Down
8 changes: 8 additions & 0 deletions backend/i18n/frontend_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"common.more": "Plus",
"common.name": "Nom",
"common.next": "Continue",
"common.nextPage": "Next Page",
"common.no": "Non",
"common.nothingChanged": "Rien n'a été changé.",
"common.notSupported": "Non supporté",
Expand All @@ -320,6 +321,7 @@
"common.pagerInfo": "{itemFirst}-{itemLast} de {numberOfItems}",
"common.pagerInfoNoTotal": "{itemFirst}-{itemLast} Du total?",
"common.pagerReload": "Cliquez pour recharger la vue et obtenir le nombre total d'articles",
"common.pageSize": "Page Size",
"common.password": "Mot de passe",
"common.passwordConfirm": "Confirmez le mot de passe",
"common.pattern": "Modèle",
Expand All @@ -328,6 +330,7 @@
"common.permissions": "Autorisations",
"common.prev": "Back",
"common.preview": "Aperçu",
"common.prevPage": "Previous Page",
"common.product": "CMS sans tête Squidex",
"common.project": "Projet",
"common.queryOperators.contains": "contient",
Expand Down Expand Up @@ -359,6 +362,9 @@
"common.rules": "Règles",
"common.sampleCodeLabel": "Exemple de code à",
"common.save": "Sauvegarder",
"common.saveAdd": "Save & add another",
"common.saveClose": "Save & close",
"common.saveEdit": "Save & editor",
"common.schema": "Schéma",
"common.schemas": "Schémas",
"common.search": "Recherche",
Expand Down Expand Up @@ -480,6 +486,8 @@
"contents.removeConfirmText": "Voulez-vous vraiment supprimer le contenu\u00A0?",
"contents.removeConfirmTitle": "Supprimer le contenu",
"contents.saveAndPublish": "Enregistrer et publier",
"contents.saveAndPublishAdd": "Save and Publish & add another",
"contents.saveAndPublishClose": "Save and Publish & close",
"contents.scheduledAt": "à",
"contents.scheduledBy": "par",
"contents.scheduledTo": "pour",
Expand Down
8 changes: 8 additions & 0 deletions backend/i18n/frontend_it.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"common.more": "More",
"common.name": "Nome",
"common.next": "Continue",
"common.nextPage": "Next Page",
"common.no": "No",
"common.nothingChanged": "Non è stato cambiato niente.",
"common.notSupported": "Not Supported",
Expand All @@ -320,6 +321,7 @@
"common.pagerInfo": "{itemFirst}-{itemLast} of {numberOfItems}",
"common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?",
"common.pagerReload": "Click to reload view and get total number of items",
"common.pageSize": "Page Size",
"common.password": "Password",
"common.passwordConfirm": "Conferma Password",
"common.pattern": "Pattern",
Expand All @@ -328,6 +330,7 @@
"common.permissions": "Permessi",
"common.prev": "Back",
"common.preview": "Anteprima",
"common.prevPage": "Previous Page",
"common.product": "Squidex Headless CMS",
"common.project": "Progetto",
"common.queryOperators.contains": "contiene",
Expand Down Expand Up @@ -359,6 +362,9 @@
"common.rules": "Regole",
"common.sampleCodeLabel": "Esempio di codice per",
"common.save": "Salva",
"common.saveAdd": "Save & add another",
"common.saveClose": "Save & close",
"common.saveEdit": "Save & editor",
"common.schema": "Schema",
"common.schemas": "Schemi",
"common.search": "Search",
Expand Down Expand Up @@ -480,6 +486,8 @@
"contents.removeConfirmText": "Sei sicuro di voler rimuovere il contenuto?",
"contents.removeConfirmTitle": "Cancella il contenuto",
"contents.saveAndPublish": "Salva e pubblica",
"contents.saveAndPublishAdd": "Save and Publish & add another",
"contents.saveAndPublishClose": "Save and Publish & close",
"contents.scheduledAt": "alle",
"contents.scheduledBy": "by",
"contents.scheduledTo": "a",
Expand Down
8 changes: 8 additions & 0 deletions backend/i18n/frontend_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"common.more": "Meer",
"common.name": "Naam",
"common.next": "Continue",
"common.nextPage": "Next Page",
"common.no": "Nee",
"common.nothingChanged": "Er is niets veranderd.",
"common.notSupported": "Not Supported",
Expand All @@ -320,6 +321,7 @@
"common.pagerInfo": "{itemFirst} - {itemLast} van {numberOfItems}",
"common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?",
"common.pagerReload": "Click to reload view and get total number of items",
"common.pageSize": "Page Size",
"common.password": "Wachtwoord",
"common.passwordConfirm": "Bevestig wachtwoord",
"common.pattern": "Patroon",
Expand All @@ -328,6 +330,7 @@
"common.permissions": "Rechten",
"common.prev": "Back",
"common.preview": "Preview",
"common.prevPage": "Previous Page",
"common.product": "Squidex Headless CMS",
"common.project": "Project",
"common.queryOperators.contains": "bevat",
Expand Down Expand Up @@ -359,6 +362,9 @@
"common.rules": "Regels",
"common.sampleCodeLabel": "Voorbeeldcode bij",
"common.save": "Opslaan",
"common.saveAdd": "Save & add another",
"common.saveClose": "Save & close",
"common.saveEdit": "Save & editor",
"common.schema": "Schema",
"common.schemas": "Schema's",
"common.search": "Zoeken",
Expand Down Expand Up @@ -480,6 +486,8 @@
"contents.removeConfirmText": "Wil je de inhoud echt verwijderen?",
"contents.removeConfirmTitle": "Verwijder inhoud",
"contents.saveAndPublish": "Opslaan en publiceren",
"contents.saveAndPublishAdd": "Save and Publish & add another",
"contents.saveAndPublishClose": "Save and Publish & close",
"contents.scheduledAt": "bij",
"contents.scheduledBy": "door",
"contents.scheduledTo": "naar",
Expand Down
8 changes: 8 additions & 0 deletions backend/i18n/frontend_pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"common.more": "Mais",
"common.name": "Nome",
"common.next": "Continue",
"common.nextPage": "Next Page",
"common.no": "Não",
"common.nothingChanged": "Nada foi mudado.",
"common.notSupported": "Não suportado",
Expand All @@ -320,6 +321,7 @@
"common.pagerInfo": "{itemFirst}-{itemLast} de {numberOfItems}",
"common.pagerInfoNoTotal": "{itemFirst}-{itemLast} do total?",
"common.pagerReload": "Clique para recarregar a vista e obter o número total de itens",
"common.pageSize": "Page Size",
"common.password": "Password",
"common.passwordConfirm": "Confirmar Password",
"common.pattern": "Padrão",
Expand All @@ -328,6 +330,7 @@
"common.permissions": "Permissões",
"common.prev": "Back",
"common.preview": "Previsualizar",
"common.prevPage": "Previous Page",
"common.product": "CMS Headless Squidex",
"common.project": "Projeto",
"common.queryOperators.contains": "contém",
Expand Down Expand Up @@ -359,6 +362,9 @@
"common.rules": "Regras",
"common.sampleCodeLabel": "Código de amostra em",
"common.save": "Salvar",
"common.saveAdd": "Save & add another",
"common.saveClose": "Save & close",
"common.saveEdit": "Save & editor",
"common.schema": "Esquema",
"common.schemas": "Esquemas",
"common.search": "Pesquisar",
Expand Down Expand Up @@ -480,6 +486,8 @@
"contents.removeConfirmText": "Quer mesmo remover o conteúdo?",
"contents.removeConfirmTitle": "Remover conteúdo",
"contents.saveAndPublish": "Salvar e Publicar",
"contents.saveAndPublishAdd": "Save and Publish & add another",
"contents.saveAndPublishClose": "Save and Publish & close",
"contents.scheduledAt": "em",
"contents.scheduledBy": "por",
"contents.scheduledTo": "Para",
Expand Down
8 changes: 8 additions & 0 deletions backend/i18n/frontend_zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"common.more": "More",
"common.name": "名称",
"common.next": "Continue",
"common.nextPage": "Next Page",
"common.no": "",
"common.nothingChanged": "什么都没有改变。",
"common.notSupported": "Not Supported",
Expand All @@ -320,6 +321,7 @@
"common.pagerInfo": "{itemFirst}-{itemLast} 的 {numberOfItems}",
"common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?",
"common.pagerReload": "Click to reload view and get total number of items",
"common.pageSize": "Page Size",
"common.password": "密码",
"common.passwordConfirm": "确认密码",
"common.pattern": "模式",
Expand All @@ -328,6 +330,7 @@
"common.permissions": "权限",
"common.prev": "Back",
"common.preview": "预览",
"common.prevPage": "Previous Page",
"common.product": "Squidex Headless CMS",
"common.project": "项目",
"common.queryOperators.contains": "包含",
Expand Down Expand Up @@ -359,6 +362,9 @@
"common.rules": "规则",
"common.sampleCodeLabel": "示例代码在",
"common.save": "保存",
"common.saveAdd": "Save & add another",
"common.saveClose": "Save & close",
"common.saveEdit": "Save & editor",
"common.schema": "Schema",
"common.schemas": "Schemas",
"common.search": "搜索",
Expand Down Expand Up @@ -480,6 +486,8 @@
"contents.removeConfirmText": "您真的要删除内容吗?",
"contents.removeConfirmTitle": "删除内容",
"contents.saveAndPublish": "保存并发布",
"contents.saveAndPublishAdd": "Save and Publish & add another",
"contents.saveAndPublishClose": "Save and Publish & close",
"contents.scheduledAt": "at",
"contents.scheduledBy": "by",
"contents.scheduledTo": "to",
Expand Down
14 changes: 11 additions & 3 deletions backend/i18n/source/frontend_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"common.more": "More",
"common.name": "Name",
"common.next": "Continue",
"common.nextPage": "Next Page",
"common.no": "No",
"common.nothingChanged": "Nothing has been changed.",
"common.notSupported": "Not Supported",
Expand All @@ -320,6 +321,7 @@
"common.pagerInfo": "{itemFirst}-{itemLast} of {numberOfItems}",
"common.pagerInfoNoTotal": "{itemFirst}-{itemLast} of total?",
"common.pagerReload": "Click to reload view and get total number of items",
"common.pageSize": "Page Size",
"common.password": "Password",
"common.passwordConfirm": "Confirm Password",
"common.pattern": "Pattern",
Expand All @@ -328,6 +330,7 @@
"common.permissions": "Permissions",
"common.prev": "Back",
"common.preview": "Preview",
"common.prevPage": "Previous Page",
"common.product": "Squidex Headless CMS",
"common.project": "Project",
"common.queryOperators.contains": "contains",
Expand Down Expand Up @@ -359,6 +362,9 @@
"common.rules": "Rules",
"common.sampleCodeLabel": "Sample Code at",
"common.save": "Save",
"common.saveAdd": "Save & add another",
"common.saveClose": "Save & close",
"common.saveEdit": "Save & editor",
"common.schema": "Schema",
"common.schemas": "Schemas",
"common.search": "Search",
Expand Down Expand Up @@ -480,6 +486,8 @@
"contents.removeConfirmText": "Do you really want to remove the content?",
"contents.removeConfirmTitle": "Remove content",
"contents.saveAndPublish": "Save and Publish",
"contents.saveAndPublishAdd": "Save and Publish & add another",
"contents.saveAndPublishClose": "Save and Publish & close",
"contents.scheduledAt": "at",
"contents.scheduledBy": "by",
"contents.scheduledTo": "to",
Expand Down Expand Up @@ -785,9 +793,9 @@
"rules.updateFailed": "Failed to update rule. Please reload.",
"rules.when": "When",
"schemas.addField": "Add Field",
"schemas.addFieldAndClose": "Create and close",
"schemas.addFieldAndCreate": "Create and add field",
"schemas.addFieldAndEdit": "Create and edit field",
"schemas.addFieldAndClose": "Create",
"schemas.addFieldAndCreate": "Create & add another",
"schemas.addFieldAndEdit": "Create & edit properties",
"schemas.addFieldButton": "Add Field",
"schemas.addFieldFailed": "Failed to add field. Please reload.",
"schemas.addNestedField": "Add Nested Field",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public sealed class ContentFieldDataConverter : JsonConverter<ContentFieldData>

if (!reader.Read())
{
throw new JsonException("Unexpected end when reading Object.");
ThrowHelper.JsonSystemException("Unexpected end when reading Object.");
return result;
}

var value = JsonSerializer.Deserialize<JsonValue>(ref reader, options)!;
Expand All @@ -48,7 +49,8 @@ public sealed class ContentFieldDataConverter : JsonConverter<ContentFieldData>
}
}

throw new JsonException("Unexpected end when reading Object.");
ThrowHelper.JsonSystemException("Unexpected end when reading Object.");
return result;
}

public override void Write(Utf8JsonWriter writer, ContentFieldData value, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static Action<JsonTypeInfo> Modifier(TypeRegistry typeRegistry)

if (typeReader.TokenType != JsonTokenType.StartObject)
{
throw new JsonException();
ThrowHelper.JsonSystemException($"Expected Object, got '{reader.TokenType}'");
}

while (typeReader.Read())
Expand All @@ -75,7 +75,7 @@ public static Action<JsonTypeInfo> Modifier(TypeRegistry typeRegistry)

if (typeReader.TokenType != JsonTokenType.String)
{
ThrowHelper.JsonException($"Expected string discriminator value, got '{reader.TokenType}'");
ThrowHelper.JsonSystemException($"Expected string discriminator value, got '{reader.TokenType}'");
return default!;
}

Expand All @@ -94,7 +94,7 @@ public static Action<JsonTypeInfo> Modifier(TypeRegistry typeRegistry)
}
}

ThrowHelper.JsonException($"Object has no discriminator '{discriminatorName}'.");
ThrowHelper.JsonSystemException($"Object has no discriminator '{discriminatorName}'.");
return default!;
}

Expand All @@ -114,7 +114,7 @@ private Type GetDiscriminatorType(string name)
{
if (!typeRegistry.TryGetType<T>(name, out var type))
{
ThrowHelper.JsonException($"Object has invalid discriminator '{name}'.");
ThrowHelper.JsonSystemException($"Object has invalid discriminator '{name}'.");
return default!;
}

Expand Down
Loading

0 comments on commit a746d23

Please sign in to comment.