updated changelog and ui/dist
This commit is contained in:
@@ -268,7 +268,7 @@
|
||||
result.push("@request.auth.updated");
|
||||
|
||||
// load auth collection fields
|
||||
const authCollections = cachedCollections.filter((collection) => collection.isAuth);
|
||||
const authCollections = cachedCollections.filter((collection) => collection.$isAuth);
|
||||
for (const collection of authCollections) {
|
||||
const authKeys = getCollectionFieldKeys(collection.id, "@request.auth.");
|
||||
for (const k of authKeys) {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
export let collection = new Collection();
|
||||
|
||||
$: if (collection.isAuth && CommonHelper.isEmpty(collection.options)) {
|
||||
$: if (collection.$isAuth && CommonHelper.isEmpty(collection.options)) {
|
||||
collection.options = {
|
||||
allowEmailAuth: true,
|
||||
allowUsernameAuth: true,
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
let activeTab;
|
||||
let tabs = [];
|
||||
|
||||
$: if (collection.isAuth) {
|
||||
$: if (collection.$isAuth) {
|
||||
tabs = Object.assign({}, baseTabs, authTabs);
|
||||
if (!collection?.options.allowUsernameAuth && !collection?.options.allowEmailAuth) {
|
||||
delete tabs["auth-with-password"];
|
||||
@@ -93,7 +93,7 @@
|
||||
if (!collection?.options.allowOAuth2Auth) {
|
||||
delete tabs["auth-with-oauth2"];
|
||||
}
|
||||
} else if (collection.isView) {
|
||||
} else if (collection.$isView) {
|
||||
tabs = Object.assign({}, baseTabs);
|
||||
delete tabs.create;
|
||||
delete tabs.update;
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
<OverlayPanel bind:this={docsPanel} on:hide on:show class="docs-panel">
|
||||
<div class="docs-content-wrapper">
|
||||
<aside class="docs-sidebar" class:compact={collection?.isAuth}>
|
||||
<aside class="docs-sidebar" class:compact={collection?.$isAuth}>
|
||||
<nav class="sidebar-content">
|
||||
{#each Object.entries(tabs) as [key, tab], i (key)}
|
||||
<!-- add a separator before the first auth tab -->
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<code class="txt-sm">id</code> ,
|
||||
<code class="txt-sm">created</code> ,
|
||||
<code class="txt-sm">updated</code>
|
||||
{#if collection.isAuth}
|
||||
{#if collection.$isAuth}
|
||||
,
|
||||
<code class="txt-sm">username</code> ,
|
||||
<code class="txt-sm">email</code> ,
|
||||
|
||||
@@ -92,6 +92,10 @@
|
||||
If your query doesn't have a suitable one, you can use the universal
|
||||
<code>(ROW_NUMBER() OVER()) as id</code>.
|
||||
</li>
|
||||
<li>
|
||||
Expressions must be aliased with a valid formatted field name (eg.
|
||||
<code>MAX(balance) as maxBalance</code>).
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
return old.options?.maxSelect != 1 && field.options?.maxSelect == 1;
|
||||
}) || [];
|
||||
|
||||
$: showChanges = !newCollection?.isView || isCollectionRenamed;
|
||||
$: showChanges = !newCollection?.$isView || isCollectionRenamed;
|
||||
|
||||
export async function show(original, changed) {
|
||||
oldCollection = original;
|
||||
@@ -91,7 +91,7 @@
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
{#if !newCollection?.isView}
|
||||
{#if !newCollection?.$isView}
|
||||
{#each multipleToSingleFields as field}
|
||||
<li>
|
||||
Multiple to single value conversion of field
|
||||
|
||||
@@ -63,15 +63,16 @@
|
||||
}
|
||||
|
||||
$: if (collection.type === TYPE_VIEW) {
|
||||
// reset create, update and delete rules
|
||||
// reset non-view fields
|
||||
collection.createRule = null;
|
||||
collection.updateRule = null;
|
||||
collection.deleteRule = null;
|
||||
collection.indexes = [];
|
||||
}
|
||||
|
||||
// update indexes on collection rename
|
||||
$: if (collection?.name && original?.name != collection?.name) {
|
||||
collection.indexes = collection.indexes.map((idx) =>
|
||||
collection.indexes = collection.indexes?.map((idx) =>
|
||||
CommonHelper.replaceIndexTableName(idx, collection.name)
|
||||
);
|
||||
}
|
||||
@@ -321,7 +322,7 @@
|
||||
disabled={isSystemUpdate}
|
||||
spellcheck="false"
|
||||
autofocus={collection.$isNew}
|
||||
placeholder={collection.isAuth ? `eg. "users"` : `eg. "posts"`}
|
||||
placeholder={collection.$isAuth ? `eg. "users"` : `eg. "posts"`}
|
||||
value={collection.name}
|
||||
on:input={(e) => {
|
||||
collection.name = CommonHelper.slugify(e.target.value);
|
||||
@@ -374,7 +375,7 @@
|
||||
class:active={activeTab === TAB_SCHEMA}
|
||||
on:click={() => changeTab(TAB_SCHEMA)}
|
||||
>
|
||||
<span class="txt">{collection?.isView ? "Query" : "Fields"}</span>
|
||||
<span class="txt">{collection?.$isView ? "Query" : "Fields"}</span>
|
||||
{#if !CommonHelper.isEmpty(schemaTabError)}
|
||||
<i
|
||||
class="ri-error-warning-fill txt-danger"
|
||||
@@ -400,7 +401,7 @@
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
{#if collection.isAuth}
|
||||
{#if collection.$isAuth}
|
||||
<button
|
||||
type="button"
|
||||
class="tab-item"
|
||||
@@ -423,7 +424,7 @@
|
||||
<div class="tabs-content">
|
||||
<!-- avoid rerendering the fields tab -->
|
||||
<div class="tab-item" class:active={activeTab === TAB_SCHEMA}>
|
||||
{#if collection.isView}
|
||||
{#if collection.$isView}
|
||||
<CollectionQueryTab bind:collection />
|
||||
{:else}
|
||||
<CollectionFieldsTab bind:collection />
|
||||
@@ -436,7 +437,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if collection.isAuth}
|
||||
{#if collection.$isAuth}
|
||||
<div class="tab-item" class:active={activeTab === TAB_OPTIONS}>
|
||||
<CollectionAuthOptionsTab bind:collection />
|
||||
</div>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
},
|
||||
];
|
||||
|
||||
$: if (collection.isAuth) {
|
||||
$: if (collection.$isAuth) {
|
||||
baseData = {
|
||||
username: "test_username",
|
||||
email: "test@example.com",
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
},
|
||||
];
|
||||
|
||||
$: if (collection.isAuth) {
|
||||
$: if (collection.$isAuth) {
|
||||
baseData = {
|
||||
username: "test_username_update",
|
||||
emailVisibility: false,
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
noOptionsText="No collections found"
|
||||
selectionKey="id"
|
||||
items={$collections}
|
||||
disabled={!interactive}
|
||||
disabled={!interactive || field.id}
|
||||
bind:keyOfSelected={field.options.collectionId}
|
||||
>
|
||||
<svelte:fragment slot="afterOptions">
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
// clear default sort if created field is not available
|
||||
if (
|
||||
$activeCollection?.isView &&
|
||||
$activeCollection?.$isView &&
|
||||
!CommonHelper.extractColumnsFromQuery($activeCollection.options.query).includes("created")
|
||||
) {
|
||||
sort = "";
|
||||
@@ -139,7 +139,7 @@
|
||||
<span class="txt">API Preview</span>
|
||||
</button>
|
||||
|
||||
{#if !$activeCollection.isView}
|
||||
{#if !$activeCollection.$isView}
|
||||
<button type="button" class="btn btn-expanded" on:click={() => recordUpsertPanel?.show()}>
|
||||
<i class="ri-add-line" />
|
||||
<span class="txt">New record</span>
|
||||
@@ -161,7 +161,7 @@
|
||||
bind:filter
|
||||
bind:sort
|
||||
on:select={(e) => {
|
||||
$activeCollection.isView
|
||||
$activeCollection.$isView
|
||||
? recordPreviewPanel.show(e?.detail)
|
||||
: recordUpsertPanel?.show(e?.detail);
|
||||
}}
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
<button type="button" aria-label="More" class="btn btn-sm btn-circle btn-transparent flex-gap-0">
|
||||
<i class="ri-more-line" />
|
||||
<Toggler class="dropdown dropdown-right dropdown-nowrap">
|
||||
{#if collection.isAuth && !original.verified && original.email}
|
||||
{#if collection.$isAuth && !original.verified && original.email}
|
||||
<button
|
||||
type="button"
|
||||
class="dropdown-item closable"
|
||||
@@ -303,7 +303,7 @@
|
||||
<span class="txt">Send verification email</span>
|
||||
</button>
|
||||
{/if}
|
||||
{#if collection.isAuth && original.email}
|
||||
{#if collection.$isAuth && original.email}
|
||||
<button
|
||||
type="button"
|
||||
class="dropdown-item closable"
|
||||
@@ -329,7 +329,7 @@
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if collection.isAuth && !isNew}
|
||||
{#if collection.$isAuth && !isNew}
|
||||
<div class="tabs-header stretched">
|
||||
<button
|
||||
type="button"
|
||||
@@ -426,7 +426,7 @@
|
||||
{/each}
|
||||
</form>
|
||||
|
||||
{#if collection.isAuth && !isNew}
|
||||
{#if collection.$isAuth && !isNew}
|
||||
<div class="tab-item" class:active={activeTab === TAB_PROVIDERS}>
|
||||
<ExternalAuthsList {record} />
|
||||
</div>
|
||||
|
||||
@@ -57,12 +57,12 @@
|
||||
updateStoredHiddenColumns();
|
||||
}
|
||||
|
||||
$: hasCreated = !collection?.isView || (records.length > 0 && records[0].created != "");
|
||||
$: hasCreated = !collection?.$isView || (records.length > 0 && records[0].created != "");
|
||||
|
||||
$: hasUpdated = !collection?.isView || (records.length > 0 && records[0].updated != "");
|
||||
$: hasUpdated = !collection?.$isView || (records.length > 0 && records[0].updated != "");
|
||||
|
||||
$: collumnsToHide = [].concat(
|
||||
collection.isAuth
|
||||
collection.$isAuth
|
||||
? [
|
||||
{ id: "@username", name: "username" },
|
||||
{ id: "@email", name: "email" },
|
||||
@@ -276,7 +276,7 @@
|
||||
<table class="table" class:table-loading={isLoading}>
|
||||
<thead>
|
||||
<tr>
|
||||
{#if !collection.isView}
|
||||
{#if !collection.$isView}
|
||||
<th class="bulk-select-col min-width">
|
||||
{#if isLoading}
|
||||
<span class="loader loader-sm" />
|
||||
@@ -304,7 +304,7 @@
|
||||
</SortHeader>
|
||||
{/if}
|
||||
|
||||
{#if collection.isAuth}
|
||||
{#if collection.$isAuth}
|
||||
{#if !hiddenColumns.includes("@username")}
|
||||
<SortHeader class="col-type-text col-field-id" name="username" bind:sort>
|
||||
<div class="col-header-content">
|
||||
@@ -369,7 +369,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each records as record (!collection.isView ? record.id : record)}
|
||||
{#each records as record (!collection.$isView ? record.id : record)}
|
||||
<tr
|
||||
tabindex="0"
|
||||
class="row-handle"
|
||||
@@ -381,7 +381,7 @@
|
||||
}
|
||||
}}
|
||||
>
|
||||
{#if !collection.isView}
|
||||
{#if !collection.$isView}
|
||||
<td class="bulk-select-col min-width">
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div class="form-field" on:click|stopPropagation>
|
||||
@@ -404,7 +404,7 @@
|
||||
<div class="txt">{record.id}</div>
|
||||
</div>
|
||||
|
||||
{#if collection.isAuth}
|
||||
{#if collection.$isAuth}
|
||||
{#if record.verified}
|
||||
<i
|
||||
class="ri-checkbox-circle-fill txt-sm txt-success"
|
||||
@@ -421,7 +421,7 @@
|
||||
</td>
|
||||
{/if}
|
||||
|
||||
{#if collection.isAuth}
|
||||
{#if collection.$isAuth}
|
||||
{#if !hiddenColumns.includes("@username")}
|
||||
<td class="col-type-text col-field-username">
|
||||
{#if CommonHelper.isEmpty(record.username)}
|
||||
@@ -487,7 +487,7 @@
|
||||
>
|
||||
<span class="txt">Clear filters</span>
|
||||
</button>
|
||||
{:else if !collection?.isView}
|
||||
{:else if !collection?.$isView}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-expanded m-t-sm"
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
|
||||
const result = await ApiClient.collection(collectionId).getList(page, batchSize, {
|
||||
filter: filter,
|
||||
sort: !collection?.isView ? "-created" : "",
|
||||
sort: !collection?.$isView ? "-created" : "",
|
||||
$cancelKey: uniqueId + "loadList",
|
||||
});
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
autocompleteCollection={collection}
|
||||
on:submit={(e) => (filter = e.detail)}
|
||||
/>
|
||||
{#if !collection?.isView}
|
||||
{#if !collection?.$isView}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-transparent btn-hint p-l-sm p-r-sm"
|
||||
@@ -243,7 +243,7 @@
|
||||
<div class="content">
|
||||
<RecordInfo {record} {displayFields} />
|
||||
</div>
|
||||
{#if !collection?.isView}
|
||||
{#if !collection?.$isView}
|
||||
<div class="actions nonintrusive">
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -935,12 +935,12 @@ export default class CommonHelper {
|
||||
dummy["email"] = "test@example.com";
|
||||
}
|
||||
|
||||
const hasCreated = !collection?.isView || CommonHelper.extractColumnsFromQuery(collection?.options?.query).includes("created");
|
||||
const hasCreated = !collection?.$isView || CommonHelper.extractColumnsFromQuery(collection?.options?.query).includes("created");
|
||||
if (hasCreated) {
|
||||
dummy["created"] = "2022-01-01 01:00:00.123Z";
|
||||
}
|
||||
|
||||
const hasUpdated = !collection?.isView || CommonHelper.extractColumnsFromQuery(collection?.options?.query).includes("updated");
|
||||
const hasUpdated = !collection?.$isView || CommonHelper.extractColumnsFromQuery(collection?.options?.query).includes("updated");
|
||||
if (hasUpdated) {
|
||||
dummy["updated"] = "2022-01-01 23:59:59.456Z";
|
||||
}
|
||||
@@ -1429,11 +1429,11 @@ export default class CommonHelper {
|
||||
|
||||
let result = [prefix + "id"];
|
||||
|
||||
if (collection.isView) {
|
||||
if (collection.$isView) {
|
||||
for (let col of CommonHelper.extractColumnsFromQuery(collection.options.query)) {
|
||||
CommonHelper.pushUnique(result, prefix + col);
|
||||
}
|
||||
} else if (collection.isAuth) {
|
||||
} else if (collection.$isAuth) {
|
||||
result.push(prefix + "username");
|
||||
result.push(prefix + "email");
|
||||
result.push(prefix + "emailVisibility");
|
||||
|
||||
Reference in New Issue
Block a user