From 4096f4857c9b0ae15a90ba4d2bb89788d3b01657 Mon Sep 17 00:00:00 2001 From: Christo Date: Thu, 8 Jul 2021 14:38:49 +0200 Subject: [PATCH 01/60] Feat: Add collection fields as "extra" query config for MongoDB --- .../integration/ExtraQueryConfig.svelte | 48 +++++++ .../components/integration/QueryViewer.svelte | 17 +++ packages/server/src/api/routes/query.js | 2 + packages/server/src/definitions/datasource.ts | 10 ++ packages/server/src/integrations/mongodb.ts | 125 ++++++++++++++++-- 5 files changed, 191 insertions(+), 11 deletions(-) create mode 100644 packages/builder/src/components/integration/ExtraQueryConfig.svelte diff --git a/packages/builder/src/components/integration/ExtraQueryConfig.svelte b/packages/builder/src/components/integration/ExtraQueryConfig.svelte new file mode 100644 index 0000000000..303beb1e4b --- /dev/null +++ b/packages/builder/src/components/integration/ExtraQueryConfig.svelte @@ -0,0 +1,48 @@ + + +{#each extraFields as { key, displayName, type }} +
+ + {#if type === "string"} + populateExtraQuery(extraQueryFields)} + bind:value={extraQueryFields[key]} + /> + {/if} + + {#if type === "list"} + queryConfig[verb]?.displayName || capitalise(verb)} />
+ {#if integrationInfo?.extra && query.queryVerb} + + {/if} {/if} diff --git a/packages/server/src/api/routes/query.js b/packages/server/src/api/routes/query.js index dd307c9444..2bbadcb40a 100644 --- a/packages/server/src/api/routes/query.js +++ b/packages/server/src/api/routes/query.js @@ -30,6 +30,7 @@ function generateQueryValidation() { default: Joi.string().allow(""), })), queryVerb: Joi.string().allow().required(), + extra: Joi.object().optional(), schema: Joi.object({}).required().unknown(true) })) } @@ -39,6 +40,7 @@ function generateQueryPreviewValidation() { return joiValidator.body(Joi.object({ fields: Joi.object().required(), queryVerb: Joi.string().allow().required(), + extra: Joi.object().optional(), datasourceId: Joi.string().required(), parameters: Joi.object({}).required().unknown(true) })) diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index 22f1998601..24d8144940 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -49,6 +49,15 @@ export interface QueryDefinition { urlDisplay?: boolean } +export interface ExtraQueryConfig { + [key: string]: { + displayName: string, + type: string, + required: boolean + data?: object + } +} + export interface Integration { docs: string plus?: boolean @@ -58,6 +67,7 @@ export interface Integration { query: { [key: string]: QueryDefinition } + extra?: ExtraQueryConfig } export interface SearchFilters { diff --git a/packages/server/src/integrations/mongodb.ts b/packages/server/src/integrations/mongodb.ts index af7b49153d..ab21da6fd0 100644 --- a/packages/server/src/integrations/mongodb.ts +++ b/packages/server/src/integrations/mongodb.ts @@ -10,7 +10,7 @@ module MongoDBModule { interface MongoDBConfig { connectionString: string db: string - collection: string + // collection: string } const SCHEMA: Integration = { @@ -28,10 +28,6 @@ module MongoDBModule { type: DatasourceFieldTypes.STRING, required: true, }, - collection: { - type: DatasourceFieldTypes.STRING, - required: true, - }, }, query: { create: { @@ -40,7 +36,31 @@ module MongoDBModule { read: { type: QueryTypes.JSON, }, + update: { + type: QueryTypes.JSON, + }, + delete: { + type: QueryTypes.JSON, + } }, + extra: { + collection: { + displayName: "Collection", + type: DatasourceFieldTypes.STRING, + required: true, + }, + actionTypes: { + displayName: "Action Types", + type: DatasourceFieldTypes.LIST, + required: true, + data: { + read: ['find', 'findOne', 'findOneAndUpdate', "count", "distinct"], + create: ['insertOne', 'insertMany'], + update: ['updateOne', 'updateMany'], + delete: ['deleteOne', 'deleteMany'] + } + } + } } class MongoIntegration { @@ -56,12 +76,25 @@ module MongoDBModule { return this.client.connect() } - async create(query: { json: object }) { + async create(query: { json: object, extra: { [key: string]: string } }) { try { await this.connect() const db = this.client.db(this.config.db) - const collection = db.collection(this.config.collection) - return collection.insertOne(query.json) + const collection = db.collection(query.extra.collection) + + // For mongodb we add an extra actionType to specify + // which method we want to call on the collection + switch(query.extra.actionTypes) { + case 'insertOne': { + return collection.insertOne(query.json) + } + case 'insertMany': { + return collection.insertOne(query.json).toArray() + } + default: { + throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for create`) + } + } } catch (err) { console.error("Error writing to mongodb", err) throw err @@ -70,12 +103,32 @@ module MongoDBModule { } } - async read(query: { json: object }) { + async read(query: { json: object, extra: { [key: string]: string } }) { try { await this.connect() const db = this.client.db(this.config.db) - const collection = db.collection(this.config.collection) - return collection.find(query.json).toArray() + const collection = db.collection(query.extra.collection) + + switch(query.extra.actionTypes) { + case 'find': { + return collection.find(query.json).toArray() + } + case 'findOne': { + return collection.findOne(query.json) + } + case 'findOneAndUpdate': { + return collection.findOneAndUpdate(query.json) + } + case 'count': { + return collection.countDocuments(query.json) + } + case 'distinct': { + return collection.distinct(query.json) + } + default: { + throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for read`) + } + } } catch (err) { console.error("Error querying mongodb", err) throw err @@ -83,6 +136,56 @@ module MongoDBModule { await this.client.close() } } + + async update(query: { json: object, extra: { [key: string]: string } }) { + try { + await this.connect() + const db = this.client.db(this.config.db) + const collection = db.collection(query.extra.collection) + + switch(query.extra.actionTypes) { + case 'updateOne': { + return collection.updateOne(query.json) + } + case 'updateMany': { + return collection.updateMany(query.json).toArray() + } + default: { + throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for update`) + } + } + } catch (err) { + console.error("Error writing to mongodb", err) + throw err + } finally { + await this.client.close() + } + } + + async delete(query: { json: object, extra: { [key: string]: string } }) { + try { + await this.connect() + const db = this.client.db(this.config.db) + const collection = db.collection(query.extra.collection) + + switch(query.extra.actionTypes) { + case 'deleteOne': { + return collection.deleteOne(query.json) + } + case 'deleteMany': { + return collection.deleteMany(query.json).toArray() + } + default: { + throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for delete`) + } + } + } catch (err) { + console.error("Error writing to mongodb", err) + throw err + } finally { + await this.client.close() + } + } } module.exports = { From 8579d1872c1f44fe3490e1b6e6099b80643d8163 Mon Sep 17 00:00:00 2001 From: Christo Date: Fri, 9 Jul 2021 20:08:26 +0200 Subject: [PATCH 02/60] Test: Add some basic tests for mongodb queries --- packages/server/__mocks__/mongodb.ts | 15 ++++++ .../src/integrations/tests/mongo.spec.js | 48 ++++++++++++++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/packages/server/__mocks__/mongodb.ts b/packages/server/__mocks__/mongodb.ts index d7d8f852c1..06eefefea6 100644 --- a/packages/server/__mocks__/mongodb.ts +++ b/packages/server/__mocks__/mongodb.ts @@ -5,11 +5,26 @@ module MongoMock { this.connect = jest.fn() this.close = jest.fn() this.insertOne = jest.fn() + this.insertMany = jest.fn(() => ({toArray: () => []})) this.find = jest.fn(() => ({toArray: () => []})) + this.findOne = jest.fn() + this.count = jest.fn() + this.deleteOne = jest.fn() + this.deleteMany = jest.fn(() => ({toArray: () => []})) + this.updateOne = jest.fn() + this.updateMany = jest.fn(() => ({toArray: () => []})) + this.collection = jest.fn(() => ({ insertOne: this.insertOne, find: this.find, + insertMany: this.insertMany, + findOne: this.findOne, + count: this.count, + deleteOne: this.deleteOne, + deleteMany: this.deleteMany, + updateOne: this.updateOne, + updateMany: this.updateMany, })) this.db = () => ({ diff --git a/packages/server/src/integrations/tests/mongo.spec.js b/packages/server/src/integrations/tests/mongo.spec.js index 1e37d5dd70..ce44617eb1 100644 --- a/packages/server/src/integrations/tests/mongo.spec.js +++ b/packages/server/src/integrations/tests/mongo.spec.js @@ -8,6 +8,13 @@ class TestConfiguration { } } +function disableConsole() { + jest.spyOn(console, 'error'); + console.error.mockImplementation(() => {}); + + return console.error.mockRestore; +} + describe("MongoDB Integration", () => { let config let indexName = "Users" @@ -22,7 +29,8 @@ describe("MongoDB Integration", () => { } const response = await config.integration.create({ index: indexName, - json: body + json: body, + extra: { collection: 'testCollection', actionTypes: 'insertOne'} }) expect(config.integration.client.insertOne).toHaveBeenCalledWith(body) }) @@ -31,10 +39,46 @@ describe("MongoDB Integration", () => { const query = { json: { address: "test" - } + }, + extra: { collection: 'testCollection', actionTypes: 'find'} } const response = await config.integration.read(query) expect(config.integration.client.find).toHaveBeenCalledWith(query.json) expect(response).toEqual(expect.any(Array)) }) + + it("calls the delete method with the correct params", async () => { + const query = { + json: { + id: "test" + }, + extra: { collection: 'testCollection', actionTypes: 'deleteOne'} + } + const response = await config.integration.delete(query) + expect(config.integration.client.deleteOne).toHaveBeenCalledWith(query.json) + }) + + it("calls the update method with the correct params", async () => { + const query = { + json: { + id: "test" + }, + extra: { collection: 'testCollection', actionTypes: 'updateOne'} + } + const response = await config.integration.update(query) + expect(config.integration.client.updateOne).toHaveBeenCalledWith(query.json) + }) + + it("throws an error when an invalid query.extra.actionType is passed for each method", async () => { + const restore = disableConsole() + + const query = { + extra: { collection: 'testCollection', actionTypes: 'deleteOne'} + } + // Weird, need to do an IIFE for jest to recognize that it throws + expect(() => config.integration.read(query)()).toThrow(expect.any(Object)) + + restore() + }) + }) \ No newline at end of file From 9a4146143726dbcf9f1c6317a95a3ee8a0158bd8 Mon Sep 17 00:00:00 2001 From: seoulaja Date: Mon, 26 Jul 2021 06:52:20 +0700 Subject: [PATCH 03/60] README.id.md translation Bahasa Indonesia translation for Budibase README --- i18n/README.id.md | 230 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 i18n/README.id.md diff --git a/i18n/README.id.md b/i18n/README.id.md new file mode 100644 index 0000000000..7f0229f345 --- /dev/null +++ b/i18n/README.id.md @@ -0,0 +1,230 @@ +

+ + Budibase + +

+

+ Budibase +

+ +

+ Membangun, mengotomatisasi dan hosting sendiri aplikasi internal dalam hitungan menit +

+

+ Budibase adalah sebuah platform low-code dengan sumber terbuka, bertujuan untuk membantu para developer dan professional IT, untuk membangun, mengotomatisasi, dan mengirimkan aplikasi internal di infrastruktur sendiri dalam waktu hitungan menit. +

+ +

+ πŸ€– 🎨 πŸš€ +

+ +

+ Budibase design ui +

+ +

+ + GitHub all releases + + + GitHub release (latest by date) + + + Follow @budibase + + Code of conduct + + + +

+ +

+ Mari mulai + Β· + Dokumentasi + Β· + Permintaan Fitur + Β· + Laporkan bug + Β· + Bantuan: Diskusi +

+ +

+## ✨ Fitur-fitur + +- **Membangun dan mengirimkan software nyata.** Tidak seperti platform lain, dengan Budibase Anda membuat dan mengirimkan aplikasi-aplikasi satu halaman. Aplikasi-aplikasi Budibase memiliki kinerja yang matang dan dapat dirancang secara responsif, memberikan pengalaman yang menyenangkan bagi pengguna. + +- **Sumber terbuka dan dapat dikembangkan.** Budibase adalah platform dengan sumber terbuka - dilisensikan sebagai GPL v3. Ini akan membuat Anda yakin bahwa Budibase akan selalu ada. Anda juga dapat berkontribusi terhadap kode Budibase atau melakukan fork dan membuat perubahan sesuka Anda, memberikan pengalaman yang ramah developer. + +- **Muat data atau mulai dari awal.** Budibase menarik data dari berbagai sumber, termasuk MongoDB, CouchDB, PostgreSQL, mySQL, Airtable, S3, DyanmoDB, atau REST API. Dan tidak seperti platform lain, dengan Budibase Anda dapat memulai dari awal dan membuat aplikasi bisnis tanpa sumber data sekalipun. [Permintaan untuk sumber data baru](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas). + +- **Rancang dan bangun aplikasi dengan komponen siap pakai yang kuat.** Budibase tersedia dengan siap pakai dan dirancang dengan indah, komponen-komponen kuat yang dapat anda gunakan layaknya blok penyusun untuk merancang UI Anda. Kami juga menyediakan banyak sekali pilihan-pilihan CSS favorit yang dapat digunakan sesuai dengan kreatifitas yang Anda inginkan. [Permintaan komponen baru [Permintaan untuk komponen baru](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas). + +- **Otomatiskan proses, integrasikan dengan aplikasi lain, dan sambungkan ke webhook.** Menghemat waktu dengan mengotomatisasikan proses dan alur kerja yang masih dikerjakan secara manual. Dari menghubungkan ke webhooks, hingga mengotomatiasi email-email, cukup beritahu Budibase apa yang harus dilakukan dan biarkan dia berkerja untuk Anda. Anda bisa dengan mudah [membuat otomatisasi baru untuk Budibase disini ](https://github.com/Budibase/automations) atau [minta otomatisasi baru](https://github.com/Budibase/budibase/discussions?discussions_q=category%3AIdeas). + +- **Surga bagi Admin.** Budibase dibuat untuk berkembang. Dengan Budibase, Anda dapat menghosting sendiri di infrastruktrur Anda punya dan secara global mengelola para pengguna, orientasi, SMTP, aplikasi-aplikasi, grup-grup, tema, dan masih masih banyak lagi. Anda juga dapat menyediakan para pengguna/grup dengan sebuah aplikasi portal dan menyebarkan pengelolaan pengguna kepada manaajer grup. + +
+ +--- + +
+ +## 🏁 Memulai +Saat ini ada 2 cara untuk memulai Budibase, yaitu: Digital Ocean dan Docker. +

+ +### Memulai Dengan Digital Ocean +Cara paling mudah dan cepat untuk memulai adalah dengan menggunakan Digital Ocean: +1-klik Digital Ocean deploy + + + digital ocean badge + +

+ +### Memulai dengan Docker +Untuk memulai, Anda harus memiliki docker dan docker compose terinstal di mesin anda. +Setelah Anda docker terinstal, prosesnya akan memakan waktu 5 menit, dengan empat langkah ini: + +1. Instal CLI Budibase. + +``` +$ npm i -g @budibase/cli +``` + + +2. Mempersiapkan Budibase (pilih tempat menyimpan Budibase dan port untuk menjalankannya) + +``` +budi hosting --init +``` + + +3. Jalankan Budibase + +``` +budi hosting --start +``` + + +4. Buat pengguna admin Anda + +Masukkan surel dan sandi untuk admin baru. + +Selesai! Anda sekarang siap untuk membangun aplikasi internal yang mumpuni dalam hitungan menit. Untuk informasi tambahan tentang cara memulai dan mempelajari Budibase, kunjungi [dokumentasi](https://docs.budibase.com/getting-started) kami. + +
+ +--- + +
+ +## πŸŽ“ Belajar Budibase + +Dokumentasi Budibase [dapat dilihat disini](https://docs.budibase.com). +
+ +--- + +

+ +## πŸ’¬ Komunitas + +Jika Anda memiliki pertanyaan atau ingin berbicara dengan pengguna Budibase lainnya dan bergabung dengan komunitas kami, silakan kunjungi [Diskusi Github](https://github.com/Budibase/budibase/discussions) + + + +

+ +--- + +
+ +## ❗ Kode etik + +Budibase berdedikasi untuk memberikan pengalaman yang ramah, beragam, dan bebas pelecehan bagi semua orang. Kami mengharapkan semua orang di komunitas Budibase untuk mematuhi [**Kode etik**](https://github.com/Budibase/budibase/blob/HEAD/.github/CODE_OF_CONDUCT.md). Mohon dibac. +
+ +--- + +
+ +## πŸ™Œ Berkontribusi untuk Budibase + +Dari membuka laporan bug hingga membuat pull request: setiap kontribusi dihargai dan disambut. Jika Anda berencana untuk menerapkan fitur baru atau mengubah API, harap buat issue terlebih dahulu. Dengan cara ini kami dapat memastikan pekerjaan Anda tidak sia-sia. + +### Tidak yakin memulai dari mana? +Sebuat tempat yang baik untuk mulai berkontribusi, adalah [Masalah pertama di proyek](https://github.com/Budibase/budibase/projects/22). + +### Bagaimana repositori diatur +Budibase adalah monorepo yang dikelola oleh lerna. Lerna mengelola pembangunan dan penerbitan paket budibase. Pada level tinggi, inilah paket-paket yang membentuk Budibase. + +- [packages/builder](https://github.com/Budibase/budibase/tree/HEAD/packages/builder) - berisi kode untuk aplikasi svelte sisi klien pembangun budibase. + +- [packages/client](https://github.com/Budibase/budibase/tree/HEAD/packages/client) - Modul yang berjalan di browser yang bertanggung jawab untuk membaca definisi JSON dan membuat aplikasi web yang hidup dan bernafas darinya. + +- [packages/server](https://github.com/Budibase/budibase/tree/HEAD/packages/server) - Server Budibase. Aplikasi Koa ini bertanggung jawab untuk melayani JS untuk aplikasi builder dan budibase, serta menyediakan API untuk interaksi dengan database dan sistem file. + +Untuk informasi lebih lanjut, lihat [CONTRIBUTING.md](https://github.com/Budibase/budibase/blob/HEAD/.github/CONTRIBUTING.md) +

+ +--- + +

+ +## πŸ“ Lisensi + +Budibase adalah sumber terbuka, dilisensikan sebagai [GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html). Pustaka klien dan komponen dilisensikan sebagai [MPL](https://directory.fsf.org/wiki/License:MPL-2.0) - sehingga aplikasi yang Anda buat dapat dilisensikan sesuka Anda. +

+ +--- + + +
+ +## ⭐ Stargazers over time + +[![Stargazers over time](https://starchart.cc/Budibase/budibase.svg)](https://starchart.cc/Budibase/budibase) + +Jika Anda mengalami masalah di antara pembaruan, silakan gunakan panduan [disini](https://github.com/Budibase/budibase/blob/HEAD/.github/CONTRIBUTING.md#troubleshooting) untuk membersihkan environment Anda. + +
+ +--- + +

+ +## Kontributor ✨ + +Terima kasih untuk orang-orang hebat ini ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + + + + + + + + + + + + + +

Martin McKeaveney

πŸ’» πŸ“– ⚠️ πŸš‡

Michael Drury

πŸ“– πŸ’» ⚠️ πŸš‡

Andrew Kingston

πŸ“– πŸ’» ⚠️ 🎨

Michael Shanks

πŸ“– πŸ’» ⚠️

Kevin Γ…berg Kultalahti

πŸ“– πŸ’» ⚠️

Joe

πŸ“– πŸ’» πŸ–‹ 🎨

Conor_Mack

πŸ’» ⚠️

pngwn

πŸ’» ⚠️

HugoLd

πŸ’»

victoriasloan

πŸ’»

yashank09

πŸ’»

SOVLOOKUP

πŸ’»
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! From 07553b99370eb412f5288f3dfea701325f5194cc Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 26 Jul 2021 13:58:18 +0200 Subject: [PATCH 04/60] clear form action - draft --- .../EventsEditor/actions/index.js | 3 ++ packages/client/src/constants.js | 1 + packages/client/src/utils/buttonActions.js | 9 ++++++ .../src/forms/InnerForm.svelte | 28 +++++++++++++++++++ 4 files changed, 41 insertions(+) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js index b8114461f9..2c9023714f 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js @@ -42,4 +42,7 @@ export default [ name: "Log Out", component: LogOut, }, + { + name: "Clear Form", + }, ] diff --git a/packages/client/src/constants.js b/packages/client/src/constants.js index e0595c0ce9..049b16801b 100644 --- a/packages/client/src/constants.js +++ b/packages/client/src/constants.js @@ -6,6 +6,7 @@ export const ActionTypes = { ValidateForm: "ValidateForm", RefreshDatasource: "RefreshDatasource", SetDataProviderQuery: "SetDataProviderQuery", + ClearForm: "ClearForm" } export const ApiVersion = "1" diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index af4826a1c4..d7707bfb11 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -77,6 +77,14 @@ const refreshDatasourceHandler = async (action, context) => { ) } +const clearFormHandler = async (action, context) => { + return await executeActionHandler( + context, + action.parameters.componentId, + ActionTypes.ClearForm + ) +} + const handlerMap = { ["Save Row"]: saveRowHandler, ["Delete Row"]: deleteRowHandler, @@ -85,6 +93,7 @@ const handlerMap = { ["Trigger Automation"]: triggerAutomationHandler, ["Validate Form"]: validateFormHandler, ["Refresh Datasource"]: refreshDatasourceHandler, + ["Clear Form"]: clearFormHandler } const confirmTextMap = { diff --git a/packages/standard-components/src/forms/InnerForm.svelte b/packages/standard-components/src/forms/InnerForm.svelte index 3a63b63bdc..55e14217e1 100644 --- a/packages/standard-components/src/forms/InnerForm.svelte +++ b/packages/standard-components/src/forms/InnerForm.svelte @@ -64,6 +64,13 @@ }) return get(formState).valid }, + clear: () => { + const fields = Object.keys(fieldMap) + fields.forEach(field => { + const { fieldApi } = fieldMap[field] + fieldApi.clearValue(); + }) + } } // Provide both form API and state to children @@ -72,6 +79,7 @@ // Action context to pass to children const actions = [ { type: ActionTypes.ValidateForm, callback: formApi.validate }, + { type: ActionTypes.ClearForm, callback: formApi.clear }, ] // Creates an API for a specific field @@ -108,8 +116,28 @@ return !newError } + + const clearValue = () => { + const { fieldState } = fieldMap[field] + fieldState.update(state => { + state.value = defaultValue + state.error = null + return state + }) + + formState.update(state => { + state.values = { ...state.values, [field]: defaultValue } + delete state.errors[field] + state.valid = Object.keys(state.errors).length === 0 + return state + }) + + return true + } + return { setValue, + clearValue, validate: () => { const { fieldState } = fieldMap[field] setValue(get(fieldState).value, true) From 3dbafac80647298fb375b574353f867b42d347ae Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 26 Jul 2021 15:05:22 +0200 Subject: [PATCH 05/60] clear form action - adjust manifest and add settings form --- .../EventsEditor/actions/ClearForm.svelte | 35 +++++++++++++++++++ .../EventsEditor/actions/index.js | 2 ++ packages/standard-components/manifest.json | 3 +- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ClearForm.svelte diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ClearForm.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ClearForm.svelte new file mode 100644 index 0000000000..74eae6283c --- /dev/null +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ClearForm.svelte @@ -0,0 +1,35 @@ + + +
+ + ($touched.name = true)} + on:change={() => dirty = true} + label="Name" + /> + + diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 6c229c1980..02260e19ec 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -14,6 +14,7 @@ Body, } from "@budibase/bbui" import CreateAppModal from "components/start/CreateAppModal.svelte" + import UpdateAppModal from "components/start/UpdateAppModal.svelte" import api, { del } from "builderStore/api" import analytics from "analytics" import { onMount } from "svelte" @@ -30,6 +31,7 @@ let template let selectedApp let creationModal + let updatingModal let deletionModal let unpublishModal let creatingApp = false @@ -164,6 +166,11 @@ selectedApp = null } + const updateApp = async app => { + selectedApp = app + updatingModal.show() + } + const releaseLock = async app => { try { const response = await del(`/api/dev/${app.devId}/lock`) @@ -236,6 +243,7 @@ {editApp} {exportApp} {deleteApp} + {updateApp} /> {/each}
@@ -289,6 +297,12 @@ Are you sure you want to unpublish the app {selectedApp?.name}? + + +