perak / kitchen-site

Meteor Kitchen site source code
MIT License
282 stars 38 forks source link

Download and local build fails #126

Open xauxatz opened 9 years ago

xauxatz commented 9 years ago

I get the following error in the browser: WebSocket error. Type: "error". WebSocket connection closed. Code: 1006, reason: "".

In the command prompt I get this error: * Meteor Kitchen v0.9.46 * Meteor Application Generator - www.meteorkitchen.com Copyright (c) Petar Korponai─ç petar.korponaic@gmail.com

Downloading input file...

Error downloading file.

Last I did it (last week) it worked well.

perak commented 9 years ago

@xauxatz sorry for late answer: please give me more info how to reproduce this. Are you using meteor-kitchen web gui and trying to build app locally? If I can see well you are using Windows?

can you download input file "manually" with this command:

curl -s -S -k -o the_file.json http://correct_url_here

Also try upgrading to latest version 0.9.48

perak commented 9 years ago

BTW, is curl properly installed and listed in your system path? (would curl execute if you type curl from any directory in command prompt?)

xauxatz commented 9 years ago

Hi Petar

Your proposed command "curl -s -S -k ...." below actually works fine. So curl is installed as well. I'm using the web gui and building the app locally. It has worked fine for many days then suddenly stopped working. I'm on Windows, yes.

Best regards, Claus

PS. Thanks for all the good work on Meteor Kitchen!

On 18-Aug-15 06:08, Petar Korponaić wrote:

@xauxatz https://github.com/xauxatz sorry for late answer: please give me more info how to reproduce this. Are you using meteor-kitchen web gui and trying to build app locally? If I can see well you are using Windows?

can you download input file "manually" with this command:

|curl -s -S -k -o the_file.json http://correct_url_here |

Also try upgrading to latest version 0.9.48

— Reply to this email directly or view it on GitHub https://github.com/perak/kitchen-site/issues/126#issuecomment-132066014.

perak commented 9 years ago

Hi Claus,

I cannot reproduce this issue, I just tried to build app locally under windows and it worked fine (I attached screenshot).

untitled

About your first problem (error code 1006) something is interrupting websocket connection between your browser and "meteorfarm.com" (the server which actually executes build - console output from that server should be sent to your browser via websocket and shown).

For me, it looks like you got internet connection problems, but... let's try to find out is it really problem at your side or at "kitchen" side - I wish to catch and fix the bug (if this is a bug).

xauxatz commented 9 years ago

Hi Petar

I've got another problem now that actually seems like an error in Meteor Kitchen.

If I create a new example based on the Dataview example, builds it and downloads it - I get the following in the JS file containing the dataview:

"click #dataview-export-default":function(e, t) { e.preventDefault(); CustomersViewExport(this.,"csv"); },

"click #dataview-export-csv":function(e, t) { e.preventDefault(); CustomersViewExport(this.,"csv"); },

"click #dataview-export-tsv":function(e, t) { e.preventDefault(); CustomersViewExport(this.,"tsv"); },

"click #dataview-export-json":function(e, t) { e.preventDefault(); CustomersViewExport(this.,"json"); }

I haven't modified the example in any way, just auto-generated from the system... I would like to get a fix to this since I am using the dataview in my app. Best regards, Claus

On 18-Aug-15 22:49, Petar Korponaić wrote:

Hi Claus,

I cannot reproduce this issue, I just tried to build app locally under windows and it worked fine (I attached screenshot).

untitled https://cloud.githubusercontent.com/assets/5630814/9342121/4dfd41ba-45fa-11e5-9b8e-bcfc90794912.png

*

At server side (kitchen.com) everything is fine since you can
normally download the file.

*

Your curl is working (at least by directly entering command -
kitchen executes curl with the same arguments).

*

So, something is interrupting your download...

About your first problem (error code 1006) something is interrupting websocket connection between your browser and "meteorfarm.com" (the server which actually executes build - console output from that server should be sent to your browser via websocket and shown).

For me, it looks like you got internet connection problems, but... let's try to find out is it really problem at your side or at "kitchen" side - I wish to catch and fix the bug (if this is a bug).

— Reply to this email directly or view it on GitHub https://github.com/perak/kitchen-site/issues/126#issuecomment-132346640.

Claus Skaaning Adm. direktør / CEO

Sales on Tap http://www.sales-on-tap.com Th. Staunings Vej 48 http://maps.google.com/maps?q=Th.+Staunings+Vej+48%2CAalborg+DK-9210%2CDenmark&hl=en Aalborg DK-9210 Denmark Mobile: +45 20690771 Email: cs@sales-on-tap.com mailto:cs@sales-on-tap.com Professional Profile http://dk.linkedin.com/pub/claus-skaaning/0/53/503

xauxatz commented 9 years ago

Hi Petar

I hope you received my other question which indicates an error in Meteor Kitchen.

Also, in my current app (Contacts2) I do not seem to get any of my collections published even though Meteor Kitchen in principle should do this. How can this be?

I've got a collection called "contactpersonsresults" - the file publish\contactpersonsresults.js is empty.

Best regards, Claus

On 18-Aug-15 22:49, Petar Korponaić wrote:

Hi Claus,

I cannot reproduce this issue, I just tried to build app locally under windows and it worked fine (I attached screenshot).

untitled https://cloud.githubusercontent.com/assets/5630814/9342121/4dfd41ba-45fa-11e5-9b8e-bcfc90794912.png

*

At server side (kitchen.com) everything is fine since you can
normally download the file.

*

Your curl is working (at least by directly entering command -
kitchen executes curl with the same arguments).

*

So, something is interrupting your download...

About your first problem (error code 1006) something is interrupting websocket connection between your browser and "meteorfarm.com" (the server which actually executes build - console output from that server should be sent to your browser via websocket and shown).

For me, it looks like you got internet connection problems, but... let's try to find out is it really problem at your side or at "kitchen" side - I wish to catch and fix the bug (if this is a bug).

— Reply to this email directly or view it on GitHub https://github.com/perak/kitchen-site/issues/126#issuecomment-132346640.

Claus Skaaning Adm. direktør / CEO

Sales on Tap http://www.sales-on-tap.com Th. Staunings Vej 48 http://maps.google.com/maps?q=Th.+Staunings+Vej+48%2CAalborg+DK-9210%2CDenmark&hl=en Aalborg DK-9210 Denmark Mobile: +45 20690771 Email: cs@sales-on-tap.com mailto:cs@sales-on-tap.com Professional Profile http://dk.linkedin.com/pub/claus-skaaning/0/53/503

perak commented 9 years ago

Hi Claus,

Strange things happens at your side! :D

xauxatz commented 9 years ago

Hi Petar

It happens in fact also with the input files provided for the public examples, such as the one attached.

I've been using v.0.9.46 but now I upgraded to 0.9.48.

That fixed the problem with the missing publish - and.... it also seems to fix the other problem with the missing collection names.

But now, when I build & download in the Meteor Kitchen GUI, I get all the errors below. Anything I can do about those?

Are they related to the use of the jaredmartin:future package?

Executing: download_js_html /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:278 throw(ex); ^ Error: ENOSPC, mkdir '/tmp/.tmpibucgu' at Object.Future.wait (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15) at Object.wrapper as mkdir at Object.files.mkdir_p (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/files.js:403:11) at Object.files.extractTarGz (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/files.js:676:9) at Object.exports._extractAndConvert (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/tropohouse.js:49:9) at [object Object]..extend._downloadBuildToTempDir (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/tropohouse.js:295:20) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/tropohouse.js:462:37 at Array.forEach (native) at Function..each._.forEach (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/tropohouse.js:460:11 at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:352:18 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:345:34 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:343:23 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at Object.enterJob (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:317:26) at Object.download (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/tropohouse.js:419:20) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/tropohouse.js:553:22 at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:352:18 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:345:34 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:343:23 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at Object.enterJob (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:317:26) at [object Object]..extend.downloadPackagesMissingFromMap (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/tropohouse.js:550:20) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/main.js:433:30 at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/catalog.js:100:5 at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:264:13 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:257:29 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:255:18 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:246:23 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at Object.capture (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:245:19) at Object.catalog.runAndRetryWithRefreshIfHelpful (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/catalog.js:99:31) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/main.js:432:17 at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:264:13 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:257:29 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:255:18 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/buildmessage.js:246:23 at [object Object]..extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14) at Object.capture (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:245:19) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x8664/tools/main.js:430:33 at [object Object]..extend.withProgressDisplayVisible (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/console.js:612:14) at springboard (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/main.js:429:11) at /root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/main.js:1023:5

Best regards, Claus

On 25-Aug-15 21:14, Petar Korponaić wrote:

Hi Claus,

Strange things happens at your side! :D

*

Are you using latest meteor kitchen (v0.9.48) ? Input file
structure was significantly changed after v0.9.47

*

Can you share your input file with me (even privately via
e-mail?), I am suspicious that there is bug in your input file (or
if there is bug in the "kitchen", this will help me reproduce issue).

— Reply to this email directly or view it on GitHub https://github.com/perak/kitchen-site/issues/126#issuecomment-134705524.

{ "application": { "title": "Example application",

    "theme": "bootswatch-paper",

    "on_user_created_code": "Customers.insert({ name: 'Chuck Norris', email: 'internet@chucknorris.com', ownerId: user._id });",

    "collections": [
        {
            "name": "customers",
            "fields": [
                { "name": "name", "title": "Name", "required": true, "exportable": true },
                { "name": "phone", "title": "Phone", "default": "-", "exportable": true },
                { "name": "email", "title": "E-mail", "type": "email", "exportable": true },
                { "name": "note", "title": "Note", "input": "textarea", "exportable": true, "show_in_dataview": false },
                { "name": "totalAmount", "title": "Invoiced", "type": "float", "show_in_insert_form": false, "show_in_update_form": false, "exportable": true }
            ],
            "owner_field": "ownerId",

            "roles_allowed_to_read": ["owner"],
            "roles_allowed_to_update": ["owner"],
            "roles_allowed_to_delete": ["owner"]
        },

        {
            "name": "invoices",
            "fields": [
                { "name": "invoiceNumber", "title": "Invoice number", "default": "{{nextInvoiceNumber}}", "required": true, "exportable": true },
                { "name": "date", "title": "Invoice date", "type": "date", "format": "MM-DD-YYYY", "input": "datepicker", "default": "today", "required": true, "exportable": true },

                {
                    "name": "customerId",
                    "title": "Customer",
                    "required": true,
                    "input": "select",
                    "lookup_query_name": "customer_list",
                    "lookup_field": "name",
                    "lookup_key": "_id",
                    "show_in_dataview": false,
                    "show_in_read_only_form": false,
                    "exportable": false,

                    "join_collection": "customers",
                    "join_fields": ["name"],
                    "join_container": "customer"
                },

                {
                    "name": "customer.name",
                    "title": "Customer",
                    "show_in_insert_form": false,
                    "show_in_update_form": false,
                    "exportable": true
                },

                {
                    "name": "totalAmount",
                    "title": "Total",
                    "type": "float",
                    "show_in_insert_form": false,
                    "show_in_update_form": false,
                    "exportable": true
                }
            ],

            "owner_field": "ownerId",
            "roles_allowed_to_read": ["owner"],
            "roles_allowed_to_update": ["owner"],
            "roles_allowed_to_delete": ["owner"],

            "before_insert_code": "if(!doc.totalAmount) doc.totalAmount = 0;"
        },

        {
            "name": "invoice_items",
            "fields": [
                { "name": "description", "title": "Description", "required": true, "exportable": true },
                { "name": "quantity", "title": "Quantity", "type": "float", "default": 1, "required": true, "exportable": true },
                { "name": "price", "title": "Price", "type": "float", "default": 0, "required": true, "exportable": true },
                { "name": "amount", "title": "Amount", "type": "float", "show_in_insert_form": false, "show_in_update_form": false, "exportable": true }
            ],
            "owner_field": "ownerId",

            "roles_allowed_to_read": ["owner"],
            "roles_allowed_to_update": ["owner"],
            "roles_allowed_to_delete": ["owner"],

            "before_insert_code": "doc.amount = doc.quantity * doc.price;",

            "before_update_code": "if(!modifier.$set) return; var quantity = modifier.$set.quantity || doc.quantity; var price = modifier.$set.price || doc.price; modifier.$set.amount = quantity * price;",

            "after_insert_code": "var sum = 0; InvoiceItems.find({ invoiceId: doc.invoiceId }).map(function(item) { sum += item.amount; }); Invoices.update({ _id: doc.invoiceId }, { $set: { totalAmount: sum }});",

            "after_update_code": "var sum = 0; InvoiceItems.find({ invoiceId: doc.invoiceId }).map(function(item) { sum += item.amount; }); Invoices.update({ _id: doc.invoiceId }, { $set: { totalAmount: sum }});",

            "after_remove_code": "var sum = 0; InvoiceItems.find({ invoiceId: doc.invoiceId }).map(function(item) { sum += item.amount; }); Invoices.update({ _id: doc.invoiceId }, { $set: { totalAmount: sum }});"
        }
    ],

    "queries": [
        {
            "name": "customer_list",
            "collection": "customers",
            "filter": {},
            "options": {
                "transform": "function(doc) { var sum = 0; Invoices.find({ customerId: doc._id }).map(function(item) { if(item.totalAmount) sum += item.totalAmount; }); doc.totalAmount = sum; return doc; }",
                "sort": ["name"]
            },
            "related_queries": [
                { "name": "invoice_list" }
            ]
        },
        {
            "name": "customers_empty",
            "collection": "customers",
            "filter": {"_id": null},
            "find_one": true
        },
        {
            "name": "customer_details",
            "collection": "customers",
            "find_one": true,
            "filter": { "_id": ":customerId" },
            "options": {
                "transform": "function(doc) { var sum = 0; Invoices.find({ customerId: doc._id }).map(function(item) { sum += item.totalAmount; }); doc.totalAmount = sum; return doc; }"
            },
            "related_queries": [
                { "name": "invoice_list" }
            ]
        },
        {
            "name": "invoice_list",
            "collection": "invoices",
            "filter": {},
            "options": {
                "sort": [[ "invoiceNumber", "desc"]]
            }
        },
        {
            "name": "invoices_empty",
            "collection": "invoices",
            "filter": { "_id": null },
            "options": {},
            "find_one": true,
            "related_queries": [
                { "name": "invoice_list" }
            ]
        },
        {
            "name": "invoice_details",
            "collection": "invoices",
            "filter": { "_id": ":invoiceId" },
            "find_one": true
        },
        {
            "name": "invoice_items",
            "collection": "invoice_items",
            "filter": { "invoiceId": ":invoiceId" }
        },
        {
            "name": "invoice_items_empty",
            "collection": "invoice_items",
            "filter": { "_id": null },
            "find_one": true
        },
        {
            "name": "invoice_item",
            "collection": "invoice_items",
            "filter": { "_id": ":itemId" },
            "find_one": true
        },
        {
            "name": "current_user_data",
            "collection": "users",
            "filter": { "_id": "Meteor.userId()" },
            "find_one": true
        }
    ],

    "public_zone": {
        "pages": [
            { 
                "name": "home_public", 
                "title": "", 
                "components": [
                    {
                        "name": "home_jumbotron",
                        "title": "Example application",
                        "type": "jumbotron",
                        "text": "<b>This <a href=\"https://www.meteor.com\" target=\"_blank\">Meteor</a> application is made with <a href=\"http://www.meteorkitchen.com\" target=\"_blank\">meteor-kitchen</a> without manual coding.</b><br />It shows how to work with DataViews, Forms with dates and lookup fields, master-detail relations etc.<br />Source code (input file for generator) is <a href=\"https://github.com/perak/kitchen-examples/tree/master/example-invoices\" target=\"_blank\">here</a>.",
                        "button_title": "Continue &raquo;",
                        "button_route": "login"
                    }
                ]
            },
            { "name": "login", "template": "login" },
            { "name": "register", "template": "register" },
            { "name": "forgot_password", "template": "forgot_password" },
            { "name": "reset_password", "template": "reset_password", "route_params": ["resetPasswordToken"] }
        ],

        "components": [
            {
                "name": "left_menu",
                "type": "menu",
                "class": "nav navbar-nav",
                "dest_selector": "#menu",
                "items": [
                    { "title": "Home", "route": "home_public" }
                ]
            },

            {
                "name": "right_menu",
                "type": "menu",
                "class": "nav navbar-nav navbar-right",
                "dest_selector": "#menu",
                "items": [
                    { "title": "Register", "route": "register" },
                    { "title": "Login", "route": "login" }
                ]
            }
        ]
    },

    "private_zone": {
        "pages": [
            {
                "name": "home_private",
                "title": "Welcome {{userFullName}}!",
                "text": "Place for dashboard here..."
            },

            {
                "name": "customers",
                "components": [
                    {
                        "name": "view",
                        "type": "data_view",
                        "title": "Customers",
                        "text_if_empty": "No customers :(",
                        "query_name": "customer_list",
                        "insert_route": "customers.insert",
                        "edit_route": "customers.edit",
                        "edit_route_params": [
                            { "name": "customerId", "value": "this._id" }
                        ],
                        "details_route": "customers.details",
                        "details_route_params": [
                            { "name": "customerId", "value": "this._id" }
                        ]
                    }
                ],

                "pages": [
                    {
                        "name": "insert",
                        "components": [
                            {
                                "name": "insert_form",
                                "type": "form",
                                "mode": "insert",
                                "title": "New customer",
                                "query_name": "customers_empty",
                                "submit_route": "customers",
                                "cancel_route": "customers"
                            }
                        ]
                    },
                    {
                        "name": "details",
                        "route_params": ["customerId"],
                        "components": [
                            {
                                "name": "details_form",
                                "type": "form",
                                "mode": "read_only",
                                "title": "Details",
                                "query_name": "customer_details",
                                "close_route": "customers",
                                "back_route": "customers"
                            }
                        ]
                    },

                    {
                        "name": "edit",
                        "route_params": ["customerId"],
                        "components": [
                            {
                                "name": "edit_form",
                                "type": "form",
                                "mode": "update",
                                "title": "Edit customer",
                                "submit_route": "customers",
                                "cancel_route": "customers",
                                "query_name": "customer_details"
                            }
                        ]
                    }
                ]
            },

            {
                "name": "invoices",
                "components": [
                    {
                        "name": "view",
                        "type": "data_view",
                        "title": "Invoices",
                        "text_if_empty": "No invoices :(",
                        "query_name": "invoice_list",
                        "insert_route": "invoices.insert",
                        "edit_route": "invoices.edit",
                        "edit_route_params": [
                            { "name": "invoiceId", "value": "this._id" }
                        ],
                        "details_route": "invoices.details",
                        "details_route_params": [
                            { "name": "invoiceId", "value": "this._id" }
                        ]
                    }
                ],

                "pages": [
                    {
                        "name": "insert",
                        "components": [
                            {
                                "name": "insert_form",
                                "type": "form",
                                "mode": "insert",
                                "title": "New invoice",

                                "query_name": "invoices_empty",

                                "helpers_code": "'nextInvoiceNumber': function() { var max = 0; var invoiceNumbers = Invoices.find({}, { fields: { invoiceNumber: 1 }}).fetch(); _.each(invoiceNumbers, function(doc) { var intNum = parseInt(doc.invoiceNumber); if(!isNaN(intNum) && intNum > max) max = intNum; }); return max + 1; }",

                                "submit_route": "invoices.details",
                                "submit_route_params": [
                                    { "name": "invoiceId", "value": "newId"}
                                ],
                                "cancel_route": "invoices"
                            }
                        ]
                    },
                    {
                        "name": "details",
                        "template": "page_subcontent_tabnav",
                        "route_params": ["invoiceId"],
                        "components": [
                            {
                                "name": "details_form",
                                "type": "form",
                                "mode": "read_only",
                                "title": "Invoice #{{invoice_details.invoiceNumber}}",
                                "layout": "horizontal",
                                "query_name": "invoice_details",
                                "back_route": "invoices"
                            }

                        ],

                        "force_yield_subpages": true,
                        "pages": [
                            {
                                "name": "items",
                                "components": [
                                    {
                                        "name": "view",
                                        "type": "data_view",
                                        "text_if_empty": "No items",
                                        "query_name": "invoice_items",
                                        "insert_button_title": "Add item",
                                        "insert_route": "invoices.details.insert",
                                        "insert_route_params": [
                                            { "name": "invoiceId", "value": "this.params.invoiceId" }
                                        ],
                                        "edit_route": "invoices.details.edit",
                                        "edit_route_params": [
                                            { "name": "invoiceId", "value": "UI._parentData(1).params.invoiceId" },
                                            { "name": "itemId", "value": "this._id" }
                                        ]
                                    }
                                ]
                            },

                            {
                                "name": "insert",
                                "components": [                                     
                                    {
                                        "name": "insert_form",
                                        "type": "form",
                                        "mode": "insert",
                                        "title": "Add item",
                                        "query_name": "invoice_items_empty",

                                        "hidden_fields": [
                                            { "name": "invoiceId", "value": "this.params.invoiceId" }
                                        ],

                                        "submit_route": "invoices.details",
                                        "submit_route_params": [
                                            { "name": "invoiceId", "value": "this.params.invoiceId"}
                                        ],
                                        "cancel_route": "invoices.details",
                                        "cancel_route_params": [
                                            { "name": "invoiceId", "value": "this.params.invoiceId"}
                                        ]
                                    }
                                ]
                            },

                            {
                                "name": "edit",
                                "route_params": ["itemId"],
                                "components": [
                                    {
                                        "name": "edit_form",
                                        "type": "form",
                                        "mode": "update",
                                        "title": "Edit item",
                                        "query_name": "invoice_item",
                                        "submit_route": "invoices.details",
                                        "submit_route_params": [
                                            { "name": "invoiceId", "value": "this.params.invoiceId"}
                                        ],
                                        "cancel_route": "invoices.details",
                                        "cancel_route_params": [
                                            { "name": "invoiceId", "value": "this.params.invoiceId"}
                                        ]
                                    }
                                ]
                            }
                        ]
                    },

                    {
                        "name": "edit",
                        "route_params": ["invoiceId"],
                        "components": [
                            {
                                "name": "edit_form",
                                "type": "form",
                                "mode": "update",
                                "title": "Edit invoice",
                                "submit_route": "invoices",
                                "cancel_route": "invoices",
                                "query_name": "invoice_details"
                            }
                        ]
                    }
                ]
            },

            {
                "name": "user_settings",
                "pages": [
                    {
                        "name": "profile",
                        "components": [
                            {
                                "name": "edit_form",
                                "type": "form",
                                "mode": "update",
                                "title": "Edit your profile",
                                "submit_route": "user_settings.profile",
                                "query_name": "current_user_data",
                                "fields": [
                                    { "name": "profile.name", "title": "Name", "required": true },
                                    { "name": "profile.email", "title": "E-mail", "type": "email", "required": true },
                                    { "name": "profile.facebook", "title": "Facebook URL" },
                                    { "name": "profile.google", "title": "Google+ URL" },
                                    { "name": "profile.twitter", "title": "Twitter ID" },
                                    { "name": "profile.website", "title": "Website URL" }
                                ]
                            }
                        ]
                    },

                    { "name": "change_pass", "template": "change_pass" }
                ],

                "components": [
                    {
                        "name": "side_menu",
                        "type": "menu",
                        "class": "nav nav-stacked nav-pills",
                        "items": [
                            { "title": "Profile", "route": "user_settings.profile" },
                            { "title": "Change password", "route": "user_settings.change_pass" }
                        ]
                    }
                ]
            },

            { "name": "logout", "template": "logout" }
        ],

        "components": [
            {
                "name": "left_menu",
                "type": "menu",
                "class": "nav navbar-nav",
                "dest_selector": "#menu",
                "items": [
                    { "title": "Home", "route": "home_private" },
                    { "title": "Invoices", "route": "invoices" },
                    { "title": "Customers", "route": "customers" }
                ]
            },
            {
                "name": "right_menu",
                "type": "menu",
                "class": "nav navbar-nav navbar-right",
                "dest_selector": "#menu",
                "items": [
                    { 
                        "title": "{{userEmail}}",
                        "items": [
                            { "title": "Settings", "route": "user_settings" },
                            { "title": "Logout", "route": "logout" }
                        ]
                    }
                ]
            }
        ]
    }
}

}

xauxatz commented 9 years ago

Hi Petar

I managed to get all this working and have been busy building my app.

However, there is something I cannot understand.

I have a field in a dataview and I define a helper for this field (makeLink) - to turn it into a link.

Where do I define the accompanying helper code in the kitchen GUI? There seems to be no place for this.

If I define the helper code in the dataview itself, then it is not possible to access it from the field...

Best regards, Claus

On 26-Aug-15 09:01, Claus Skaaning wrote:

Hi Petar

Here is the file causing the errors in my previous email with fibers, etc.

Best regards, Claus

On 25-Aug-15 21:14, Petar Korponaić wrote:

Hi Claus,

Strange things happens at your side! :D

*

Are you using latest meteor kitchen (v0.9.48) ? Input file
structure was significantly changed after v0.9.47

*

Can you share your input file with me (even privately via
e-mail?), I am suspicious that there is bug in your input file
(or if there is bug in the "kitchen", this will help me reproduce
issue).

— Reply to this email directly or view it on GitHub https://github.com/perak/kitchen-site/issues/126#issuecomment-134705524.

Claus Skaaning Adm. direktør / CEO

Sales on Tap http://www.sales-on-tap.com Th. Staunings Vej 48 http://maps.google.com/maps?q=Th.+Staunings+Vej+48%2CAalborg+DK-9210%2CDenmark&hl=en Aalborg DK-9210 Denmark Mobile: +45 20690771 Email: cs@sales-on-tap.com mailto:cs@sales-on-tap.com Professional Profile http://dk.linkedin.com/pub/claus-skaaning/0/53/503

perak commented 9 years ago

Hi @xauxatz

Unfortunately, currently you cannot do it from GUI nor from CLI. The only way is to create external file with helpers and add it to "copy_files" array (but that doesn't work in GUI).

Other guy asked the same thing today (so, today is "helpers day" :)

Please see this issue: https://github.com/perak/kitchen-site/issues/129