Module relationships (#2556)

* Fix for wrong contact being deleted

* dynamically load module relationships
This commit is contained in:
David Bomba 2018-12-16 00:04:46 +11:00 committed by GitHub
parent 95f1d24b8f
commit f9ea784d63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 78813 additions and 183 deletions

View File

@ -1,9 +1,8 @@
<?php
return [
'client' => [
'notes' => function ($self) {
return $self->hasMany('Modules\Notes\Entities\Note');
}
],
];
'client' => [
'notes' => ["hasMany", ['Modules\Notes\Entities\Note']]
],
];

View File

@ -25,5 +25,5 @@ class Note extends Model
{
return $this->hasMany(Note::class);
}
}

View File

@ -26,6 +26,7 @@ class NotesServiceProvider extends ServiceProvider
$this->registerViews();
$this->registerFactories();
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
}
/**

View File

@ -17,7 +17,7 @@ class BaseModel extends Model
if (config()->has($configPath)) {
$function = config()->get($configPath);
return $function($this);
return call_user_func_array(array($this, $function[0]), $function[1]);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -22032,7 +22032,7 @@ var render = function() {
attrs: { type: "button" },
on: {
click: function($event) {
_vm.$emit("remove", _vm.contact.id)
_vm.$emit("remove", _vm.contact)
}
}
},

View File

@ -22032,7 +22032,7 @@ var render = function() {
attrs: { type: "button" },
on: {
click: function($event) {
_vm.$emit("remove", _vm.contact.id)
_vm.$emit("remove", _vm.contact)
}
}
},

12588
public/js/coreui.js vendored

File diff suppressed because one or more lines are too long

12588
public/js/coreui.min.js vendored

File diff suppressed because one or more lines are too long

11560
public/js/localization.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

83
public/js/ninja.js vendored
View File

@ -1,83 +0,0 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 4);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./resources/js/app.js":
/***/ (function(module, exports) {
throw new Error("Module build failed: Error: ENOENT: no such file or directory, open '/Users/davidbomba/Development/invoice-ninja/resources/js/app.js'");
/***/ }),
/***/ 4:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("./resources/js/app.js");
/***/ })
/******/ });

View File

@ -1,83 +0,0 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 4);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./resources/js/app.js":
/***/ (function(module, exports) {
throw new Error("Module build failed: Error: ENOENT: no such file or directory, open '/Users/davidbomba/Development/invoice-ninja/resources/js/app.js'");
/***/ }),
/***/ 4:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("./resources/js/app.js");
/***/ })
/******/ });

View File

@ -49,7 +49,7 @@
</div>
<div class="float-right">
<button type="button" class="btn btn-danger" v-on:click="$emit('remove',contact.id)"> {{ trans('texts.remove_contact') }}</button>
<button type="button" class="btn btn-danger" v-on:click="$emit('remove',contact)"> {{ trans('texts.remove_contact') }}</button>
</div>
</div>
</template>