diff --git a/README.md b/README.md index e085c28..ae93d89 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/src/common/services/products-factory/sample-products.json b/data/sample-products.json similarity index 100% rename from src/common/services/products-factory/sample-products.json rename to data/sample-products.json diff --git a/data/sample-products.xlsx b/data/sample-products.xlsx new file mode 100644 index 0000000..69d75bd Binary files /dev/null and b/data/sample-products.xlsx differ diff --git a/src/common/services/transactions-analytics-factory/sample-transactions.json b/data/sample-transactions.json similarity index 100% rename from src/common/services/transactions-analytics-factory/sample-transactions.json rename to data/sample-transactions.json diff --git a/data/sample-transactions.xlsx b/data/sample-transactions.xlsx new file mode 100644 index 0000000..bae8f2f Binary files /dev/null and b/data/sample-transactions.xlsx differ diff --git a/src/common/services/products-factory/dev-products-factory.factory.js b/src/common/services/products-factory/dev-products-factory.factory.js index feb7b73..3cf1764 100644 --- a/src/common/services/products-factory/dev-products-factory.factory.js +++ b/src/common/services/products-factory/dev-products-factory.factory.js @@ -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 diff --git a/src/common/services/transactions-analytics-factory/dev-transactions-analytics-factory.factory.js b/src/common/services/transactions-analytics-factory/dev-transactions-analytics-factory.factory.js index 5a524c2..11b01f8 100644 --- a/src/common/services/transactions-analytics-factory/dev-transactions-analytics-factory.factory.js +++ b/src/common/services/transactions-analytics-factory/dev-transactions-analytics-factory.factory.js @@ -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 = {