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

View File

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

View File

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