Skip to content

Commit

Permalink
ide: bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erichanson committed Apr 24, 2019
1 parent 7833b26 commit 8d4c9ca
Show file tree
Hide file tree
Showing 6 changed files with 1,093 additions and 1 deletion.
1 change: 1 addition & 0 deletions bundles-available/org.aquameta.core.ide/blob.csv
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@
\\x99ff0ab28b530a1176b4ba205e4fcd4db92d6cba7cc02055159dff0bafb7d000 <div id="{{= id }}" class="{{= name }}">\n <h2>New Row</h2>\n <hr/>\n \n \n\n <h3>User Interface</h3>\n\n <div class="ui labeled icon menu new_row_buttons">\n <a class="item" id="widget">\n <i class="object ungroup outline icon"></i>\n Widget\n </a>\n <a class="item" id="dependency_js">\n <i class="terminal icon"></i>\n Javascript Dependency\n </a>\n </div>\n \n \n \n <h3>HTTP Resource</h3>\n\n <div class="ui labeled icon menu new_row_buttons">\n <a class="item" id="template">\n <i class="file code outline icon"></i>\n Template\n </a>\n <a class="item" id="resource">\n <i class="file outline icon"></i>\n Text Resource\n </a>\n <a class="item" id="resource_binary">\n <i class="image icon"></i>\n Binary Resource\n </a>\n \n </div>\n \n \n \n <h3>Database</h3>\n\n <div class="ui labeled icon menu new_row_buttons">\n <a class="item" id="sql">\n <i class="sign-in alternate icon"></i>\n SQL File\n </a>\n <!--\n\n <a class="item" id="table">\n <i class="table icon"></i>\n Table\n </a>\n <a class="item" id="view">\n <i class="table icon"></i>\n View\n </a>\n <a class="item" id="function">\n <i class="arrow circle right icon"></i>\n Function\n </a>\n <a class="item" id="fdw">\n <i class="table icon"></i>\n Foreign Data Wrapper\n </a>\n-->\n </div>\n \n \n \n <h3>Other</h3>\n \n <div class='relation_selector'>\n <select class='schema ui dropdown'>\n <option value="">Schema</option>\n </select>\n \n <select class='relation ui dropdown'>\n <option value="">Relation</option>\n </select>\n \n <button class="create ui right labeled icon button">\n <i class="right arrow icon"></i>\n Next\n </button>\n </div>\n\n \n \n</div>
\\x9a5ea6ccd4dc13823617991b0dda4e3070a1cfd6b7d773ea8809175c1ee118b3 /upload
\\x9a705e050336f01cf9c1f26b1a12e14718e1fba583e8035031a84025c696a586 <div id="{{= id }}" class="{{= name }}">\n {{= status.toString() }}\n <div class='close'>\n x\n </div>\n</div>
\\x9aedb8719132a7f07187bf541bf81d42bdb084d73d284c95ecd5955d6142f413 var w = $("#"+id);\n\n// setup label\nvar schema_name = change.get('row_id').pk_column_id.relation_id.schema_id.name;\nvar relation_name = change.get('row_id').pk_column_id.relation_id.name;\nvar pk_column_name = change.get('row_id').pk_column_id.name;\nvar pk_value = change.get('row_id').pk_value;\nvar change_type = change.get('change_type');\nvar row_exists = change.get('row_exists');\n\n\n// fire off text_identifier\nendpoint.schema(schema_name).relation(relation_name).row(pk_column_name, pk_value).then(function(real_row) {\n\tw.find('.text_id').html(widget('semantics/text_identifier', real_row));\n w.find('.text_id').click(function() {\n w.trigger('bundle_row_open', { row_id: change.get('row_id'), row: real_row });\n });\n}).catch(function(e) {\n\tw.find('.text_id').html(schema_name+'.'+relation_name+'.'+pk_value);\n});\n\n\n\n/*******************************************************************************\n* stage setup\n*******************************************************************************/\n\n// staged\nif (change.get('staged')) {\n w.find('div.staged').show();\n}\n// not staged\nelse if (change.get('staged') === false) {\n w.find('div.unstaged').show();\n}\n\n// tracked\nif (change.get('change_type') == 'tracked') {\n w.find('button.untrack').show();\n}\n// null means modified fields -- can be partially staged, so we show the field staging section\nelse if (change.get('staged') == null && change.get('change_type') == 'modified') {\n var offstage_field_changes = change.get('offstage_field_changes');\n var stage_field_changes = change.get('stage_field_changes');\n \n w.find('.unstaged_fields').show().html(widget('ide:stage_dialog_unstaged_fields', {\n offstage_field_changes: change.get('offstage_field_changes'),\n offstage_field_changes_old_vals: change.get('offstage_field_changes_old_vals'),\n offstage_field_changes_new_vals: change.get('offstage_field_changes_new_vals'),\n bundle: bundle\n }));\n\n w.find('.staged_fields').show().html(widget('ide:stage_dialog_staged_fields', {\n stage_field_changes: change.get('stage_field_changes'),\n stage_field_changes_old_vals: change.get('stage_field_changes_old_vals'),\n stage_field_changes_new_vals: change.get('stage_field_changes_new_vals'),\n bundle: bundle\n }));\n\n // console.log('changed fields: ', offstage_field_changes, stage_field_changes);\n}\n\n// change_type icons\nswitch (change_type) {\n case 'added':\n\t w.find('.added').show();\n break;\n case 'deleted':\n\t w.find('.deleted').show();\n break;\n case 'modified':\n\t w.find('.modified').show();\n break;\n case 'tracked':\n\t w.find('.tracked').show();\n break;\n default:\n console.log('UNKNOWN CHANGE TYPE: '+change.get('change_type'));\n break;\n}\n\nif (!change.get('row_exists') && change_type != 'tracked') {\n w.find('button.undelete').show();\n}\n\nif (!change.get('row_exists') && change_type != 'tracked' && change_type != 'added') {\n w.find('button.undelete').show();\n}\nif (!row_exists) {\n w.find('td.exists').addClass('error');\n}\n\n/*******************************************************************************\n* click handlers\n*******************************************************************************/\n\n// stage button\nw.find('button.stage').click(function() {\n switch(change_type) {\n case 'added':\n\t\t endpoint.schema('bundle').function('stage_row_add', [\n bundle.get('name'),\n schema_name,\n relation_name,\n pk_column_name,\n pk_value\n ]).then(function() {\n reload();\n }).catch(function(e) {\n show_error(e);\n });\n break;\n case 'deleted':\n\t\t endpoint.schema('bundle').function('stage_row_delete', [\n bundle.get('name'),\n schema_name,\n relation_name,\n pk_column_name,\n pk_value\n ]).then(function() {\n reload();\n }).catch(function(e) {\n show_error(e);\n });\n break;\n case 'tracked':\n\t\t endpoint.schema('bundle').function('stage_row_add', [\n bundle.get('name'),\n schema_name,\n relation_name,\n pk_column_name,\n pk_value\n ]).then(function() {\n reload();\n }).catch(function(e) {\n show_error(e);\n });\n break;\n case 'modified':\n console.log('not implemented yet', change);\n break;\n default:\n console.error ('no such change as '+change_type);\n }\n});\n\n\nw.find('button.unstage').click(function() {\n switch(change_type) {\n case 'added':\n\t\t endpoint.schema('bundle').function('unstage_row_add', [\n bundle.get('name'),\n schema_name,\n relation_name,\n pk_column_name,\n pk_value\n ]).then(function() {\n reload();\n // w.remove();\n }).catch(function(e) {\n show_error(e);\n });\n break;\n case 'deleted':\n\t\t endpoint.schema('bundle').function('unstage_row_delete', [\n bundle.get('name'),\n schema_name,\n relation_name,\n pk_column_name,\n pk_value\n ]).then(function() {\n reload();\n // w.remove();\n }).catch(function(e) {\n show_error(e);\n });\n break;\n case 'modified':\n console.log('not implemented yet');\n break;\n default:\n console.error ('no such change as '+change_type);\n }\n});\n\nw.find('button.untrack').click(function() {\n endpoint.schema('bundle').function('untrack_row', [\n bundle.get('name'),\n schema_name,\n relation_name,\n pk_column_name,\n pk_value\n ]).then(function() {\n w.remove();\n }).catch(function(e) {\n show_error(e);\n });\n});\n\nw.find('.modified_link').click(function() {\n w.append(widget('ide:modal', {\n content: widget('ide:stage_row_changed_diffs', {\n \n stage_field_changes: change.get('stage_field_changes'),\n stage_field_changes_old_vals: change.get('stage_field_changes_old_vals'),\n stage_field_changes_new_vals: change.get('stage_field_changes_new_vals'),\n \n offstage_field_changes: change.get('offstage_field_changes'),\n offstage_field_changes_old_vals: change.get('offstage_field_changes_old_vals'),\n offstage_field_changes_new_vals: change.get('offstage_field_changes_new_vals'),\n \n bundle: bundle\n })\n }));\n});\n\nw.find('button.undelete').click(function() {\n endpoint.schema('bundle').function('checkout_row', [\n schema_name+'/'+relation_name+'/'+pk_value,\n change.get('commit_id')\n ]).then(function() {\n reload();\n }).catch(function(e) {\n show_error('undelete failed: '+e);\n });\n});\n\nfunction reload () {\n w.trigger('reload_stage_dialog');\n return;\n \n \n // THIS DOESN'T WORK. See https://github.com/aquametalabs/aquameta/issues/57\n console.log(change);\n \n var self = endpoint.schema('bundle').table('head_db_stage').row({\n where: [{\n name: 'row_id',\n op: '=',\n value: change.get('row_id')\n }]\n }).then(function(self) {\n w.replaceWith(widget('ide:'+name, self));\n }).catch(function(e) {\n console.error('error reloadig widget: ', e);\n });\n}\n\nfunction show_error (e) {\n alert('Error!\\n' + e)\n console.error(e);\n}\n
\\x9b0d349fc1bbcc41708a8960ac355e2c7c8acb2b28aaa65b40bfbe66637c3bfa <div id="{{= id }}" class="{{= name }}">\n <div class="buttons">\n <button class="save">Save</button>\n <button class="copy">Copy</button>\n <button class="delete">Delete</button>\n </div>\n <p class='title'>widget: <span class='name'></span></p>\n <div class="tabs"></div>\n <div class="content"></div>\n</div>
\\x9b2cc2de4da2be5acb15f5616fe20d5fc00f51d217768732cdb143de9d43b1ad bundle_import_dialog
\\x9b5b01972526cd07117d84634fb6f58d15b8932637519400f112e4e2c2fa65c2 .{{= name }} {\n white-space: nowrap;\n}\n\n.{{= name }} .label {\n font-size: 90%;\n}\n\n.{{= name }}:hover {\n background-color: #777;\n cursor: pointer;\n}\n\n.{{= name }} span.icon {\n display: none;\n}\n\n.{{= name }} span.modified {\n /* color: yellow; */\n}\n\n.{{= name }} span.added {\n color: green;\n}\n\n.{{= name }} span.deleted {\n color: red;\n}\n\n.{{= name }} span.tracked {\n color: lightblue;\n}\n\n.{{= name }} span.staged {\n color: green;\n}\n\n.{{= name }} span.unstaged {\n color: red;\n}\n
Expand Down
2 changes: 1 addition & 1 deletion bundles-available/org.aquameta.core.ide/bundle.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
47f8c9ba-d69b-4fe5-9c4b-5d54b300f78c org.aquameta.core.ide ef01a52b-fed1-4068-9d19-dd2fcb2d5cc4
47f8c9ba-d69b-4fe5-9c4b-5d54b300f78c org.aquameta.core.ide 1d890d59-029b-4d79-994a-2c986147a2fe
1 change: 1 addition & 0 deletions bundles-available/org.aquameta.core.ide/commit.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
017a5626-a556-4fac-a156-629be666b1e2 47f8c9ba-d69b-4fe5-9c4b-5d54b300f78c 0694f1b1-5a64-4321-ae84-4d98f7115763 \N 2ec9f8b2-d30a-4267-863e-f36667a57c8a 2019-01-21 16:39:32.404581 use auth:auth_manager on /dev
0d06852c-82b8-410c-93bb-aa0c24ba16d9 47f8c9ba-d69b-4fe5-9c4b-5d54b300f78c 2ca5f78b-7b00-42de-bded-df34e27b0f4d \N a8b8f6a1-089a-4361-89d0-ad4bdd635323 2017-12-29 13:54:07.081821 stub out the untracked row display
1d890d59-029b-4d79-994a-2c986147a2fe 47f8c9ba-d69b-4fe5-9c4b-5d54b300f78c 5a26442a-d8fc-4fc3-bef1-330b7caf4e63 \N ef01a52b-fed1-4068-9d19-dd2fcb2d5cc4 2019-04-24 16:31:27.836416 left a debugger call in there :(
2ec9f8b2-d30a-4267-863e-f36667a57c8a 47f8c9ba-d69b-4fe5-9c4b-5d54b300f78c 843e8f14-e2ab-42cb-9142-e7d6165fc48c \N ea88a679-30ce-40d6-8d80-bce37568b49c 2019-01-20 12:40:20.640802 rework / page
32e2754f-2cd5-4de8-a4da-0073b0cb022d 47f8c9ba-d69b-4fe5-9c4b-5d54b300f78c 1ef85234-0cec-4a64-830d-c21eb6d53d71 \N 89ac3c75-d87a-4373-9938-364191803c65 2019-01-28 05:30:06.286814 template / template_route editor
46baa2d6-c4dd-4f9e-8158-19aa90d9fdf5 47f8c9ba-d69b-4fe5-9c4b-5d54b300f78c 7dcef837-5b85-4ed0-bb7d-ab113e2bc5e8 \N 7923f69c-5a09-4683-9de5-6e55754487fd 2019-01-25 02:09:52.429288 fix code editor to work (kind of) with json yuck
Expand Down
1 change: 1 addition & 0 deletions bundles-available/org.aquameta.core.ide/rowset.csv
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
4e9b64d0-fba7-40b5-b9ce-6f3fd53844f8
5501c4df-3538-47b1-92f1-677e42bb1a81
5667b972-469d-4d20-b95c-966a3c9b3033
5a26442a-d8fc-4fc3-bef1-330b7caf4e63
5e60a146-ce7a-497e-93be-83a4177e8383
6dc587d2-b9fc-4f54-8484-aa696dee0334
78240cbb-ec2a-49bd-9d22-8a6c5a096619
Expand Down
Loading

0 comments on commit 8d4c9ca

Please sign in to comment.