1. Status Messages which floats to the top right of the page as a pop-up message and has a close button.
2. It has configuration until how much time we want to display the message For eg [5 seconds, 10 seconds, etc].
3. After selected time status message will be faded out and will hide from the display.

Project link

https://www.drupal.org/project/status_messages

Git instructions

git clone --branch 8.x-4.x https://git.drupalcode.org/project/status_messages.git

PAReview checklist

https://pareview.sh/pareview/https-git.drupal.org-project-status_message...

Comments

Neslee Canil Pinto created an issue. See original summary.

neslee canil pinto’s picture

Title: Status Messages Module » [D8] Status Messages Module
neslee canil pinto’s picture

Issue summary: View changes
neslee canil pinto’s picture

Issue summary: View changes
avpaderno’s picture

Issue summary: View changes

Thank you for applying! I added the Git instructions for non-maintainer users and the PAReview checklist link. Reviewers will check the project and post comments to list what should be changed.

If you haven't done it, yet, please check the PAReview report and fix what needs to be fixed. There could be some false positives; verify that what reported is correct, before making any change.

avpaderno’s picture

Issue summary: View changes
shaktik’s picture

Review of the 8.x-4.x branch (commit d33453b):

  • Your README.txt does not follow best practices (headings need to be uppercase). See https://www.drupal.org/node/2181737 .
    • The INTRODUCTION section is missing.
    • The REQUIREMENTS section is missing.
    • The INSTALLATION section is missing.
    • The CONFIGURATION section is missing.
  • Bad line endings were found, always use unix style terminators. See https://www.drupal.org/coding-standards#indenting
    
    img/cancel.svg
    img/checked.svg
    img/warning.svg
    
  • ESLint has found some issues with your code (please check the JavaScript coding standards).
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/status_messages.js: line 6, col 2, Error - Use the function form of 'use strict'. (strict)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/status_messages.js: line 7, col 5, Error - Expected indentation of 2 spaces but found 4. (indent)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/status_messages.js: line 8, col 9, Error - Expected indentation of 6 spaces but found 8. (indent)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/status_messages.js: line 12, col 13, Error - Expected space(s) after "if". (keyword-spacing)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/status_messages.js: line 15, col 15, Error - Expected indentation of 12 spaces but found 14. (indent)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/status_messages.js: line 21, col 48, Warning - Too many nested callbacks (4). Maximum allowed is 3. (max-nested-callbacks)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/status_messages.js: line 24, col 9, Error - Expected indentation of 10 spaces but found 8. (indent)
    
    7 problems
    
  • No automated test cases were found, did you consider writing PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script.

avpaderno’s picture

Status: Needs review » Needs work
neslee canil pinto’s picture

Status: Needs work » Needs review
Bad line endings were found, always use unix style terminators. See https://www.drupal.org/coding-standards#indenting

img/cancel.svg
img/checked.svg
img/warning.svg

What can be done for this, Others are been fixed

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +PAreview: single application approval
  • What follows is a quick review of the project; it doesn't mean to be complete
  • For every point, I didn't make a complete list of where the code should be fixed, but an example of what is wrong in the code
  • Not all the points are application stoppers; some of them describe changes that would be preferable to make
    $options = [
      5000 => '5 Seconds',
      10000 => '10 Seconds',
      15000 => '15 Seconds',
      20000 => '20 Seconds',
      3600000 => 'Never',
    ];
    $form['configuration']['time'] = [
      '#type' => 'select',
      '#options' => $options,
      '#title' => $this->t('Time'),
      '#default_value' => $config->get('time'),
      '#description' => $this->t('Close status message automatically after above seconds.'),
    ];

Strings shown in the user interface needs to be passed to $this->t() (in this case), including the options for a form element.

      {%
        set classes = [
        'status-messages',
        'messages--' ~ type,
      ]
      %}

It is preferable to do as Drupal core does, for example, in html.html.twig, and use the following code.

      {%
        set classes = [
        'status-messages',
        'messages--' ~ type|clean_class,
      ]
      %}
<div class="simple-status-messages">
  {% block messages %}
    {% for type, messages in message_list %}
      {%
        set classes = [
        'status-messages',
        'messages--' ~ type,
      ]
      %}
      <div role="contentinfo" aria-label="{{ status_headings[type] }}"{{ attributes.addClass(classes)|without('role', 'aria-label') }}>
        <a href="#" class="status-messageclose" title="Close">×</a>
        {{ enabled }}
        {% if type == 'error' %}
        <div role="alert">
          {% endif %}
          {% if status_headings[type] %}
            <h2 class="visually-hidden">{{ status_headings[type] }}</h2>
          {% endif %}
          {% if messages|length > 1 %}
            <ul class="messages__list">
              {% for message in messages %}
                <li class="messages__item">{{ message }}</li>
              {% endfor %}
            </ul>
          {% else %}
            {{ messages|first }}
          {% endif %}
          {% if type == 'error' %}
        </div>
        {% endif %}
      </div>
      {# Remove type specific classes. #}
      {% set attributes = attributes.removeClass(classes) %}
    {% endfor %}
  {% endblock messages %}
</div>

A better indentation would make the code more readable.

  Drupal.behaviors.statusMessages = {
    attach: function (context, settings) {
      var time = drupalSettings.time;
      $(document).ready(function () {
        // Close status message after some seconds.
        if (time === null) {
          time = '5000';
        }
        setTimeout(function () {
          $('.simple-status-messages').fadeOut('slow');
        }, time);

        // When a close button is clicked hide this message.
        $('.simple-status-messages .status-messages .status-messageclose').click(function () {
          $(this).parent().fadeOut('slow');
        });
      });
    }
  };
})(jQuery, Drupal, drupalSettings);

attach() receives settings as argument, and it should use that instead of the global variable. While they usually contain the same object, in the case of AJAX invocations, the objects can be different.

neslee canil pinto’s picture

Status: Needs work » Needs review

Made all the changes mentioned in #10

avpaderno’s picture

SVG files are XML files you can edit with a text editor.
It's a bit tricky, as the default program that opens a SVG file is an application to show or edit images. I am not sure there are image applications that have a setting to change the line endings used for SVG files; I find editing them with a text editor easier.

neslee canil pinto’s picture

So are we set to go. Fixed all the changes which you have asked. Thanks

avpaderno’s picture

Status: Needs review » Fixed
Issue tags: -PAreview: single application approval

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

neslee canil pinto’s picture

Thank you @kiamlaluno

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.