appbaseio / batteries Goto Github PK
View Code? Open in Web Editor NEWPluggable modules for mappings, search preview and analytics
Pluggable modules for mappings, search preview and analytics
Search Preview applied filters are getting reset after navigating to different pages.
Reproduce :
The preferences are reset now.
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.
While exporting code in codesandbox, following errors happen:
Nothing to Display
.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"
}
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)
Use analytics with SSR (react dom server or nextjs)
The same way ace editor was #41
Expose renderSuggestions
.
-> requires updates to dashboard and dejavu projects so they don't break.
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;
We can show raw mapping next to each field in an icon similar to how we do in dejavu browser view.
Date fns provides a much lightweight solution instead of moment and can help shed some bundle size.
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
}
}
}
}
}
In dejavu when using search preview, changing the tab resets the search preview settings. They should be saved locally.
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:
Alternatively, expose onData
and onAllData
props.
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:
When credentials
are provided, they should be used to correctly set the headers instead of the browser cookie.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.