1
0
Fork 0
mirror of synced 2024-09-30 00:57:16 +13:00

Fix for duplicate app, PR feedback. Update for View only UX in app row, ensure favourite is displayed

This commit is contained in:
Dean 2024-03-11 09:20:19 +00:00
parent 780e11af47
commit c5753dab0a
3 changed files with 16 additions and 22 deletions

View file

@ -80,9 +80,9 @@
<Body size="S">{app.deployed ? "Published" : "Unpublished"}</Body>
</div>
{#if isBuilder}
<div class="actions-wrap">
<div class="app-row-actions">
<div class="actions-wrap">
<div class="app-row-actions">
{#if isBuilder}
<div class="row-action">
<Button size="S" secondary on:click={lockedAction || goToBuilder}>
Edit
@ -99,17 +99,16 @@
}}
/>
</div>
</div>
<div class="favourite-icon">
<FavouriteAppButton {app} noWrap />
</div>
{:else}
<!-- this can happen if an app builder has app user access to an app -->
<Button size="S" secondary>View</Button>
{/if}
</div>
{:else if app.deployed}
<!-- this can happen if an app builder has app user access to an app -->
<div class="app-row-actions">
<Button size="S" secondary>View</Button>
<div class="favourite-icon">
<FavouriteAppButton {app} noWrap />
</div>
{/if}
</div>
</div>
<style>

View file

@ -59,6 +59,7 @@ import sdk from "../../sdk"
import { builderSocket } from "../../websockets"
import { sdk as sharedCoreSDK } from "@budibase/shared-core"
import * as appMigrations from "../../appMigrations"
import { cloneDeep } from "lodash"
// utility function, need to do away with this
async function getLayouts() {
@ -682,7 +683,10 @@ export async function duplicateApp(
// Build a new request
const createRequest = {
roleId: ctx.roleId,
user: ctx.user,
user: {
...cloneDeep(ctx.user),
_id: dbCore.getGlobalIDFromUserMetadataID(ctx.user._id || ""),
},
request: {
body: createRequestBody,
},

View file

@ -199,12 +199,3 @@ export async function updateSelf(
_rev: user._rev!,
}
}
// export default {
// generateAPIKey,
// fetchAPIKey,
// getSelf,
// syncAppFavourites,
// fetchAppsByIds,
// updateSelf,
// }