mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-01-18 13:07:58 +00:00
Small frontend fixes
This commit is contained in:
parent
f0ab5288f7
commit
8bebdfccd8
@ -70,7 +70,7 @@
|
|||||||
<div class="forminput {type}">
|
<div class="forminput {type}">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
{#if type === 'string'}
|
{#if type === 'string'}
|
||||||
<input type="text" bind:value use:input={{ type, onValid, onInvalid, mandatory, autofocus }} />
|
<input type="text" bind:value use:input={{ type, onValid, onInvalid, mandatory, autofocus }} autocomplete="off" spellcheck="false" />
|
||||||
{:else if type === 'objectid'}
|
{:else if type === 'objectid'}
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -30,7 +30,9 @@
|
|||||||
|
|
||||||
function refresh(hideObjectIndicators, items) {
|
function refresh(hideObjectIndicators, items) {
|
||||||
_items = objectToArray(items).map(item => {
|
_items = objectToArray(items).map(item => {
|
||||||
item.children = objectToArray(item.children);
|
if (item.children) {
|
||||||
|
item.children = objectToArray(item.children);
|
||||||
|
}
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -169,22 +169,41 @@
|
|||||||
<span class="label">Query or id</span>
|
<span class="label">Query or id</span>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
class="code"
|
class="code"
|
||||||
|
placeholder={defaults.query}
|
||||||
|
autocomplete="off"
|
||||||
|
spellcheck="false"
|
||||||
|
use:input={{ type: 'json', autofocus: true }}
|
||||||
bind:this={queryField}
|
bind:this={queryField}
|
||||||
bind:value={form.query}
|
bind:value={form.query}
|
||||||
use:input={{ type: 'json', autofocus: true }}
|
/>
|
||||||
placeholder={defaults.query} />
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="field">
|
<label class="field">
|
||||||
<span class="label">Sort</span>
|
<span class="label">Sort</span>
|
||||||
<input type="text" class="code" bind:value={form.sort} use:input={{ type: 'json' }} placeholder={defaults.sort} />
|
<input
|
||||||
|
type="text"
|
||||||
|
class="code"
|
||||||
|
placeholder={defaults.sort}
|
||||||
|
autocomplete="off"
|
||||||
|
spellcheck="false"
|
||||||
|
bind:value={form.sort}
|
||||||
|
use:input={{ type: 'json' }}
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row two">
|
<div class="form-row two">
|
||||||
<label class="field">
|
<label class="field">
|
||||||
<span class="label">Fields</span>
|
<span class="label">Fields</span>
|
||||||
<input type="text" class="code" bind:value={form.fields} use:input={{ type: 'json' }} placeholder={defaults.fields} />
|
<input
|
||||||
|
type="text"
|
||||||
|
class="code"
|
||||||
|
placeholder={defaults.fields}
|
||||||
|
autocomplete="off"
|
||||||
|
spellcheck="false"
|
||||||
|
bind:value={form.fields}
|
||||||
|
use:input={{ type: 'json' }}
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="field">
|
<label class="field">
|
||||||
@ -194,7 +213,8 @@
|
|||||||
bind:value={form.skip}
|
bind:value={form.skip}
|
||||||
use:input
|
use:input
|
||||||
placeholder={defaults.skip}
|
placeholder={defaults.skip}
|
||||||
list="skipstops" />
|
list="skipstops"
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="field">
|
<label class="field">
|
||||||
@ -204,7 +224,8 @@
|
|||||||
bind:value={form.limit}
|
bind:value={form.limit}
|
||||||
use:input
|
use:input
|
||||||
placeholder={defaults.limit}
|
placeholder={defaults.limit}
|
||||||
list="limits" />
|
list="limits"
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -242,9 +263,11 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<Grid
|
<Grid
|
||||||
key="_id"
|
key="_id"
|
||||||
columns={$views[collection.viewKey]?.columns?.map(c => {
|
columns={$views[collection.viewKey]?.columns
|
||||||
return { key: c.key, title: c.key };
|
?.filter(c => c.showInTable)
|
||||||
}) || []}
|
.map(c => {
|
||||||
|
return { key: c.key, title: c.key };
|
||||||
|
}) || []}
|
||||||
showHeaders={true}
|
showHeaders={true}
|
||||||
items={result.results ? result.results.map(r => EJSON.deserialize(r)) : []}
|
items={result.results ? result.results.map(r => EJSON.deserialize(r)) : []}
|
||||||
bind:activePath
|
bind:activePath
|
||||||
@ -295,7 +318,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if objectViewerData}
|
{#if objectViewerData}
|
||||||
<!-- @todo Implement save -->
|
|
||||||
<ObjectViewer bind:data={objectViewerData} saveable on:save={saveDocument} bind:successMessage={objectViewerSuccessMessage} />
|
<ObjectViewer bind:data={objectViewerData} saveable on:save={saveDocument} bind:successMessage={objectViewerSuccessMessage} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
@ -73,12 +73,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showJson() {
|
function showJson() {
|
||||||
if (viewType === 'form') {
|
objectViewerData = [ ...newItems ];
|
||||||
objectViewerData = { ...(newItems[0] || {}) };
|
|
||||||
}
|
|
||||||
else if (viewType === 'table') {
|
|
||||||
objectViewerData = [ ...newItems ];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addRow(beforeIndex = -1) {
|
function addRow(beforeIndex = -1) {
|
||||||
@ -151,7 +146,6 @@
|
|||||||
<div class="table">
|
<div class="table">
|
||||||
<Grid
|
<Grid
|
||||||
key="id"
|
key="id"
|
||||||
items={newItems}
|
|
||||||
columns={$views[collection.viewKey]?.columns
|
columns={$views[collection.viewKey]?.columns
|
||||||
?.filter(c => inputTypes.includes(c.inputType))
|
?.filter(c => inputTypes.includes(c.inputType))
|
||||||
.map(c => {
|
.map(c => {
|
||||||
@ -162,7 +156,9 @@
|
|||||||
canRemoveItems={true}
|
canRemoveItems={true}
|
||||||
hideChildrenToggles={true}
|
hideChildrenToggles={true}
|
||||||
on:addRow={addRow}
|
on:addRow={addRow}
|
||||||
|
on:removeItem={() => deleteRow()}
|
||||||
bind:inputsValid={allValid}
|
bind:inputsValid={allValid}
|
||||||
|
bind:items={newItems}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@ -209,7 +205,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<ObjectViewer data={objectViewerData} />
|
{#if objectViewerData}
|
||||||
|
<ObjectViewer bind:data={objectViewerData} />
|
||||||
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
form {
|
form {
|
||||||
|
Loading…
Reference in New Issue
Block a user