Giter Site home page Giter Site logo

renovation-core's Introduction

Renovation Core

The Frappe Javascript Front End Missing SDK.

Getting Started

Javascript / TypeScript

Installation Renovation Core is available as an npm package and can be installed using:

npm i --save @leam-tech/renovation-core

Backend

Although you don't have to install any backend for renovation-core to work, if you want to have full access to the features we offer you'd have to install renovation_core app in your site. You can do that using:

bench get-app renovation_core https://github.com/leam-tech/renovation_core.git 

Documentation

Renovation Documentation

renovation-core's People

Contributors

assemmarwan avatar e-lobo avatar fahimalizain avatar malikzu avatar mohamedzu avatar nabilshuja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

renovation-core's Issues

Process is not defined in TestManager

On fresh Install of renovation-core in Angular, the following error shows up when running the application.

Screen Shot 2020-04-19 at 12 01 16 PM

From here, in the class TestManager

public static getVariables(variableName: ENV_VARIABLES): string {
    return process.env[variableName];
  }

This does not seem to be the case when doing it elsewhere.

getList() orderBy documentation is vague

The renovation-core documentation currently has the following definition of the orderBy argument of getList():
Screenshot from 2021-08-24 22-31-31
...while the actual argument looks something a little more like this:

this.$renovation.model.getList({
      doctype: 'Clients',
      fields: ['client_name, logo'],
      orderBy: '`tabClients`.`name` asc',
    })

A little tweaking of the description, or a full example could save someone inexperienced with frappe much time wasted. ๐Ÿ˜…

frappe.exceptions.DuplicateEntryError: ('Renovation DocField', 'Data Import Legacy-amended_from', IntegrityError(1062, "Duplicate entry 'Data Import Legacy-amended_from' for key 'PRIMARY'"))

During Installation, one migration is complete, it ends with a Duplicate Entry error log.
I by passed by reruning migrate

Updating DocTypes for renovation_core: [===================
Updating DocTypes for renovation_core: [===================
Updating DocTypes for renovation_core: [========================================] Supervisor config file updated to use renovation_core.app.application and renovation_core/socketio.js Procfile updated to use renovation_core/socketio.js You may have to restart bench to complete configuration Traceback (most recent call last): File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 320, in db_insert frappe.db.sql("""INSERT INTO tab{doctype} ({columns}) File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 156, in sql self._cursor.execute(query, values) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/cursors.py", line 170, in execute result = self._query(query) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/cursors.py", line 328, in _query conn.query(q) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 517, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 732, in _read_query_result result.read() File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 1075, in read first_packet = self.connection._read_packet() File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 684, in _read_packet packet.check_error() File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/protocol.py", line 220, in check_error err.raise_mysql_exception(self._data) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/pymysql/err.py", line 109, in raise_mysql_exception raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, "Duplicate entry 'Data Import Legacy-amended_from' for key 'PRIMARY'")
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 192, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 99, in main() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main click.Group(commands=commands)(prog_name='bench') File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 764, in call return self.main(*args, **kwargs) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py", line 26, in _func ret = f(frappe._dict(ctx.obj), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 203, in install_app _install_app(app, verbose=context.verbose) File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 93, in install_app frappe.get_attr(after_install)() File "/home/frappe/frappe-bench/apps/renovation_core/renovation_core/install/after_install.py", line 11, in after_install
add_all_reqd_table_fields() File "/home/frappe/frappe-bench/apps/renovation_core/renovation_core/renovation_core/doctype/renovation_docfield/renovation_docfield.py", line 112, in add_all_reqd_table_fields doc.insert() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 248, in insert raise e File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 245, in insert self.db_insert() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 335, in db_insert raise frappe.DuplicateEntryError(self.doctype, self.name, e) frappe.exceptions.DuplicateEntryError: ('Renovation DocField', 'Data Import Legacy-amended_from', IntegrityError(1062, "Duplicate entry 'Data Import Legacy-amended_from' for key 'PRIMARY'"))

Cors Restriction on Frappe version-13

There is cors policy restriction when used on frappe version-13, cors access in site_config has been set and javascript FETCH works well but renovation core is restricted., error below

Access to XMLHttpRequest at 'https://testbin.frappe.com/' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field x-client-site is not allowed by Access-Control-Allow-Headers in preflight response.

This error occurred in a VUEJS app.

SAMPLE code:

(async () => {
await renovation.init(backend, hostURL, "test-site")
// renovation.enableJWT(true)
const authResponse = await renovation.auth.login({
email: "administrator",
password: "password"
});
console.log("Successful login", authResponse.data.currentUser);
})();
// above did had cors policy issue, but below worked fine.

fetch('https://gherp.com/api/method/login', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
usr: 'administrator',
pwd: 'password'
})
})
.then(r => r.json())

searchLink lacking in its interface for fields

Options field has an unknown type as an argument of searchLink in model.controller, while it allows other fields to be passed within it, they are not well known. Which is why, we could include interface for options fields for arguments such as the ones below, as offered by frappe on the search_link cmd;

def search_link(doctype, txt, query=None, filters=None, page_length=20, searchfield=None, reference_doctype=None, ignore_user_permissions=False):

Empty txt in getMessage returns args object

renovationInstance.translate.getMessage({
      txt: undefined,
    });

Empty argument for txt in interface approach, causes the if statement to pass here;

Which then causes it to set the args.txt as an argument of what was passed when it should simply return the empty field;

args = { txt: getMessageParams } as GetMessageParams;

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.