Splits Adapter loading from AdaptableController

- Adds dynamic prototype conformance check upon setting adapter
- Throws when adapter is undefined, invalid in controller
This commit is contained in:
Florent Vilmart
2016-02-21 23:47:07 -05:00
parent 33fa5a7b2a
commit 23e55e941e
10 changed files with 210 additions and 116 deletions

View File

@@ -2,6 +2,7 @@
import { Parse } from 'parse/node';
import { randomHexString } from '../cryptoUtils';
import AdaptableController from './AdaptableController';
import { FilesAdapter } from '../Adapters/Files/FilesAdapter';
export class FilesController extends AdaptableController {
@@ -29,7 +30,7 @@ export class FilesController extends AdaptableController {
* with the current mount point and app id.
* Object may be a single object or list of REST-format objects.
*/
expandFilesInObject(config, object) {
expandFilesInObject(config, object) {
if (object instanceof Array) {
object.map((obj) => this.expandFilesInObject(config, obj));
return;
@@ -52,6 +53,10 @@ export class FilesController extends AdaptableController {
}
}
}
expectedAdapterType() {
return FilesAdapter;
}
}
export default FilesController;