updated changelog and ui/dist

This commit is contained in:
Gani Georgiev
2023-03-27 19:43:46 +03:00
parent 05adb8c018
commit d0239f25ed
44 changed files with 131 additions and 120 deletions
@@ -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">