Skip to content

Commit

Permalink
Merge pull request #2625 from opral/nilsjacobsen/inlmc-61-add-experim…
Browse files Browse the repository at this point in the history
…ental-property-in-settings-component

feat: allow experimental option in settings
  • Loading branch information
NilsJacobsen authored Apr 22, 2024
2 parents 30594e1 + c92bde5 commit b91ebbd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .changeset/afraid-jars-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@inlang/project-settings": patch
"@inlang/settings-component": patch
---

Added description to project settings type & allow experimental field in settings component
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ export default class InlangSettings extends LitElement {
${value.meta && (value.meta?.displayName as { en: string }).en}
</h2>`}
${Object.entries(value.schema.properties).map(([property, schema]) => {
if (property === "$schema" || property === "modules" || property === "experimental")
return undefined
if (property === "$schema" || property === "modules") return undefined
return key === "internal"
? html`
<general-input
Expand Down Expand Up @@ -289,4 +288,3 @@ declare global {
"inlang-settings": InlangSettings
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export class GeneralInput extends LitElement {
.schema=${this.schema}
.handleInlangProjectChange=${this.handleInlangProjectChange}
.required=${this.required}
.withTitle=${true}
.withDescription=${true}
.keyPlaceholder=${"Enter key"}
.valuePlaceholder=${"Enter value"}
></object-input>
</div>`
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,7 @@ export class DefaultObjectInput extends LitElement {
override render() {
return html` <div part="property" class="property">
<field-header
.fieldTitle=${JSON.stringify(() => {
if (this.withTitle) {
if (this._title) {
return this._title
} else {
return this.property
}
} else {
return undefined
}
})}
.fieldTitle=${this.withTitle ? (this._title ? this._title : this.property) : undefined}
.description=${this.withDescription ? this._description : ``}
.optional=${this.required ? false : true}
exportparts="property-title, property-paragraph"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ const InternalProjectSettings = Type.Object({
],
})
),
experimental: Type.Optional(Type.Record(Type.String(), Type.Literal(true))),
experimental: Type.Optional(
Type.Record(Type.String(), Type.Literal(true), {
title: "Experimental settings",
description: "Experimental settings that are used for product development.",
})
),
})

/**
Expand Down

0 comments on commit b91ebbd

Please sign in to comment.