Skip to content

Commit

Permalink
fix: displayName mockPorject properties
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsJacobsen committed Mar 21, 2024
1 parent 744a38f commit 9d29bab
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
40 changes: 30 additions & 10 deletions inlang/source-code/settings-component/src/mock/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ export const mockProject = {
plugins: () => [
{
id: "plugin.inlang.i18next",
displayName: "i18next",
description: "i18next",
displayName: {
en: "i18next",
},
description: {
en: "i18next",
},
module: "https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@4/dist/index.js",
settingsSchema: {
type: "object",
Expand Down Expand Up @@ -130,15 +134,23 @@ export const mockProject = {
messageLintRules: () => [
{
id: "messageLintRule.inlang.emptyPattern",
displayName: "Empty Pattern",
description: "Empty Pattern",
displayName: {
en: "Empty Pattern",
},
description: {
en: "Empty Pattern",
},
module:
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js",
},
{
id: "messageLintRule.inlang.identicalPattern",
displayName: "Identical Pattern",
description: "Identical Pattern",
displayName: {
en: "Identical Pattern",
},
description: {
en: "Identical Pattern",
},
module:
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js",
settingsSchema: {
Expand All @@ -157,15 +169,23 @@ export const mockProject = {
},
{
id: "messageLintRule.inlang.missingTranslation",
displayName: "Missing Translation",
description: "Missing Translation",
displayName: {
en: "Missing Translation",
},
description: {
en: "Missing Translation",
},
module:
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js",
},
{
id: "messageLintRule.inlang.messageWithoutSource",
displayName: "Without Source",
description: "Without Source",
displayName: {
en: "Message Without Source",
},
description: {
en: "Message Without Source",
},
module:
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export default class InlangSettings extends LitElement {
${Object.entries(this._projectSettingProperties).map(([key, value]) => {
return value.schema?.properties && this._newSettings
? html`<div class="module-container">
<h3>${value.meta?.displayName || key}</h3>
<h3>${(value.meta && (value.meta?.displayName as { en: string }).en) || key}</h3>
${Object.entries(value.schema.properties).map(([property, schema]) => {
if (property === "$schema" || property === "modules" || property === "experimental")
return undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class LintRuleLevelObjectInput extends LitElement {
</sl-option>`
})}
</sl-select>
<p class="ruleId">${module.displayName}</p>
<p class="ruleId">${(module.displayName as { en: string }).en}</p>
</div>`
: undefined
})}
Expand Down

0 comments on commit 9d29bab

Please sign in to comment.