Ensure the row key is unique even when the rows are sorted.

This commit is contained in:
Dean 2022-08-02 11:16:35 +01:00
parent 955ccc208e
commit e2f269bd1a
3 changed files with 71 additions and 59 deletions

View File

@ -6,6 +6,8 @@
Modal,
notifications,
ProgressCircle,
Layout,
Body,
} from "@budibase/bbui"
import { auth, apps } from "stores/portal"
import { processStringSync } from "@budibase/string-templates"
@ -29,6 +31,7 @@
lockedBy && lockedByYou ? "Locked by you" : `Locked by ${lockIdentifer}`
const getExpiryDuration = app => {
console.log("Testing")
if (!app?.lockedBy?.lockedAt) {
return -1
}
@ -72,22 +75,23 @@
{/if}
</div>
<Modal bind:this={appLockModal}>
<div>
<Modal bind:this={appLockModal}>
<ModalContent
title={lockedByHeading}
dataCy={"app-lock-modal"}
showConfirmButton={false}
showCancelButton={false}
>
<p>
Apps are locked to prevent work from being lost from overlapping changes
between your team.
</p>
<Layout noPadding>
<Body size="S">
Apps are locked to prevent work from being lost from overlapping
changes between your team.
</Body>
{#if lockedByYou && getExpiryDuration(app) > 0}
<span class="lock-expiry-body">
{processStringSync(
"This lock will expire in {{ duration time 'millisecond' }} from now.",
"This lock will expire in {{ duration time 'millisecond' }} from now. This lock will expire in This lock will expire in ",
{
time: getExpiryDuration(app),
}
@ -126,8 +130,10 @@
{/if}
</ButtonGroup>
</div>
</Layout>
</ModalContent>
</Modal>
</Modal>
</div>
<style>
.lock-modal-actions {

View File

@ -6,6 +6,7 @@
export let app
export let editApp
export let appOverview
export let idx
</script>
<div class="title" data-cy={`${app.devId}`}>
@ -29,8 +30,8 @@
Never updated
{/if}
</div>
<div class="desktop">
<AppLockModal {app} buttonSize="M" />
<div class="desktop check">
<span><AppLockModal {app} buttonSize="M" /></span>
</div>
<div class="desktop">
<div class="app-status">

View File

@ -381,8 +381,13 @@
</div>
<div class="appTable" class:unlocked>
{#each filteredApps as app (app.appId)}
<AppRow {app} {editApp} {appOverview} />
{#each filteredApps as app, idx}
<AppRow
{app}
{editApp}
{appOverview}
idx={`${idx}_${app.appId}`}
/>
{/each}
</div>
</Layout>