? NPM Resource Changed PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
25 Jan 2023

Pull Request for Issue # .

Summary of Changes

  • Remove all the eslint rule overrides
  • Change some imports/exports to default
  • Add the missing props on many components

Also, and this one is important and the reason I did this PR, stop mutation store values outside of the store. The vue docs are very clear on this one: https://eslint.vuejs.org/rules/no-side-effects-in-computed-properties.html#rule-details
The instance that was wrongly mutating the store is:

    /* Get the contents of the currently selected directory */
    items() {
      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
      const directories = this.$store.getters.getSelectedDirectoryDirectories
        // Sort by type and alphabetically
        .sort((a, b) => ((a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1))
        .filter((dir) => dir.name.toLowerCase().includes(this.$store.state.search.toLowerCase()));

      // eslint-disable-next-line vue/no-side-effects-in-computed-properties
      const files = this.$store.getters.getSelectedDirectoryFiles
        // Sort by type and alphabetically
        .sort((a, b) => ((a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1))
        .filter((file) => file.name.toLowerCase().includes(this.$store.state.search.toLowerCase()));

      return [...directories, ...files];
    },

And is replaced with

    /* Get the contents of the currently selected directory */
    localItems() {
      const directories = this.$store.getters.getSelectedDirectoryDirectories.slice(0)
        // Sort by type and alphabetically
        .sort((a, b) => ((a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1))
        .filter((dir) => dir.name.toLowerCase().includes(this.$store.state.search.toLowerCase()));

      const files = this.$store.getters.getSelectedDirectoryFiles.slice(0)
        // Sort by type and alphabetically
        .sort((a, b) => ((a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1))
        .filter((file) => file.name.toLowerCase().includes(this.$store.state.search.toLowerCase()));

      return [...directories, ...files];
    },

The rename from items to localItems was on purpose to emphasise that this is a local representation of the data!!!

Testing Instructions

Apply the PR, run npm ci and check that the media manager is still working

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@laoneo

a32cabf 25 Jan 2023 avatar dgrammatiko CS
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jan 2023
Category JavaScript Administration com_media NPM Change
avatar dgrammatiko dgrammatiko - open - 25 Jan 2023
avatar dgrammatiko dgrammatiko - change - 25 Jan 2023
Status New Pending
avatar dgrammatiko dgrammatiko - change - 25 Jan 2023
The description was changed
avatar dgrammatiko dgrammatiko - edited - 25 Jan 2023
avatar dgrammatiko dgrammatiko - change - 25 Jan 2023
The description was changed
avatar dgrammatiko dgrammatiko - edited - 25 Jan 2023
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jan 2023
Category JavaScript Administration com_media NPM Change JavaScript Administration com_media NPM Change Repository
avatar dgrammatiko dgrammatiko - change - 25 Jan 2023
Labels Added: NPM Resource Changed PR-4.3-dev
avatar dgrammatiko dgrammatiko - change - 25 Jan 2023
Title
[4.3] Media Manger Remove (almost) all eslint inline rule overrides
[4.3] Media Manger Remove all the eslint inline rule overrides
avatar dgrammatiko dgrammatiko - edited - 25 Jan 2023
avatar Quy
Quy - comment - 25 Jan 2023

See text briefly displayed upon loading Media Manager.

39709-mm

avatar Quy
Quy - comment - 26 Jan 2023

Remove gap/spacing.

39709-gap

af07e35 26 Jan 2023 avatar dgrammatiko CS
avatar Quy
Quy - comment - 26 Jan 2023

Create a folder.
Open it.
See untranslated string and gap.

39709-empty

avatar dgrammatiko
dgrammatiko - comment - 26 Jan 2023

@Quy I fixed the border gap but the untranslated string comes from my wrong reset of the base branch when I was testing #39518. In sort #39518 needs to be merged before this PR

@obuisard could you merge #39518 ?

avatar obuisard
obuisard - comment - 26 Jan 2023

@obuisard could you merge #39518 ?

@dgrammatiko I can merge it for you but it's on the 4.2 branch. You will have to wait for the up-merge to get this fixed in 4.3

avatar dgrammatiko
dgrammatiko - comment - 26 Jan 2023

@obuisard don't merge it on 4.2, rebase it on 4.3 as it's a new feature and then merge it...

avatar obuisard
obuisard - comment - 26 Jan 2023

@obuisard don't merge it on 4.2, rebase it on 4.3 as it's a new feature and then merge it...

Now there are conflicts that need to be fixed first

avatar Quy
Quy - comment - 26 Jan 2023

Maybe it is not the case in the other PR, but can you look to moving the no media message below the table? Thanks.

39709-list

avatar dgrammatiko
dgrammatiko - comment - 26 Jan 2023

@Quy ok, I removed the empty state text as it's obviously not ready yet

avatar Quy Quy - test_item - 26 Jan 2023 - Tested successfully
avatar Quy
Quy - comment - 26 Jan 2023

I have tested this item successfully on 9d2747b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39709.

avatar viocassel viocassel - test_item - 27 Jan 2023 - Tested successfully
avatar viocassel
viocassel - comment - 27 Jan 2023

I have tested this item successfully on 9d2747b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39709.

avatar Quy Quy - change - 27 Jan 2023
Status Pending Ready to Commit
avatar Quy
Quy - comment - 27 Jan 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39709.

avatar laoneo laoneo - close - 27 Jan 2023
avatar laoneo laoneo - merge - 27 Jan 2023
avatar laoneo laoneo - change - 27 Jan 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-01-27 07:51:51
Closed_By laoneo
Labels Added: ?
avatar laoneo
laoneo - comment - 27 Jan 2023

Thanks!!

Add a Comment

Login with GitHub to post a comment