final tidy up

This commit is contained in:
Martin McKeaveney 2020-05-07 22:46:27 +01:00
parent 5646ef1101
commit 0f7292f30e
2 changed files with 0 additions and 79 deletions

View File

@ -1,66 +0,0 @@
<script>
import Select from "../../../common/Select.svelte"
export let record
export let field
export let errors
$: isDropdown =
field.type === "string" &&
field.typeOptions.values &&
field.typeOptions.values.length > 0
$: isNumber = field.type === "number"
$: isText = field.type === "string" && !isDropdown
$: isCheckbox = field.type === "bool"
$: isError = errors && errors.some(e => e.field && e.field === field.name)
$: isDatetime = field.type === "datetime"
</script>
<div class="uk-margin">
{#if !isCheckbox}
<label class="uk-form-label" for={field.name}>{field.label}</label>
{/if}
<div class="uk-form-controls">
{#if isDropdown}
<Select bind:value={record[field.name]}>
<option value="" />
{#each field.typeOptions.values as val}
<option value={val}>{val}</option>
{/each}
</Select>
{:else if isText}
<input
class="uk-input"
class:uk-form-danger={isError}
id={field.name}
type="text"
bind:value={record[field.name]} />
{:else if isNumber}
<input
class="uk-input"
class:uk-form-danger={isError}
type="number"
bind:value={record[field.name]} />
{:else if isDatetime}
<input
class="uk-input"
class:uk-form-danger={isError}
type="date"
bind:value={record[field.name]} />
{:else if isCheckbox}
<label>
<input
class="uk-checkbox"
class:uk-form-danger={isError}
type="checkbox"
bind:checked={record[field.name]} />
{field.label}
</label>
{/if}
</div>
</div>

View File

@ -4,18 +4,5 @@ const { homedir } = require("os")
module.exports.serverFileName = relativePath => module.exports.serverFileName = relativePath =>
resolve(__dirname, "..", "node_modules", "@budibase", "server", relativePath) resolve(__dirname, "..", "node_modules", "@budibase", "server", relativePath)
// module.exports.getAppContext = async ({ configName, masterIsCreated }) => {
// if (configName) {
// if (!configName.endsWith(".js")) {
// configName = `config.${configName}.js`
// }
// } else {
// configName = "config.js"
// }
// const config = require(resolve(cwd(), configName))()
// return await buildAppContext(config, masterIsCreated)
// }
module.exports.xPlatHomeDir = dir => module.exports.xPlatHomeDir = dir =>
dir.startsWith("~") ? join(homedir(), dir.substring(1)) : dir dir.startsWith("~") ? join(homedir(), dir.substring(1)) : dir