Giter Site home page Giter Site logo

batteries's People

Contributors

anik-ghosh-au7 avatar bietkul avatar divyanshu013 avatar jyash97 avatar lakhansamani avatar lohi212 avatar metagrover avatar mohdashraf010897 avatar nikhil-varma avatar savvyshah avatar shahanuj2610 avatar siddharthlatest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

batteries's Issues

Bug: Search Preview Filters are resetting automatically

Search Preview applied filters are getting reset after navigating to different pages.

Reproduce :

  1. Add filters and edit search datafield.
  2. navigate to different pages like mappings, importer.

The preferences are reset now.

Enhancement: Result component

Improvement(s):

  • At the very basic, we should have a UI that looks sleek visually. A list UI is a good default instead of the current tree type UI structure. The whole object is visible anyways on hovering over the view / edit icon, so we should focus on the look and feel of the relevant search items instead.

  • Allow a way for user to specify what elements appear in the layout - if we do this, it would replace the includeFields and excludeFields feature as it effectively does the same thing.

  • Either ways, we should remove excludeFields from this UI as it's an overkill.

Bug: Unable to delete a type in Editable Mappings view

Deleting a type from mappings view currently sets the exclude_fields array as properties, which is not correct. It should be set to all the fields that belong to the type.

{
   "mappings":{
   },
   "settings":{
      ...
   },
   "exclude_fields":[
      "properties"
   ],
   "es_version":"5"
}

Enhancement: Can we merge viewing / editing of JSON object?

Right now, we show two separate icons.

=> View file

=> Editing JSON

There can be a single icon for viewing file which has an edit button (we can use the 2nd implementation). Editing makes the UI view editable and the same button then changes to Update.

Relevant docs

Would be nice to have some docs on usage for example #29, #34, #35

Also some dependencies are not mentioned in the readme properly. Docs are not maintained properly. For example the redux setup is unclear (also missing thunk middleware).

New changes have a broken SSR api

Relevant stacktrace

window is not defined

ReferenceError: window is not defined
    at Object.window (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/webpack:/batteries/components/analytics/components/Analytics.js?d733:97:14)
    at __webpack_require__ (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/webpack:/webpack/bootstrap 000c45aa6696d90fdfd1?b3fc:21:1)
    at Object../batteries/components/analytics/index.js (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/admin.js:5874:81)
    at __webpack_require__ (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/webpack:/webpack/bootstrap 000c45aa6696d90fdfd1?b3fc:21:1)
    at Object../pages/admin/index.js (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/admin.js:25590:91)
    at __webpack_require__ (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/webpack:/webpack/bootstrap 000c45aa6696d90fdfd1?b3fc:21:1)
    at Object.2 (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/admin.js:26815:18)
    at __webpack_require__ (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/webpack:/webpack/bootstrap 000c45aa6696d90fdfd1?b3fc:21:1)
    at /Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/webpack:/webpack/bootstrap 000c45aa6696d90fdfd1?b3fc:68:1
    at Object.<anonymous> (/Users/divyanshu/rx-builder/packages/rx-builder/.next/dist/bundles/pages/admin.js:73:10)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)

Steps to replicate

Use analytics with SSR (react dom server or nextjs)

How to fix

The same way ace editor was #41

Change Ok label to Save

For every component:

It's a Ux issue as saving doesn't occur without clicking on this. (Is there any way to highlight the fact, or do an auto-save behavior instead)?

Make batteries SSR compatible

Currently the ace editor and brace modules throw an error when used with SSR. Possibly we can write an isomorphic wrapper for the ace editor module. Here's one that I wrote in an app. If it works out of box in batteries we can replace it.

import React, { Component } from 'react';

const Editor = (props) => {
	if (typeof window !== 'undefined') {
		const Ace = require('react-ace').default; // eslint-disable-line
		require('brace/snippets/html'); // eslint-disable-line
		require('brace/mode/html'); // eslint-disable-line
		require('brace/theme/tomorrow'); // eslint-disable-line
		return <Ace {...props} />;
	}
	return null;
};

// an isomorphic wrapper for Ace editor since it doesn't work server side
class Ace extends Component {
	state = {
		mounted: false,
	};

	componentDidMount() {
		// eslint-disable-next-line
		this.setState({ mounted: true });
	}

	render() {
		return this.state.mounted ? (
			<Editor {...this.props} editorProps={{ $blockScrolling: true }} />
		) : null;
	}
}

export default Ace;

Enhancement: Search component

Improvements:

  • Make default search weights to be 1.
  • Can we make the search field selection to have a filter? (Many times, we have 100+ fields and browsing through them isn't a great experience) cc @metagrover
  • Improving the suggestions UI look and feel - this is just lacking right now in my subjective opinion. @metagrover
  • There is some bug with highlighting, it doesn't always work.

Bug: We aren't iterating field mappings correctly when dealing with an array of objects

When showing the fields for MultiList or DataSearch, we don't set the fields correctly when dealing with a complex array field. (The app where this error occurs belongs to a user, so I am only sharing the mapping info here that's relevant to showing the data relationship and how it's not depicted by the Search Preview with a screenshot from it.)

Example:

Here, features.$field is a path inside the items array, but it shows outside and results in the dataField not working correctly.

Following is the mapping object of the items field which shows that the features field resides within it.

{
 "properties": {
  "_id": {
   "type": "text",
   "fields": {
    "keyword": {
     "type": "keyword",
     "ignore_above": 256
    }
   }
  },
  "date": {
   "type": "date"
  },
  "features": {
   "properties": {
    "_id": {
     "type": "text",
     "fields": {
      "keyword": {
       "type": "keyword",
       "ignore_above": 256
      }
     }
    },
    "buildyear": {
     "type": "text",
     "fields": {
      "keyword": {
       "type": "keyword",
       "ignore_above": 256
      }
     }
    },
    "color": {
     "type": "text",
     "fields": {
      "keyword": {
       "type": "keyword",
       "ignore_above": 256
      }
     }
    },
    "date": {
     "type": "date"
    },
    "engine": {
     "type": "text",
     "fields": {
      "keyword": {
       "type": "keyword",
       "ignore_above": 256
      }
     }
    },
    "pgp": {
     "type": "text",
     "fields": {
      "keyword": {
       "type": "keyword",
       "ignore_above": 256
      }
     }
    },
    "twofactorauthentication": {
     "type": "text",
     "fields": {
      "keyword": {
       "type": "keyword",
       "ignore_above": 256
      }
     }
    },
    "user": {
     "type": "text",
     "fields": {
      "keyword": {
       "type": "keyword",
       "ignore_above": 256
      }
     }
    },
    "zeroknowledgeencryptionatrest": {
     "type": "text",
     "fields": {
      "keyword": {
       "type": "keyword",
       "ignore_above": 256
      }
     }
    }
   }
  },
  "itemname": {
   "type": "text",
   "fields": {
    "keyword": {
     "type": "keyword",
     "ignore_above": 256
    }
   }
  },
  "user": {
   "type": "text",
   "fields": {
    "keyword": {
     "type": "keyword",
     "ignore_above": 256
    }
   }
  }
 }
}

Feature: Support different layout templates

We can get to this feature in a bit, but it's an important feature from a visual standpoint.

We can support three layouts for the results display:

  1. List - this is the default layout,
  2. Card / Grid - this is a secondary layout,
  3. Map - this is the third layout if geopoint data is selected.

Alternatively, expose onData and onAllData props.

Enhancement: Billing by plans

Instead of having search profiles as the primary criteria for plans, we can move certain features to paid plans similar to how we handle this for credentials.

Anything that's not core to building a search preview can go to a paid plan. Examples can be:

  1. Using additional layout templates - these can be available for paid plan users only.
  2. Customizing rankings by query - this can be available for paid plan users only (also requires a backend support).
  3. Term boost (we haven't implemented yet) can also be available for paid users only.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.