Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion assets/js/build-min.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ if(data.builderResponseData.operation!='delete'){$masterTabPane.find('input[name
this.updateMasterTabIdAndTitle($masterTabPane,data.builderResponseData)
this.unhideFormDeleteButton($masterTabPane)
this.getTableList().fileList('markActive',data.builderResponseData.tabId)
this.getIndexController().unchangeTab($masterTabPane)}
this.getIndexController().unchangeTab($masterTabPane)
this.updateTable(data.builderResponseData)}
else{this.forceCloseTab($masterTabPane)}
$.oc.builder.dataRegistry.clearCache(data.builderResponseData.pluginCode,'model-columns')}
DatabaseTable.prototype.getTableList=function(){return $('#layout-side-panel form[data-content-id=database] [data-control=filelist]')}
Expand All @@ -178,6 +179,9 @@ tableObj.addRecord('bottom',true)
tableObj.setRowValues(currentData.length-1,rowData)
tableObj.addRecord('bottom',false)
tableObj.deleteRecord()}
DatabaseTable.prototype.updateTable=function(data){var tabsObject=this.getMasterTabsObject(),tabs=$('#builder-master-tabs').data('oc.tab'),tab=tabs.findByIdentifier(data.tabId)
tabsObject.updateTab(tab,data.tableName,data.tab)
this.onTableLoaded()}
$.oc.builder.entityControllers.databaseTable=DatabaseTable;}(window.jQuery);+function($){"use strict";if($.oc.builder===undefined)
$.oc.builder={}
if($.oc.builder.entityControllers===undefined)
Expand Down
11 changes: 11 additions & 0 deletions assets/js/builder.index.entity.databasetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@

this.getTableList().fileList('markActive', data.builderResponseData.tabId)
this.getIndexController().unchangeTab($masterTabPane)

this.updateTable(data.builderResponseData)
}
else {
this.forceCloseTab($masterTabPane)
Expand Down Expand Up @@ -295,6 +297,15 @@
tableObj.deleteRecord()
}

DatabaseTable.prototype.updateTable = function(data) {
var tabsObject = this.getMasterTabsObject(),
tabs = $('#builder-master-tabs').data('oc.tab'),
tab = tabs.findByIdentifier(data.tabId)

tabsObject.updateTab(tab, data.tableName, data.tab)
this.onTableLoaded()
}

// REGISTRATION
// ============================

Expand Down
10 changes: 9 additions & 1 deletion behaviors/IndexDatabaseTableOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,21 @@ public function onDatabaseTableMigrationApply()
$this->controller->widget->versionList->refreshActivePlugin()
);

$widget = $this->makeBaseFormWidget($table);
$this->vars['tableName'] = $table;

$result['builderResponseData'] = [
'builderObjectName'=>$table,
'tabId' => $this->getTabId($table),
'tabTitle' => $table,
'tableName' => $table,
'operation' => $operation,
'pluginCode' => $pluginCode->toCode()
'pluginCode' => $pluginCode->toCode(),
'tab' => $this->makePartial('tab', [
'form' => $widget,
'pluginCode' => $this->getPluginCode()->toCode(),
'tableName' => $table
])
];

return $result;
Expand Down
7 changes: 4 additions & 3 deletions classes/MigrationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use ValidationException;
use SystemException;
use Exception;
use Throwable;

/**
* Manages plugin migrations
Expand Down Expand Up @@ -133,12 +134,12 @@ public function save($executeOnSave = true)
VersionManager::instance()->updatePlugin($this->getPluginCodeObj()->toCode(), $this->version);
}
}
catch (Exception $ex) {
// Remove the script file, and rollback
catch (Throwable $e) {
// Remove the script file, and rollback
// the version.yaml.
$this->rollbackSaving($originalVersionData, $originalFileContents);

throw $ex;
throw $e;
}

$this->originalVersion = $this->version;
Expand Down
2 changes: 0 additions & 2 deletions classes/migrationmodel/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ fields:
label: rainlab.builder::lang.migration.field_description
code:
label: rainlab.builder::lang.migration.field_code
commentAbove: rainlab.builder::lang.migration.field_code_comment
type: codeeditor
language: php
readOnly: true
1 change: 0 additions & 1 deletion lang/cs/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@
'field_version' => 'Verze',
'field_description' => 'Popis migrace',
'field_code' => 'Kód migrace',
'field_code_comment' => 'Kód migrace je pouze pro čtení a slouží pouze pro náhled. Vlastní migraci můžete vytvořit v sekci Verze v levém menu.',
'save_and_apply' => 'Uložit a aplikovat',
'error_version_exists' => 'Tato verze migrace již existuje.',
'error_script_filename_invalid' => 'The migration script file name can contain only Latin letters, digits and underscores. The name should start with a Latin letter and could not contain spaces.',
Expand Down
1 change: 0 additions & 1 deletion lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,6 @@
'field_version' => 'Version',
'field_description' => 'Description',
'field_code' => 'Code',
'field_code_comment' => 'The migration code is read-only and for the preview purpose only. You can create custom migrations manually in the Versions section of the Builder.',
'save_and_apply' => 'Save & Apply',
'error_version_exists' => 'The migration version already exists.',
'error_script_filename_invalid' => 'The migration script file name can contain only Latin letters, digits and underscores. The name should start with a Latin letter and could not contain spaces.',
Expand Down
1 change: 0 additions & 1 deletion lang/es/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@
'field_version' => 'Versión',
'field_description' => 'Descripción',
'field_code' => 'Code',
'field_code_comment' => 'The migration code is read-only and for the preview purpose only. You can create custom migrations manually in the Versions section of the Builder.',
'save_and_apply' => 'Salvar y Aplicar',
'error_version_exists' => 'The migration version already exists.',
'error_script_filename_invalid' => 'The migration script file name can contain only Latin letters, digits and underscores. The name should start with a Latin letter and could not contain spaces.',
Expand Down
1 change: 0 additions & 1 deletion lang/fa/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@
'field_version' => 'ویرایش',
'field_description' => 'توضیحات',
'field_code' => 'کد',
'field_code_comment' => 'کد ساختار بانک اطلاعاتی فقط خواندنی و فقط جهت پیش نمایش می باشد. شما میتوانید ساختار بانک اطلاعاتی سفارشی را به صورت دستی در بخش ویرایش ها ایجاد نمایید.',
'save_and_apply' => 'ذخیره و اعمال',
'error_version_exists' => 'فایل ساختار بانک اطلاعاتی قبلا تعریف شده است.',
'error_script_filename_invalid' => 'نام فایل ساختار بانک اطلاعاتی فقط میتواند حاوی حروف لاتین، اعداد و خط زیر باشد و با یک حرف لاتین بزرگ شروع شود.',
Expand Down
1 change: 0 additions & 1 deletion lang/nl/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@
'field_version' => 'Versie',
'field_description' => 'Omschrijving',
'field_code' => 'Code',
'field_code_comment' => 'De migratie-code in alleen-lezen en alleen voor voorbeeldweergave. Je kan handmatig migraties aanmaken in het Versies onderdeel van Builder.',
'save_and_apply' => 'Opslaan & toepassen',
'error_version_exists' => 'De migratie-versie bestaat reeds.',
'error_script_filename_invalid' => 'De bestandsnaam van de migratie kan alleen letters, getallen en underscores bevatten. De naam moet beginnen met een letter en mag geen spaties bevatten.',
Expand Down
1 change: 0 additions & 1 deletion lang/pt-br/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@
'field_version' => 'Versão',
'field_description' => 'Descrição',
'field_code' => 'Código',
'field_code_comment' => 'O código da migration é apenas leitura e apenas para o propósito de preview. Você pode criar migrations customizadas manualmente na seção Versões do Builder.',
'save_and_apply' => 'Salvar e aplicar',
'error_version_exists' => 'A versão da migration já existe.',
'error_script_filename_invalid' => 'O nome do arquivo de script do migration pode conter apenas letras latinas, números e underlines. O nome deve começar com uma letra latina e não pode conter espaços.',
Expand Down