1. 02 Dec, 2019 15 commits
    • Jérome Perrin's avatar
      project_ui: fix duplicate selection names · c5209f56
      Jérome Perrin authored
         'base_view_document_selection'
      	'Base_viewDocumentList/listbox': set(['erp5_core'])
      	'Project_viewDocumentList/listbox': set(['erp5_web_project'])
         'project_module_selection'
      	'ProjectModule_viewProjectList/listbox': set(['erp5_project'])
      	'ProjectModule_viewProjectManagementList/listbox': set(['erp5_web_project'])
      c5209f56
    • Jérome Perrin's avatar
      officejs: fix duplicate selection names · b66519a1
      Jérome Perrin authored
      These selection names were already used in other business templates:
      
         'web_page_module_view_web_page_list_selection'
      	'WebPageModule_viewWebPageListAsJioForCodemirror/listbox': set(['erp5_officejs_codemirror'])
      	'WebPageModule_viewWebPageListAsJioForTextEditor/listbox': set(['erp5_text_editor'])
      	'WebPageModule_viewWebPageList/listbox': set(['erp5_web'])
      	'DocumentModule_viewDocumentListAsJioForPdfViewer/listbox': set(['erp5_officejs_pdf_viewer'])
         'image_selection'
      	'WebPageModule_viewWebPageListAsJioForSvgEditor/listbox': set(['erp5_officejs_svg_editor'])
      	'ImageModule_viewImageList/listbox': set(['erp5_dms'])
      b66519a1
    • Jérome Perrin's avatar
      core: fix Folder_cut to check relations of sub-objects · 726f5d1e
      Jérome Perrin authored
      This `o` was an unused variable. The initial intention was probably
      this.
      726f5d1e
    • Jérome Perrin's avatar
      core: fixes for pylint · 3339ba42
      Jérome Perrin authored
      The general approach is:
      - replace deprecated lambdas with list comprehensions
      - remove unused variables/imports
      - replace dangerous arguments [] with ()
      - replace dangerous arguments {} with None and "if None -> {}"
      - replace builtin names with something similar
      - when really no other choice, line-disable the messages
      
      Now that all problems reported by pylint are fixed, enable coding style
      test.
      3339ba42
    • Jérome Perrin's avatar
      core: remove unused scripts · 04489999
      Jérome Perrin authored
      These scripts are not used and does not respect naming conventions or
      have pylint errors.
      04489999
    • Jérome Perrin's avatar
      core: rename PropertySheetChild_validateIDField · 6ed891fe
      Jérome Perrin authored
      PropertySheetChild is not an acceptable prefix, use Base as the context
      is used. Technically, this uses the "id as reference" mixin, but this
      mixin is a bit special as it has takes the suffix as parameter and does
      not reside in mixin module, so we just use Base as a prefix.
      6ed891fe
    • Jérome Perrin's avatar
      bt5: fix naming convention for FieldValidator_requireIfDialogConfirmed · 9be02044
      Jérome Perrin authored
      FieldValidator is not an acceptable prefix,
      Base_validateDialogConfirmation seems better
      9be02044
    • Jérome Perrin's avatar
      bt5: rename planning box scripts to comply with naming conventions · 65305527
      Jérome Perrin authored
      Rounding scripts:
      
      Planning is not an acceptable prefix, this script is called on the
      current context, so let's use Base_ as a prefix.
      
      Planning_roundBoundToMinute → Base_roundPlanningBoxBoundToMinute
      Planning_roundBoundToDay → Base_roundPlanningBoxBoundToDay
      Planning_roundBoundToInt → Base_roundPlanningBoxBoundToInt
      65305527
    • Romain Courteaud's avatar
      fixup! [erp5_core/hal_json_style] Handle erp5js only view action · a1e7b8d1
      Romain Courteaud authored
      Fix an unexpected typo.
      See 71a3f9af
      a1e7b8d1
    • Romain Courteaud's avatar
    • Jérome Perrin's avatar
      Fix preferences cache · 4558c766
      Jérome Perrin authored
      * Fix the problem that preference cache was not reset when `setPreferredSomething` was called, only when `edit(preferred_something=)`
      * Implement something more advanced than just `portal_cache.clearCache()` so that when a user change their preference, only preference of this user are affected.
      * Increase default cache duration, now that we invalidate caches properly.
      
      /reviewed-on nexedi/erp5!983
      4558c766
    • Jérome Perrin's avatar
      monaco_editor: allow inclusion of external js · 0bfc33fd
      Jérome Perrin authored
      By using a magic comment such as
      
      ```javascript
         // erp5_monaco_editor_include: ../other.js other
      ```
      we can tell monaco editor that other.js will be loaded before the
      current javascript file, which helps the typescript compiler in
      diagnosing errors and providing completions.
      
      rsvp, renderjs and jio are still always loaded because they are used in
      almost all our javscripts.
      
      /reviewed-on !969
      0bfc33fd
    • Jérome Perrin's avatar
      Make erp5_administration pass coding style test · d692e641
      Jérome Perrin authored
      /reviewed-on !993
      d692e641
    • Jérome Perrin's avatar
      patches: patch OFS to bring back old __repr__ · 01c1218c
      Jérome Perrin authored
      When updating persistent to >= 4.4 `__repr__` of zope objects display
      information about ZODB connection but it's more useful to have
      information about the acquisition chain at this level.
      
      This happens because `persistent.Persistent.__repr__` is used instead of 
      `OFS.SimpleItem.Item.__repr__` (as of zope 2.13 ).
      
      One notable case was proxy field error messages, it was supposed to
      include the path of the proxy field in the error message. This one is
      fixed by fixing the MRO so that persistent.Persistent does not appear
      first.
      
      /reviewed-on !991
      01c1218c
    • Jérome Perrin's avatar
      Rework testXHTML to test all actions · 76060d41
      Jérome Perrin authored
      testXHTML was testing only document contained in modules, this take another approach to test all portal types and fixes the problems found now that we test views of all portal types.
      
      The number of tests in testXHTML also increase from 864 to 1137.
      
      /reviewed-on !992
      76060d41
  2. 28 Nov, 2019 16 commits
    • Sebastien Robin's avatar
      69b88b4b
    • Jérome Perrin's avatar
      administration: fixes for pylint · 00e1736b
      Jérome Perrin authored
      00e1736b
    • Jérome Perrin's avatar
      ERP5Type: define ConstraintMixin._checkConsistency · 592e3eae
      Jérome Perrin authored
      Without this, subclassing defining this method will have arguments-differ
      pylint warning because the signature of Base._checkConsistency is
      different.
      592e3eae
    • Jérome Perrin's avatar
      forge/administration: move some scripts to administration · ca05b59a
      Jérome Perrin authored
      These scripts are used to check the site configuration and also in
      CodingStyleTest.
      
      This is just the minimal so that CodingStyleTest can run, but this could
      be extended to several scripts currently in erp5_toolbox skinfolder of
      erp5_forge which overlaps with erp5_administration. Also, regarding
      CodingStyleTest, it seems that erp5_administration contain a lot of
      things, so we may want to extract a smaller business template containing
      only the scripts used for static analysis of business template.
      ca05b59a
    • Jérome Perrin's avatar
      administration: include new component types in "check source code" · 783add94
      Jérome Perrin authored
      We want this check to run on all components.
      783add94
    • Jérome Perrin's avatar
      CodingStyle: ignore more skins and prefixs · a4e0fb2d
      Jérome Perrin authored
      Module is an acceptable prefix for modules
      
      Introduce a list of skins IDs that does not match our conventions but
      are acceptable because this is what external API are calling.
      a4e0fb2d
    • Jérome Perrin's avatar
      testXHTML: test portal types also from tools · 56e16adc
      Jérome Perrin authored
      Some portal types such as Business Template were not tested by testXHTML
      because this tests started by modules and recursively tests views based
      on allowed content types. Because of this approach, types that are not
      created in a module but in a tool were never tested.
      
      With unittest, the only way to dynamically add test methods to a class
      is to generate a test class in test_suite function. At this stage, the
      ERP5 site is not created yet, so the test had to introspects business
      templates XML.
      
      This now uses a slightly different approach, instead of finding modules
      and chain of allowed content types from business template XML, we only
      use business template to introspect the list of actions.
      The lookup of the appropriate containers is no longer done before setup
      by static analysis of business templates XML, but later once the site is
      created, by dynamic analysis of the modules and allowed content types on
      the running ERP5 site during the test method.
      If we don't find a chain of portal types, we create the test document in
      portal_trash, a tool without filter of content types.
      
      This way, we can test all views of all portal types. This revealed a few
      problems:
       - we need developer role to create components in portal_components, for
      this we add developer role to the current user.
       - Delivery Cell portal type looks not used, there are no container
      accepting it. We don't test delivery cell views for this reason.
       - VCS view on business template needs preferences and working copy
      setup. We just mark this test as expected failure for now.
       - Solver Decision has a form conditionnaly displayed when there's a
      relation to a solver, but this test does not evaluate action conditions
      and does not allow to call a script (that would made it possible to
      modify the document so that the condition is true). For now we also
      mark this as expected failure.
      56e16adc
    • Jérome Perrin's avatar
      immobilisation: remove views from Delivery Cell · 439745de
      Jérome Perrin authored
      Delivery Cell is not really used these days and cannot be created in
      testXHTML, so drop these useless views.
      
      For reference, the same views still exists on all other movements portal
      types, so we don't "loose anything important" by removing the views
      here.
      439745de
    • Jérome Perrin's avatar
      budget: mark Budget Transfer view not visible · 36a87f63
      Jérome Perrin authored
      The corresponding form, BudgetTransfer_viewBudgetTransferLine does not
      exist, so mark view as not visible for now so that it's not tested.
      36a87f63
    • Jérome Perrin's avatar
      base: make Geographical Location "View on map" a jump action · d095b939
      Jérome Perrin authored
      This redirects to another site, so it is not really a view action.
      
      This also confuses testXHTML.
      d095b939
    • Jérome Perrin's avatar
      8ceb8452
    • Jérome Perrin's avatar
      core: support non initialized cache when viewing cache statistics · d88ec10f
      Jérome Perrin authored
      Maybe what's missing is an interaction to update cache internals with
      updateCache when a cache is added, but that's enough to make TestXHTML
      pass now.
      d88ec10f
    • Jérome Perrin's avatar
      ERP5: fix propertysheets for IdGenerator · fc1494d4
      Jérome Perrin authored
      DublinCore was missing, so getCompactTitle was causing AttributeError
      _baseGetTranslatedTitle
      fc1494d4
    • Jérome Perrin's avatar
      core: Workaround invalid html on AlarmTool_viewAlarmList · 1f51b19c
      Jérome Perrin authored
      When listboxs has an editable field, but the field is non editable, it
      produces a markup like:
        <a href="link to the line"><EditableField/></a>
      This is fine for most fields, but some editable fields are rendered as
      an <input> even if they are not editable - this is the case for
      CheckBoxField.
      To prevent rendering <a><input></a> which is not valid HTML, configure
      the enabled field as non-editable on alarm list view, with this change
      listbox treats the field as an editable field and just render the field
      as <EditableField/> without the <a>.
      To keep the same visual appearance of having a disabled checkbox field,
      make this field disabled with extra.
      1f51b19c
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      core/forge: fix scripts "Repository History" actions · d4f6a2cb
      Jérome Perrin authored
      The action was in erp5_core, but the form in erp5_forge. Move the action
      in erp5_forge.
      
      The listbox list method was raising error because it was using catalog
      with unsupported installation_state=. Change to use contentValues
      instead.
      
      This listbox had "Listbox" as a title, use "History" instead, which
      makes a little more sense in this context.
      d4f6a2cb
  3. 27 Nov, 2019 8 commits
  4. 26 Nov, 2019 1 commit