view · edit · sidebar · attach · print · history

20160801-migrate-davaz-com-dojo-widgets

<< 20160802-migrate-davaz-com | Index | 20160727-migrate-davaz-com-dojo-widgets >>


Summary

  • Migrate davaz.com (javasrcipt, ruby)
  • Refactor States (admin, ajax)

Commits / Patches / Pull Requests, Scripts

Index


Migrate davaz.com widgets

Fix artobject action

update action does not work. Before continue migrating dojo widgets, I have to fix this.

[1] 2.3.1-p112(#<DAVAZ::Util::DbManager>)> conn.insert_id
NoMethodError: undefined method `insert_id' for #<Mysql2::Client:0x00559674d39f90>
from (pry):4:in `block (2 levels) in update_artobject'

This error caused by change of new mysql library.

Commit: Fix artobject update (use prepare statement)

DbManager's query method kills exception. It seems that this is not good :{
And DbManager does not use transaction.

Add transaction DbManager

Add transaction (begin, commit, rollback) and then remove unnecessary connection pool class.
Updated DbManager.

Commit: Add transaction

Fix art object loading issue

After updated, artobject is does not rendered, correctly. Tags are saved, but its are not displayed (in Form)

[2] 2.3.1-p112(#<DAVAZ::View::Works::WorksTitle>)> @session.app.load_artobject("1306")
=> #<DAVAZ::Model::ArtObject:0x007f2d48a966c8
 @artgroup="Sculptures",
 @artgroup_id="SCU",
 @artobject_id=1306,
 ...
 @serie="black and white",
 @serie_id="AAG",
 @serie_position="1",
 @size="",
 @tags=
  [#<DAVAZ::Model::Tag:0x007f2d48a957a0 @name=" Georgien", @tag_id=70>,
   #<DAVAZ::Model::Tag:0x007f2d48a956b0 @name="Dong", @tag_id=99>],
 @text="",
 ...

Refactor admin and ajax status

In States, admin and ajax prefixes are scuffled each other and, pretty duty.
And many unused states class are still there.

Then I've decide to refactor these at now.

z.B.

  • AjaxAddElement and AjaxAddNewElement are different?
  • State::Admin::AjaxXXX and State::AdminAjaxXXX.
  • AdminXXX class has ajax_xxx method.
  • Some classes are in admin directory, but Other classes are in same regular files.
  • Many class provides just link or element have 'Ajax' prefix. (this is not ajax request/response)

Mostly, multiple another classes are also defined in a single ruby file.
This makes more harder to debug, improve application.

So, I would like to clean a little more...

  • Reduce class and files
  • Bundle Ajax and Admin methods
  • Remove Ajax prefix if its class does not have ajax response
  • Fix indent
  • Fix namespace problem (global_predefine)
  • Remove unnecessary methods, classes and files! (too many...)
  • Rename DAVAZ (and Davaz) modules to DaVaz

Commit: [WIP] Refactor ruby files :( (huge!)

Continue tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on August 01, 2016, at 11:51 PM