Skip to content

Commit 6294f58

Browse files
authored
Update: Hook up metadata from the api call (#56)
Properly forward host names from content explorer to content preview Format metadata to what the api is sending
1 parent 375accf commit 6294f58

33 files changed

Lines changed: 365 additions & 586 deletions

DEVELOPING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Development Setup
22
-----------------
33
1. Install Node v6.10.0 or higher.
4-
2. Install yarn package manager `https://yarnpkg.com/en/docs/install`. Alternatively, you can replace any `yarn` command with `npm`.
4+
2. Install yarn package manager `https://yarnpkg.com/en/docs/install` v1.0.1 or higher. Alternatively, you can replace most `yarn` commands with `npm` commands.
55
2. Fork the upstream repo `https://github.com/box/box-ui-elements`.
66
3. Clone your fork locally `git clone git@github.com:[YOUR GITHUB USERNAME]/box-ui-elements.git`.
77
4. Navigate to the cloned folder `cd box-ui-elements`
@@ -29,9 +29,9 @@ Install the following plugins in your preferred editor
2929
* `yarn run deploy` launches a local webpack dev server for testing. Also watches file changes.
3030
* `yarn run prettier` to format JS code with prettier.
3131
* `yarn run test` launches karma tests with PhantomJS.
32-
* `yarn run test -- --src=PATH/TO/SRC/FILENAME` launches test only for `src/PATH/TO/SRC/__tests__/FILENAME-test.js` instead of all tests. For example, `yarn run debug -- --src=components/Button/Button` launches tests for `components/Button/__tests__/Button-test.js`. This also works for directories, e.g. `yarn run test -- --src=components/`.
32+
* `yarn run test --src=PATH/TO/SRC/FILENAME` launches test only for `src/PATH/TO/SRC/__tests__/FILENAME-test.js` instead of all tests. For example, `yarn run debug -- --src=components/Button/Button` launches tests for `components/Button/__tests__/Button-test.js`. This also works for directories, e.g. `yarn run test -- --src=components/`.
3333
* `yarn run debug` launches karma tests with PhantomJS for debugging. Open the URL mentioned in the console.
34-
* `yarn run debug -- --src=path/to/src/FILENAME` launches debugging for `src/path/to/src/__tests__/FILENAME-test.js` instead of all tests. Open the URL mentioned in the console.
34+
* `yarn run debug --src=path/to/src/FILENAME` launches debugging for `src/path/to/src/__tests__/FILENAME-test.js` instead of all tests. Open the URL mentioned in the console.
3535

3636
For more script commands see `package.json`. Test coverage reports are available under reports/coverage.
3737

src/api/APIFactory.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import FileAPI from './File';
1212
import WebLinkAPI from './WebLink';
1313
import SearchAPI from './Search';
1414
import RecentsAPI from './Recents';
15-
import MetadataAPI from './Metadata';
1615
import { DEFAULT_HOSTNAME_API, DEFAULT_HOSTNAME_UPLOAD, TYPE_FOLDER, TYPE_FILE, TYPE_WEBLINK } from '../constants';
1716
import type { Options, ItemType, ItemAPI } from '../flowTypes';
1817

@@ -57,11 +56,6 @@ class APIFactory {
5756
*/
5857
recentsAPI: RecentsAPI;
5958

60-
/**
61-
* @property {MetadataAPI}
62-
*/
63-
metadataAPI: MetadataAPI;
64-
6559
/**
6660
* [constructor]
6761
*
@@ -117,10 +111,6 @@ class APIFactory {
117111
this.recentsAPI.destroy();
118112
delete this.recentsAPI;
119113
}
120-
if (this.metadataAPI) {
121-
this.metadataAPI.destroy();
122-
delete this.metadataAPI;
123-
}
124114
if (destroyCache) {
125115
this.options.cache = new Cache();
126116
}
@@ -238,17 +228,6 @@ class APIFactory {
238228
this.recentsAPI = new RecentsAPI(this.options);
239229
return this.recentsAPI;
240230
}
241-
242-
/**
243-
* API for file meta data
244-
*
245-
* @return {MetadataAPI} MetadataAPI instance
246-
*/
247-
getMetadataAPI(): MetadataAPI {
248-
this.destroy();
249-
this.metadataAPI = new MetadataAPI(this.options);
250-
return this.metadataAPI;
251-
}
252231
}
253232

254233
export default APIFactory;

0 commit comments

Comments
 (0)