1. 11 Jul, 2024 40 commits
    • Rafael Monnerat's avatar
    • Rafael Monnerat's avatar
      erp5_oauth_[google|facebook]_login: Normalize get*Connector so we can use on login page · 55988caf
      Rafael Monnerat authored
        This is helpfull to display or not the buttons on login page
      55988caf
    • Rafael Monnerat's avatar
      erp5_core: Don't enable login buttons if the connector isnt configured · 6505490b
      Rafael Monnerat authored
        If the login button isnt suppose to work, dont display it.
      6505490b
    • Georgios Dagkakis's avatar
      Widget.py: Allow to set autocomplete also for hidden fields · eeb211c6
      Georgios Dagkakis authored
      We may want to set autocomplete 'off' or whatever other value
      eeb211c6
    • Vincent Pelletier's avatar
      Products.CMFActivity: Distribute all activities pending distribution · 3f2b98fa
      Vincent Pelletier authored
      Activity distribution (actually: validation) is fundamentally a bottleneck
      of the current CMFActivity design: there can be only one distribution/
      validation node, and it must check every single activity which express a
      dependency over any activity, until these dependencies are satisfied.
      As a result, distribution/validation is in the critical path between an
      activity being spawned and it being executed, and this work cannot be
      parallelised. So care should be taken to waste as little time as possible,
      in order to reduce the activity execution latency.
      
      Before this change, CMFActivity would distribute at most 1000 activities
      (MAX_VALIDATED_LIMIT) per queue per timerserver wake-up.
      In a typical ERP5 setup, timerserver ticks once per second, which means
      CMFActivity was unable to validate more than 1000 activities per second
      per queue. Maybe there are more activities which are possible to validate
      but still the code was forcing the node to sleep until the next wake-up,
      which is a tremendous waste of time.
      
      This change fixes that issue by having ActivityTool.distribute keep looping
      until there has been an iteration over all activity queues which
      simultaneously did not find any activity they could validate. This lets
      Zope yield CPU control when it would be better spent processing activities
      (those which are preventing the validation of any activities remaining to
      validate) without imposing a maximum effective validation-per-second
      hard limit.
      3f2b98fa
    • Vincent Pelletier's avatar
      Products.CMFActivity.SQLBase: Always commit before returning · b8a96ebf
      Vincent Pelletier authored
      Committing serves two purposes:
      - obviously: it makes any transactional data change persistent
      - less obviously: it releases the database transactional snapshot taken by
        any previously issued query, allowing that snapshot and all snapshots
        after it to be also freed (ex: garbage collecting the data records that
        no other transaction can see)
      In the current state of the code flow, this does not change much: after
      this method returns the code flow should quickly hit a commit anyway,
      either in dequeueMessage or before handing control back to timerserver,
      thereby ending the Zope-initiated transaction.
      But this will not be true in a future version of the code.
      b8a96ebf
    • Vincent Pelletier's avatar
      Products.CMFActivity: Inverse dequeueMessage return value · a1aee309
      Vincent Pelletier authored
      dequeueMessage used to return False when something was done, and True
      otherwise. The only caller which uses that value then reverses it, causing
      a double-negative which makes the code confusing to read.
      Inverse the meaning of the return value, getting rid of this double-
      negation.
      a1aee309
    • Romain Courteaud's avatar
      erp5_core: move test to erp5_core_test · 856418a1
      Romain Courteaud authored
      856418a1
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      38a3a655
    • Jérome Perrin's avatar
      core: fix redefined-builtin pylint violation · d55ec117
      Jérome Perrin authored
      from 705e0beb (AppliedRule._checkExpand: add parameters to filter objects + better reporting, 2024-06-17)
      d55ec117
    • Julien Muchembled's avatar
    • Roque's avatar
      erp5_web_monitoring: refactoring and fixes · f6bd37f4
      Roque authored
      - prepare import_export page to use multiple slapos-master urls (not fully implemented yet)
      - update queries, views, forms and gadgets to include slapos-master-url
      - drop gadget_erp5_jio, use jio gadget
      - minor graph refactoring
      - drop obsolete gadgets
      - fix and extend sync redirect options
      f6bd37f4
    • Roque's avatar
      7608fcfe
    • Roque's avatar
      erp5_officejs: minor graph refactoring · 7522f89c
      Roque authored
      7522f89c
    • Romain Courteaud's avatar
    • Romain Courteaud's avatar
      46d3346a
    • Romain Courteaud's avatar
    • Romain Courteaud's avatar
      erp5_core: add Base_reindexAndSenseAlarm script · 05e28e5b
      Romain Courteaud authored
      Trigger activeSense on an alarm after an object is indexed.
      The idea is to use this script in an interaction workflow to trigger the alarm.
      
      If called multiple times, try to reduce the number of alarm execution.
      05e28e5b
    • Romain Courteaud's avatar
      81398467
    • Romain Courteaud's avatar
      erp5_hal_json_style: set the locked status only at the end · 6a15caa2
      Romain Courteaud authored
      Prevent potential errors to be returned with 201 status
      6a15caa2
    • Romain Courteaud's avatar
    • Romain Courteaud's avatar
    • Romain Courteaud's avatar
      72b546c7
    • Romain Courteaud's avatar
      erp5_web_renderjs_ui: download OOoDocument when accessed by reference · 786a1c12
      Romain Courteaud authored
      Same behaviour than File/Image
      786a1c12
    • Romain Courteaud's avatar
    • Romain Courteaud's avatar
    • Romain Courteaud's avatar
      erp5_core: propagate the portal type during jump · 5e57f0aa
      Romain Courteaud authored
      It is needed if a module contains multiple object's portal types.
      5e57f0aa
    • Roque's avatar
      Revert "erp5_web_renderjs_ui: add onclick property on listbox rows links rendering" · 111c2a3d
      Roque authored
      - this reverts commit d8119beb.
      - risk of allowing JS injection
      111c2a3d
    • Kazuhiko Shiozaki's avatar
      Localizer: support python3 and polib 1.2.0 · 4f460203
      Kazuhiko Shiozaki authored
      Fix po_import behavior in Python 2.
      
      Newer versions of polib accept only unicode strings in the
      `pofile` function (because they check if they start by the decoded
      version of the BOM).
      I changed the `data` that is passed to `pofile` to be a unicode
      string in Python 2 too. This seems to work locally in my old
      version of polib, so that at least the old behavior should be
      kept the same.
      Co-authored-by: Carlos Ramos Carreño's avatarCarlos Ramos Carreño <carlos.ramos@nexedi.com>
      Co-authored-by: Jérome Perrin's avatarJérome Perrin <jerome@nexedi.com>
      4f460203
    • Jérome Perrin's avatar
      1704da3a
    • Jérome Perrin's avatar
      oauth_google_login: reimplement with oauthlib/requests · c9f5ef85
      Jérome Perrin authored
      Because the librairies used here were never ported to python3.
      
      Notable changes:
      
        - ERP5Site_createGoogleUserToOAuth is dropped
        - internal API changed radically, so customizations made by overriding
          scripts are broken.
        - the core logic is now implemented in a connector class (still in
          portal_oauth for simplicity, but it would be simpler to move it to
          portal_web_services)
      
      No changes required in the google console, the redirect uri is still
      ERP5Site_receiveGoogleCallback
      c9f5ef85
    • Kazuhiko Shiozaki's avatar
    • Jérome Perrin's avatar
      xhtml_style: fix form_dialog using a different condition for <legend> · 9948e469
      Jérome Perrin authored
      form_dialog was different from form_render (that is used in form_view
      and form_list) regarding the <legend> element for form groups:
      
       - the element was unconditionally present, unlike form_render where it
       is only displayed if non empty
       - the text was not translated
      9948e469
    • Jérome Perrin's avatar
      */form_render: update an outdated comment · d8a658ba
      Jérome Perrin authored
      There is no fallback on group id, if no group title, no legend is
      displayed
      d8a658ba
    • Jérome Perrin's avatar
      ERP5JS: display form groups legends · ac92635a
      Jérome Perrin authored
      This is same as "xhtml_style: display form groups legends", but applied
      to ERP5JS.
      
      The returned type of `group_list` changed in the API, it use to be a
      list of lists with 2 elements: group id (str) and field list (list),
      it is now a list with 3 elements: group id (str), field list (list)
      and group title (str).
      
      There's now a new `legend` element in the DOM, only when the group has a
      title.
      ac92635a
    • Jérome Perrin's avatar
      xhtml_style: display form groups legends · 80962da1
      Jérome Perrin authored
      For erp5_web it is possible to define form groups following a naming
      rule "group_id (Group Title)" and "Group Title" is displayed in a legend,
      according to this comment in form_render.zpt:
      
      > It is possible to specify a group id and a group title by naming a group following the
      >   "group id (Group Title)" pattern. In this case the group id will be used as fieldset css
      >   class and as tag id. The group title will be used as a legend for the fieldset. If no group
      >   title is found, we use group id as title.
      
      For historical reasons, the legend was hidden, this feature was only
      used in erp5_web, but this does not seem bad to enable it in
      erp5_xhtml_style as well.
      
      At the moment, this is not used much, this script
      
      ```py
      for sf in context.getPortalObject().portal_skins.objectValues():
        for f in sf.objectValues():
          if not hasattr(f, 'get_groups'):
            continue
          for group in f.get_groups():
            if '(' in group:
              print('/'.join(f.getPhysicalPath()[1:]), group)
      
      return printed
      ```
      
      when running on a site with many business template installed yields
      
      ```
      erp5/portal_skins/erp5_base/EmbeddedFile_view left (Document Reference)
      erp5/portal_skins/erp5_base/EmbeddedFile_view right (Publication Information)
      erp5/portal_skins/erp5_base/NotificationMessage_viewEditor left (Page Properties)
      erp5/portal_skins/erp5_knowledge_pad/Base_viewKnowledgePadFieldLibrary right column (Toolbox)
      erp5/portal_skins/erp5_web/StaticWebSite_viewRedirectAssistConfiguration left (Style)
      erp5/portal_skins/erp5_web/WebPage_view left (Page Properties)
      erp5/portal_skins/erp5_web/WebPage_view right (Publication)
      erp5/portal_skins/erp5_web/WebPage_view bottom (Content)
      erp5/portal_skins/erp5_web/WebPage_viewEditor left (Page Properties)
      erp5/portal_skins/erp5_web/WebPage_viewFieldLibrary left (Page Properties)
      erp5/portal_skins/erp5_web/WebPage_viewFieldLibrary right (Publication)
      erp5/portal_skins/erp5_web/WebPage_viewFieldLibrary bottom (Content)
      erp5/portal_skins/erp5_web/WebSection_view left (Content)
      erp5/portal_skins/erp5_web/WebSection_view right (Layout)
      erp5/portal_skins/erp5_web/WebSection_view center (Description)
      erp5/portal_skins/erp5_web/WebSection_view bottom (Subsections)
      erp5/portal_skins/erp5_web/WebSection_viewDefaultThemeConfiguration left (Style)
      erp5/portal_skins/erp5_web/WebSection_viewDefaultThemeConfiguration right (Widgets)
      erp5/portal_skins/erp5_web/WebSite_view left (Content)
      erp5/portal_skins/erp5_web/WebSite_view right (Layout)
      erp5/portal_skins/erp5_web/WebSite_view center (Description)
      erp5/portal_skins/erp5_web/WebSite_view bottom (Subsections)
      erp5/portal_skins/erp5_web/WebSite_viewRegistrationDialog left (User Login)
      erp5/portal_skins/erp5_web/WebSite_viewRegistrationDialog right (User Identity)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column transparent (Logo)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Navigation)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Sections)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Contents)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Search)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Debug)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout right column (News)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout right column (Toolbox)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout right column (Highlight)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column transparent (Logo)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Navigation)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Sections)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Contents)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Search)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Debug)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout right column (News)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout right column (Toolbox)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout right column (Highlight)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout right column (Action)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column transparent (Logo)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Navigation)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Sections)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Contents)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Search)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Debug)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout right column (News)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout right column (Toolbox)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout right column (Highlight)
      erp5/portal_skins/erp5_dms/Document_viewFieldLibrary left (Document Reference)
      erp5/portal_skins/erp5_dms/Document_viewFieldLibrary right (Publication Information)
      erp5/portal_skins/erp5_dms/ExternalSource_view left (Document Reference)
      erp5/portal_skins/erp5_dms/ExternalSource_view right (Publication Information)
      erp5/portal_skins/erp5_dms/OOoDocument_view left (Document Reference)
      erp5/portal_skins/erp5_dms/OOoDocument_view right (Publication Information)
      erp5/portal_skins/erp5_dms_base/File_view left (Document Reference)
      erp5/portal_skins/erp5_dms_base/File_view right (Publication Information)
      erp5/portal_skins/erp5_dms_base/Image_view left (Document Reference)
      erp5/portal_skins/erp5_dms_base/Image_view right (Publication Information)
      erp5/portal_skins/erp5_dms_web/WebIllustration_view left (Document Reference)
      erp5/portal_skins/erp5_dms_web/WebIllustration_view right (Publication Information)
      erp5/portal_skins/erp5_dms_web/WebIllustration_view bottom (Preview)
      erp5/portal_skins/erp5_dms_web/WebPage_view left (Document Reference)
      erp5/portal_skins/erp5_dms_web/WebPage_view right (Publication Information)
      erp5/portal_skins/erp5_dms_web/WebPage_view bottom (Preview)
      erp5/portal_skins/erp5_multimedia/Sound_view left (Document Reference)
      erp5/portal_skins/erp5_multimedia/Sound_view right (Publication Information)
      erp5/portal_skins/erp5_run_my_doc/Review_view left (Document Reference)
      erp5/portal_skins/erp5_run_my_doc/Review_view right (Publication Information)
      erp5/portal_skins/erp5_run_my_doc/TestPage_view left (Document Reference)
      erp5/portal_skins/erp5_run_my_doc/TestPage_view right (Publication Information)
      erp5/portal_skins/erp5_run_my_doc/TestPage_view bottom (Preview)
      erp5/portal_skins/erp5_run_my_doc/TestPage_viewFieldLibrary left (Page Properties)
      erp5/portal_skins/erp5_run_my_doc/TestPage_viewFieldLibrary right (Publication)
      erp5/portal_skins/erp5_run_my_doc/TestPage_viewFieldLibrary bottom (Content)
      erp5/portal_skins/erp5_run_my_doc/TestPage_viewTestReport bottom (Content)
      erp5/portal_skins/erp5_officejs_slideshow_editor/WebPage_viewForSlideshowEditor bottom (Preview)
      erp5/portal_skins/erp5_credential/CredentialRequest_view left (Personal Information)
      erp5/portal_skins/erp5_credential/CredentialRequest_view left (Organisation Information)
      erp5/portal_skins/erp5_credential/CredentialRequest_view right (Login Information)
      erp5/portal_skins/erp5_credential/CredentialUpdate_view left (Personal Information)
      erp5/portal_skins/erp5_credential/CredentialUpdate_view left (Organisation Information)
      erp5/portal_skins/erp5_credential/CredentialUpdate_view right (Login Information)
      erp5/portal_skins/erp5_km/WebSection_viewKMMinimalThemeConfiguration left (Colors)
      erp5/portal_skins/erp5_km/WebSection_viewKMMinimalThemeConfiguration right (Static Content)
      erp5/portal_skins/erp5_km/WebSection_viewKMMinimalThemeConfiguration left (Navigation)
      erp5/portal_skins/erp5_km/WebSection_viewKMMinimalThemeConfiguration right (Gadgets)
      erp5/portal_skins/erp5_km_theme/Base_viewKMFieldLibrary right column (Toolbox)
      erp5/portal_skins/erp5_km_theme/WebSection_viewMinimalKMWidgetFieldLibrary bottom gadget (Bottom Gadget)
      erp5/portal_skins/erp5_km_theme/WebSection_viewMinimalKMWidgetFieldLibrary right column gadget (Right Gadget)
      erp5/portal_skins/erp5_km_theme/erp5_km_minimal_content_layout bottom gadget (Bottom Gadget)
      erp5/portal_skins/erp5_km_theme/erp5_km_minimal_content_layout right column gadget (Right Gadget)
      erp5/portal_skins/erp5_km_theme/erp5_km_minimal_layout bottom gadget (Bottom Gadget)
      erp5/portal_skins/erp5_km_theme/erp5_km_minimal_layout right column gadget (Right Gadget)
      erp5/portal_skins/erp5_km_theme/login_form left registration (Login)
      erp5/portal_skins/erp5_km_theme/login_form right registration (New User Registration)
      ```
      
      and this does not look bad when viewing the forms.
      80962da1
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      4f29beeb
    • Jérome Perrin's avatar