Skip to content

Commit

Permalink
Merge pull request #19 from DomoApps/refactor/datasources
Browse files Browse the repository at this point in the history
Refactor/datasources
  • Loading branch information
jpumford authored Aug 3, 2016
2 parents 175e028 + 05b68f3 commit 5693521
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,32 @@ The app demonstrates simple data formatting, filtering, and display. An "invento

Because this app is not attached to an instance of Domo, DataSource requests are mocked in the products and transaction analytics factories. Comments are included to explain how production DataSource requests are made. See the [Domo Developer Guide](https://developer.domo.com/docs/dev-studio/dev-studio-data) for more information on DataSource requests.

## Getting Started
## How Do I Use the Sample App?

### 1. Set Up Your Project
1. Clone this repo
`$ git clone {URL}`
`$ git clone https://github.com/DomoApps/sample-app.git`
2. Install dependencies `$ npm install`
3. Run local server `$ npm start`

## Uploading to Domo
### 2. Development
`$ npm start` will run a development server that reloads on file changes

### 3. Publishing to Domo
1. Login to Domo `$ domo login`
2. Publish sample app `$ npm run upload`
2. Publish the app `$ npm run upload`
3. Update the `{ id: ... }` value in `domo/manifest.json` with your new app ID

For more information on available commands and usage, see the documentation for the Domo Apps [Starter Kit](https://github.com/DomoApps/starter-kit).

## DataSources
### DataSources
The app is configured by default to mock any DataSource requests with JSON files. In order to change this functionality to use "live" data:
1. Create DataSources in Domo using the `products-factory/sample-products.json` and `transactions-analytics-factory/sample-transactions.json` files in `src/common/services`.
2. Navigate to the two DataSources and copy the `id`s from the URLs (https://company.domo.com/json/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/overview)
3. Add the `id`s to `manifest.json`

1. Follow instructions on [Domo University](https://knowledge.domo.com/?cid=connectordataset#Adding_a_DataSet_using_a_connector) to create two Excel DataSources. Both Excel files are located in the `/data` folder
2. Navigate to the two DataSources in Domo and copy the `ID`s from the URL (https://{COMPANY}.domo.com/excel/{ID}/overview)
3. Replace the existing `ID`s in `manifest.json` with the new ones from step 2
4. In `src/desktop/index.js` change the value of `MOCK_REQUESTS` to `false`
5. Run `npm run upload`
6. Create a new card using the new design by following the steps on the [Developer Portal](https://developer.domo.com/docs/dev-studio/dev-studio-publish#Create%20an%20App%20Instance)

For more information on available commands and usage, see the documentation for the Domo Apps [Starter Kit](https://github.com/DomoApps/starter-kit).

## Compatiblity
#### Tested and working
Expand All @@ -38,7 +45,7 @@ The app is configured by default to mock any DataSource requests with JSON files

#### Known Issues
- Windows
Sticky table header does not align with table body
- Sticky table header does not align with table body

## Folder Structure
```text
Expand Down
File renamed without changes.
Binary file added data/sample-products.xlsx
Binary file not shown.
File renamed without changes.
Binary file added data/sample-transactions.xlsx
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = ngModule => {
function devProductsFactory(SAMPLE_APP, $timeout) {
const sampleProducts = require('./sample-products.json');
const sampleProducts = require('../../../../data/sample-products.json');
// Private variables
const _productsPromises = {};
// Public API here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = ngModule => {
const moment = require('moment');
moment().format();

const sampleTransactions = require('./sample-transactions.json');
const sampleTransactions = require('../../../../data/sample-transactions.json');

// Public API here
const service = {
Expand Down

0 comments on commit 5693521

Please sign in to comment.