# Sisense Analyze With Insights Miner pplugin

## Description

This is new plugin that assist dashboard designers in getting started with dashboarding by providing insights about datasets that can expose insights to explore.
It adds 'Get Insights' item to widget menu with the list of available data values for insights generation.
It will open 'Analyze with Insight Miner' pop-up modal for visualization of analysis progress and generated insights.
The end user have a following controls for interaction:
 * 'Next' button - show next insight
 * 'Load # more insights' button - load next pack of insight.
 * 'Share' button - open share pop-up modal for correspond insight sharing to email
 * 'Like' toggle button with 'heart' icon - marks correspond insight as 'Liked' item
 * Insight image click - allow to expand/collapse the image.

'Share with' pop-up modal allow to share current insight to email. 
It is possible to use sisense users/groups and external emails for sharing.

### Configuration
For configuration of the plugin use `config.6.js` file. There is an option `useCustomEmailServer`. If you want to use a 
custom email server for sharing insight, change the parameter value to `true`
```javascript
{useCustomEmailServer:true}
```

### Linux

1. Extract the `Sisense.{addon-name}.zip`.
2. Upload the extracted folder to the server using `Admin/System Management/File Management` or SSH.
   - Using `SSH` will help avoid issues related to slow internet connection, size of archive etc. which could happen using `File Management`.
   - You can use `/opt/sisense/storage` - default path for File Management or any other folder.
3. Connect to a server via SSH (`ssh username@serverip`)
   - If you uploaded the add-on with a File Management UI to a multi-node (HA) environment, the uploaded folder
     is accessible only from the management pod. This folder has to be copied to the node using this command:
     `kubectl cp -n sisense management-xxx-xxx:/path/to/addon/Sisense.{addon-name}.{version} ./addons/Sisense.{addon-name}.{version}`
   - navigate to the 'scripts' folder inside the extracted folder
     example: `cd /opt/sisense/storage/Sisense.{addon-name}.{version}/scripts`
4. Run script with one of the keys described below in the `Script Flags Description` chapter.
   - For first time installation use `-i` flag.
   - For upgrade installed add-on use `-u` flag.
5. All needed pods will be restarted automatically. This may take a few minutes.

6. Refresh your dashboard.

### Script Flags Description

1. To run script command use:
   - `bash ./l-addon-script.sh {command-key}` - replace `{command-key}` with one of keys listed from `-h` command.
2. Show available commands:
   - `bash ./l-addon-script.sh -h` - shows a list of available command keys and their description.
3. Common commands:
   - `bash ./l-addon-script.sh -i` - install add-on or rewrite existing add-on files.
   - `bash ./l-addon-script.sh -r` - remove add-on from the system. Configuration in Mongo and Configuration page will persist.
   - `bash ./l-addon-script.sh -u` - update the currently installed add-on by removing it and then installing a new version.

All needed pods will be restarted automatically. This may take a few minutes.