prettier format
This commit is contained in:
parent
9f5e891b72
commit
038369f736
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
const POLL_INTERVAL = 1000
|
const POLL_INTERVAL = 1000
|
||||||
|
|
||||||
|
|
||||||
let loading = false
|
let loading = false
|
||||||
let feedbackModal
|
let feedbackModal
|
||||||
let deployments = []
|
let deployments = []
|
||||||
|
@ -63,7 +62,10 @@
|
||||||
// Required to check any updated deployment statuses between polls
|
// Required to check any updated deployment statuses between polls
|
||||||
function checkIncomingDeploymentStatus(current, incoming) {
|
function checkIncomingDeploymentStatus(current, incoming) {
|
||||||
for (let incomingDeployment of incoming) {
|
for (let incomingDeployment of incoming) {
|
||||||
if (incomingDeployment.status === DeploymentStatus.FAILURE || incomingDeployment.status === DeploymentStatus.SUCCESS) {
|
if (
|
||||||
|
incomingDeployment.status === DeploymentStatus.FAILURE ||
|
||||||
|
incomingDeployment.status === DeploymentStatus.SUCCESS
|
||||||
|
) {
|
||||||
const currentDeployment = current.find(
|
const currentDeployment = current.find(
|
||||||
deployment => deployment._id === incomingDeployment._id
|
deployment => deployment._id === incomingDeployment._id
|
||||||
)
|
)
|
||||||
|
@ -76,14 +78,17 @@
|
||||||
if (incomingDeployment.status === DeploymentStatus.FAILURE) {
|
if (incomingDeployment.status === DeploymentStatus.FAILURE) {
|
||||||
notifications.error(incomingDeployment.err)
|
notifications.error(incomingDeployment.err)
|
||||||
} else {
|
} else {
|
||||||
notifications.send("Published to Production.", "success", "CheckmarkCircle")
|
notifications.send(
|
||||||
|
"Published to Production.",
|
||||||
|
"success",
|
||||||
|
"CheckmarkCircle"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
fetchDeployments()
|
fetchDeployments()
|
||||||
poll = setInterval(fetchDeployments, POLL_INTERVAL)
|
poll = setInterval(fetchDeployments, POLL_INTERVAL)
|
||||||
|
@ -92,19 +97,16 @@
|
||||||
onDestroy(() => clearInterval(poll))
|
onDestroy(() => clearInterval(poll))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Button secondary on:click={publishModal.show}>Publish</Button>
|
||||||
<Button
|
|
||||||
secondary
|
|
||||||
on:click={publishModal.show}
|
|
||||||
>
|
|
||||||
Publish
|
|
||||||
</Button>
|
|
||||||
<Modal bind:this={publishModal}>
|
<Modal bind:this={publishModal}>
|
||||||
<ModalContent
|
<ModalContent
|
||||||
title="Publish to Production"
|
title="Publish to Production"
|
||||||
confirmText="Publish"
|
confirmText="Publish"
|
||||||
onConfirm={deployApp}
|
onConfirm={deployApp}
|
||||||
>
|
>
|
||||||
<span>The changes you have made will be published to the production version of the application.</span>
|
<span
|
||||||
|
>The changes you have made will be published to the production version of
|
||||||
|
the application.</span
|
||||||
|
>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
import { onMount, onDestroy } from "svelte"
|
import { onMount, onDestroy } from "svelte"
|
||||||
import { Button, Icon, Modal, notifications, ModalContent } from "@budibase/bbui"
|
import {
|
||||||
|
Button,
|
||||||
|
Icon,
|
||||||
|
Modal,
|
||||||
|
notifications,
|
||||||
|
ModalContent,
|
||||||
|
} from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import { apps } from "stores/portal"
|
import { apps } from "stores/portal"
|
||||||
import api from "builderStore/api"
|
import api from "builderStore/api"
|
||||||
|
@ -16,7 +22,9 @@
|
||||||
if (response.status !== 200) throw json.message
|
if (response.status !== 200) throw json.message
|
||||||
|
|
||||||
// Reset frontend state after revert
|
// Reset frontend state after revert
|
||||||
const applicationPkg = await api.get(`/api/applications/${appId}/appPackage`)
|
const applicationPkg = await api.get(
|
||||||
|
`/api/applications/${appId}/appPackage`
|
||||||
|
)
|
||||||
const pkg = await applicationPkg.json()
|
const pkg = await applicationPkg.json()
|
||||||
if (applicationPkg.ok) {
|
if (applicationPkg.ok) {
|
||||||
await store.actions.initialise(pkg)
|
await store.actions.initialise(pkg)
|
||||||
|
@ -31,14 +39,12 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<Icon name="Revert" hoverable on:click={revertModal.show} />
|
<Icon name="Revert" hoverable on:click={revertModal.show} />
|
||||||
<Modal bind:this={revertModal}>
|
<Modal bind:this={revertModal}>
|
||||||
<ModalContent
|
<ModalContent title="Revert Changes" confirmText="Revert" onConfirm={revert}>
|
||||||
title="Revert Changes"
|
<span
|
||||||
confirmText="Revert"
|
>The changes you have made will be deleted and the application reverted
|
||||||
onConfirm={revert}
|
back to its production state.</span
|
||||||
>
|
>
|
||||||
<span>The changes you have made will be deleted and the application reverted back to its production state.</span>
|
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
<script>
|
<script>
|
||||||
import { store, automationStore } from "builderStore"
|
import { store, automationStore } from "builderStore"
|
||||||
import { roles } from "stores/backend"
|
import { roles } from "stores/backend"
|
||||||
import { Button, Icon, Modal, ModalContent, ActionGroup, ActionButton, Tabs, Tab } from "@budibase/bbui"
|
import {
|
||||||
|
Button,
|
||||||
|
Icon,
|
||||||
|
Modal,
|
||||||
|
ModalContent,
|
||||||
|
ActionGroup,
|
||||||
|
ActionButton,
|
||||||
|
Tabs,
|
||||||
|
Tab,
|
||||||
|
} from "@budibase/bbui"
|
||||||
import SettingsLink from "components/settings/Link.svelte"
|
import SettingsLink from "components/settings/Link.svelte"
|
||||||
import ThemeEditorDropdown from "components/settings/ThemeEditorDropdown.svelte"
|
import ThemeEditorDropdown from "components/settings/ThemeEditorDropdown.svelte"
|
||||||
import FeedbackNavLink from "components/feedback/FeedbackNavLink.svelte"
|
import FeedbackNavLink from "components/feedback/FeedbackNavLink.svelte"
|
||||||
|
@ -84,7 +93,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="toprightnav">
|
<div class="toprightnav">
|
||||||
<RevertModal />
|
<RevertModal />
|
||||||
<Icon name="Play" hoverable
|
<Icon
|
||||||
|
name="Play"
|
||||||
|
hoverable
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
window.open(`/${application}`)
|
window.open(`/${application}`)
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -63,14 +63,16 @@
|
||||||
|
|
||||||
const openApp = app => {
|
const openApp = app => {
|
||||||
if (app.lockedBy && app.lockedBy?.email === $auth.user?.email) {
|
if (app.lockedBy && app.lockedBy?.email === $auth.user?.email) {
|
||||||
notifications.error(`App locked by ${app.lockedBy.email}. Please allow lock to expire or have them unlock this app.`)
|
notifications.error(
|
||||||
|
`App locked by ${app.lockedBy.email}. Please allow lock to expire or have them unlock this app.`
|
||||||
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appStatus === AppStatus.DEV) {
|
if (appStatus === AppStatus.DEV) {
|
||||||
$goto(`../../app/${app.appId}`)
|
$goto(`../../app/${app.appId}`)
|
||||||
} else {
|
} else {
|
||||||
window.open(`/${app.appId}`, '_blank');
|
window.open(`/${app.appId}`, "_blank")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue