Giter VIP home page Giter VIP logo

redirecthandler-ui's Introduction

Neos.RedirectHandler.Ui

Latest Stable Version License

This package provides a backend module to manage Neos.RedirectHandler redirects which are stored in Neos.RedirectHandler.DatabaseStorage.

Compatibility and Maintenance

This package is compatible with Neos 4.3, 5.x, 7.x and will be maintained for upcoming versions.

Installation

  1. Run the following command in your site package:

    composer require neos/redirecthandler-ui --no-update

  2. If you don't have dependencies for the other redirect packages yet you should also run the following command:

    composer require neos/redirecthandler-neosadapter neos/redirecthandler-databasestorage --no-update

  3. Run composer update in your projects root folder.

  4. Then you can add the RedirectAdministrator role to the users who need access to the new backend module.

Screenshots

Listing and editing redirects:

Redirects Module Screenshot

Search & filter redirects:

Filtering redirects

Documentation

This package belongs to a group of packages which provides redirect functionality to the Flow Framework and to Neos. Therefore you can find the documentation regarding Neos here.

Contributing

Please create issues on Github if you encounter bugs or other issues.

Working on the code

The basis of the backend module is built with Fusion and the UI for managing the redirects is built with React and Typescript.

Recompiling the js and css parts

  1. Use nvm so you have the correct npm version.
  2. Run yarn in the package folder.
  3. Run yarn watch during development or yarn build for a new release.

License

See the License.

redirecthandler-ui's People

Contributors

ahaeslich avatar albe avatar breadlesscode avatar crydotsnake avatar dependabot[bot] avatar dlubitz avatar gerdemann avatar iseries avatar jonnitto avatar kdambekalns avatar markusguenther avatar mficzel avatar neos-project avatar patricekaufmann avatar sbruggmann avatar sebobo avatar weblate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

redirecthandler-ui's Issues

JavaScript crashes when window.Typo3Neos.I18n is not defined yet

Sometimes, due to certain circumstances, the following code in index.tsx crashes:

    while (!window.Typo3Neos || !window.Typo3Neos.I18n.initialized) {
        await new Promise(resolve => setTimeout(resolve, 50));
    }

At this point window.Typo3Neos is available but I18n is not, so JS throws the following error:

image

This is happening rather randomly and might depend on network speed, loading order of the JS files etc.

A simple fix would be to check for availability of the I18n object on the Typo3Neos object.

Edit: Probably related to neos/neos at version 7.1 since the public JS got refactored in that version

Composer cannot install package (Neos 4.3)

I can't install this package using the newest Neos (4.3). I followed the instuctions and got this composer error:

Problem 1

  • neos/redirecthandler-ui 2.0.0 requires neos/redirecthandler ~3.0 || dev-master -> satisfiable >by neos/redirecthandler[3.0.0].
  • neos/redirecthandler-ui 2.0.1 requires neos/redirecthandler ~3.0 || dev-master -> satisfiable >by neos/redirecthandler[3.0.0].
  • neos/redirecthandler-ui 2.0.2 requires neos/redirecthandler ~3.0 || ~4.0 -> satisfiable by >neos/redirecthandler[3.0.0, 4.0.0].
  • neos/redirecthandler 4.0.0 requires neos/flow ^6.0 -> satisfiable by neos/flow[6.0.x-dev] but >these conflict with your requirements or minimum-stability.
  • neos/redirecthandler 3.0.0 requires neos/redirecthandler-storageimplementation ~3.0 -> no >matching package found.
  • Installation request for neos/redirecthandler-ui ^2.0 -> satisfiable by neos/redirecthandler->ui[2.0.0, 2.0.1, 2.0.2].

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

My composer.json:
composer.zip

Refactor fluid to Fusion templating

This can be similarly done like in the history controller of Neos and would lead to the following benefits:

  • Easier to modify and extend
  • We don't use form helpers for now but later replace the used form html tags with fusion forms in Neos 5.0 (planned)
  • We want to have Fusion based backend modules in the long term

Entering an asterisk as host can create confusion

When entering an asterisk the result will be that the created redirect will not work as it will never match a normal host.

This is not such a big issue, but the problem is impossible to see in the redirect list as we render an asterisk when the host field is empty. Therefore both variants look the same but behave differently.

This could also be solved together with #18. At some point we need a good regex for validating the host field too.

Uncaught (in promise) TypeError: Cannot read property 'I18n' of undefined

Hi,

we run with one of our Portals in this Issue.

Uncaught (in promise) TypeError: Cannot read property 'I18n' of undefined
    at main.bundle.js:formatted:20354
    at main.bundle.js:formatted:20312
    at Object.next (main.bundle.js:formatted:20325)
    at main.bundle.js:formatted:20231
    at new Promise (<anonymous>)
    at e (main.bundle.js:formatted:20208)
    at window.onload (main.bundle.js:formatted:20349)
    at t.<computed> (rocket-loader.min.js:1)
    at l (rocket-loader.min.js:1)
    at t.simulateStateAfterDeferScriptsActivation (rocket-loader.min.js:1)

But when i check the property window.Typo3Neos.I18n in the console and we get this callback

window.Typo3Neos.I18n
  u {initialized: true, __ember1631000395963: undefined, _super: undefined, __ember1631000395963_meta: p}
    initialized: true
    __ember1631000395963: undefined
    __ember1631000395963_meta: p {descs: {…}, watching: {…}, cache: {…}, source: u, proto: u}
    _super: undefined
    [[Prototype]]: u

I don't know if the return setTimeout(e, 50) time is to short?

Our Packages that we use.

PACKAGES:
 Neos.Cache                                5.3.28
 Neos.ContentRepository                    4.3.19
 Neos.Diff                                 4.3.19
 Neos.Eel                                  5.3.28
 Neos.Flow                                 5.3.28
 Neos.Flow.Log                             5.3.28
 Neos.FluidAdaptor                         5.3.28
 Neos.Form                                 4.3.3
 Neos.Form.Builder                         1.3.0
 Neos.Fusion                               4.3.19
 Neos.Fusion.Afx                           1.4.1
 Neos.Imagine                              3.2.0
 Neos.Media                                4.3.19
 Neos.Media.Browser                        4.3.19
 Neos.Neos                                 4.3.19
 Neos.Neos.Ui                              4.0.14
 Neos.Neos.Ui.Compiled                     4.0.14
 Neos.NodeTypes                            4.3.19
 Neos.NodeTypes.AssetList                  4.3.19
 Neos.NodeTypes.BaseMixins                 4.3.19
 Neos.NodeTypes.ColumnLayouts              4.3.19
 Neos.NodeTypes.ContentReferences          4.3.19
 Neos.NodeTypes.Form                       4.3.19
 Neos.NodeTypes.Html                       4.3.19
 Neos.NodeTypes.Navigation                 4.3.19
 Neos.Party                                5.0.2
 Neos.RedirectHandler                      3.0.3
 Neos.RedirectHandler.DatabaseStorage      4.1.0
 Neos.RedirectHandler.NeosAdapter          4.3.0
 Neos.RedirectHandler.Ui                   2.4.4
 Neos.Seo                                  3.0.6
 Neos.Setup                                4.0.6
 Neos.SwiftMailer                          6.0.5
 Neos.Twitter.Bootstrap                    3.0.6
 Neos.Utility.Arrays                       5.3.28
 Neos.Utility.Files                        5.3.28
 Neos.Utility.MediaTypes                   5.3.28
 Neos.Utility.ObjectHandling               5.3.28
 Neos.Utility.OpcodeCache                  5.3.28
 Neos.Utility.Pdo                          5.3.28
 Neos.Utility.Schema                       5.3.28

console.log in main.bundle.js leads to problems in Firefox

There is a console.log in the generated JS file which is not in index.tsx (before line 12). Is it out of sync? Debugging leftovers?

This leads to the following exception in Firefox:

Uncaught (in promise) TypeError: window.Typo3Neos is undefined
    onload index.tsx:12
    s index.tsx:10
    s index.tsx:10
    e index.tsx:10
    e index.tsx:10
    onload index.tsx:10
    zo2T index.tsx:10
    f main.bundle.js:1
    parcelRequire main.bundle.js:1
    <anonymous> main.bundle.js:1

Neos 4.1 compatible

Hi,

thanks for this great plugin, is this plugin Neos 4.1 compatible?

Greetings

Filter by domain in backend module

It would be great to have a filter option "Domain" in the Backend module. This would make managing redirects in multisite/domain environments much easier.

Improve UX for adding and editing redirects

Current behavior

After I add or update a redirect only that redirect is shown without an explanation.

First I thought this was a bug and only after looking at the code I saw that it "searches" for it after updating it.

It's also a bit hard to guess how to use the search feature.

Idea

  • Split the controller code to actually use actions instead of the conditions based on the arguments.
  • Separate search from add-feature and maybe just use one field which allows searching in all redirect fields.
  • Give note to user when search happened and for what and how to reset it.
  • Have a dropdown for Status Code with explanations instead of the free input

Bug: After importing a CSV resource:clean fails

After importing a CSV file (urls_to_import.csv) with URLs in redirecthandler-ui i get an error when publishing resources (with resource:clean).

Error: Could not publish resource urls_to_import.csv with SHA1 hash xxx of collection persistent because there seems to be no corresponding data in the storage.

I guess the csv Files get deleted but not removed from persistentresource Tables @Sebobo?

resource:clean helps to fix the problem.

Rendering breaks when too many redirects exist

We faced a strange error where the whole rendering broke and no HTML was rendered at all. We found out that if the JSON with the redirects is too big, the browser rendering breaks. I already found a fix where we would move the redirects JSON to a separate script tag and get the data from it, which works. I'll prepare a pull request tomorrow.

BE-Module Error on Neos 5 / Flow 6 Undefined property: $flashMessageContainer

Running on the dev-dist for neos 5 /flow 6 i get the following error in the be-module.

Notice: Undefined property: Neos\RedirectHandler\Ui\Controller\ModuleController::$flashMessageContainer in /Users/MFI/PhpstormProjects/neos-development-distribution-5.0/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_RedirectHandler_Ui_Controller_ModuleController.php line 138

Exception Code | 1
-- | --
Neos\Flow\Error\Exception
20190918063756053250
Packages/Framework/Neos.Flow/Classes/Error/ErrorHandler.php
81

Help text or domain list for host name field

image

The host name field currently suggests entering a domain. As a non-technical user, I cannot assume that I can leave this field empty and the redirect would be valid for all domains.

I think it would be user-friendly to render a select box. By default, the value would be * and the label "All domain". The other items would be fed from all (active?) domains in the domain management.

If this somehow doesn't make sense, I suggest to place a help text.

Redirects for entire domain

Is there a way to enable redirects for an entire domain?
For example we'd like to redirect "old" Domains or "dev-domains" to the production URI.

thanks for a quick hint @Sebobo

Export to CSV does not offer download

With the latest version on a current Neos 5 the export does not work. Clicking export brings me back to the list, the request sent does not even mention the exportCsv action, even though the form's action attribute does.

Probably because some JS submit magic goes wrong, the console shows Empty string passed to getElementById(). when I click the export button.

Link Checker

It would be awesome to have a "Link-Checker" who checks the http status of every redirect.
This could be triggered after an import or from time to time to check if the target still exist.

Creating a "link-check-command" could be done pretty fast 🤔
Interested in a PR @Sebobo?

Create compatibility layer for JavaScript API window.Typo3Neos

Since Neos 7.1 window.Typo3Neos is deprecated and in Neos 8.0 the API is gone and needs the replacement window.NeosCMS. As we had the compatibility layer in Neos before, we need that now in the RedirectHandler UI itself to be able to use the same JS code in all supported Neos versions.

Make hit counter for redirects better configurable

I think it makes sense to have the hit counter on certain types of redirects.
Either based on the status code or actually configured for each redirect separately.

Having it active by default might be an issue for sites with lots of traffic.

Redirect list is not loading - Errors in Dev Console

Hi,

we run in some Issues.
The redirect list is not loading. And we got some Error Messages in the console.

Console from Chrome

bootstrap.min.js:6 Uncaught TypeError: e is not a function
    at bootstrap.min.js:6:27
    at bootstrap.min.js:6:352
(anonymous) @ bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6
fixedsticky.js:185 Uncaught ReferenceError: jQuery is not defined
    at fixedsticky.js:185:11
(anonymous) @ fixedsticky.js:185
redirects:316 Uncaught ReferenceError: jQuery is not defined
    at redirects:316:7
(anonymous) @ redirects:316
ContentModule-built.js?bust=e93a454378f6:428 Uncaught TypeError: Cannot read properties of undefined (reading 'requirejs')
    at ContentModule-built.js?bust=e93a454378f6:428:1137619
(anonymous) @ ContentModule-built.js?bust=e93a454378f6:428
redirects:325 Uncaught ReferenceError: $ is not defined
    at redirects:325:4

And Console from Firefox

Uncaught TypeError: e is not a function
    <anonymous> https://www.basel.com/_Resources/Static/Packages/Neos.Twitter.Bootstrap/2/js/bootstrap.min.js:6
    <anonymous> https://www.basel.com/_Resources/Static/Packages/Neos.Twitter.Bootstrap/2/js/bootstrap.min.js:6
[bootstrap.min.js:6:28](https://www.basel.com/_Resources/Static/Packages/Neos.Twitter.Bootstrap/2/js/bootstrap.min.js)
Uncaught ReferenceError: jQuery is not defined
    <anonymous> https://www.basel.com/_Resources/Static/Packages/Neos.Neos/Library/fixedsticky/fixedsticky.js:14
[fixedsticky.js:14:1](https://www.basel.com/_Resources/Static/Packages/Neos.Neos/Library/fixedsticky/fixedsticky.js)
Uncaught ReferenceError: jQuery is not defined
    <anonymous> https://www.basel.com/neos/management/redirects:316
[redirects:316:1](https://www.basel.com/neos/management/redirects)
Uncaught TypeError: window.T3Configuration is undefined
    <anonymous> https://www.basel.com/_Resources/Static/Packages/Neos.Neos/JavaScript/ContentModule-built.js?bust=e93a454378f6:53
ContentModule-built.js:53:1137616
Uncaught ReferenceError: $ is not defined
    <anonymous> https://www.basel.com/neos/management/redirects:325

We use

 Neos.Neos                                 4.3.19 
 Neos.RedirectHandler                      3.0.3          
 Neos.RedirectHandler.DatabaseStorage      4.1.0          
 Neos.RedirectHandler.NeosAdapter          4.3.0          
 Neos.RedirectHandler.Ui                   2.4.4

A few weeks ago i had the same issue. I can fix it with this workaround

  1. Export all redirects.
  2. Remove all redirects over console.
  3. Add all redirects in neos backend.
  4. Some redirects where marked in orange.
  5. I delete the orange marked redirects and everthing run fine again.

But this time. This Workaround is not working.

Do you have any Ideas?

Allow redirects from "illegal" chars

When trying to create a redirect from interview/kinder_fotografieren to interview/kinder-fotografieren the UI disallows submitting the form. This is because the source path is checked against the pattern ^[a-zA-Z0-9\-\/\.]+$, mimicking the allowed paths in Neos.

In my case that is precisely whe the redirect is needed, Wordpress allowed _, Neos does not. I hacked the pattern (using the web inspector), and could store and use the redirect just fine.

What other characters could/should be allowed here?

Use dropdown to select redirect status code

Instead of having the �number input that allows setting any kind of status code, it would be easier for editors and more robust to have a dropdown that allows to select status codes that make sense in a projects context.

Therefore it would be good to be able to configure a list of valid status codes including their (localizable) labels.

This list would then be the source for a dropdown that will be display instead of the number input.

By default, the status codes that are most commonly used should be preconfigured.

See also #6 for this.

sourceUriPath does not allow urlencoded special chars

Hello,

we created a new site for someone and have been using the redirect Ui for redirecting old links.

Now to the problem
The sourceUriPath pattern '^[a-zA-Z0-9_-/.]+$' does not allow:

  • getränkekarte.pdf
  • getr%C3%A4nkekarte.pdf

I've changed the pattern in my Configuration/Settings.yaml to ^[a-zA-Z0-9_\-\/\.\%]+$, but this didn't work, as the backend keeps telling me its not matching the (old) pattern.

Is there a problem with neos handling those urls or would it be safe to allow the % char?

Until then, we'll stick to the good old htaccess-RewriteRules.

Greetings and thanks!

Make RedirectAdmin role independent like the UserManager

With the UserManager we have a role that can work as a single permission role.
You maybe also want to have a user that is just able to access the redirect module and nothing else.

Right now, we will get a permission error.

Node-Selector for target field

Screenshot 2019-09-23 at 11 22 27

The "target field" currently suggests entering a uri or path, what is perfect for external redirects.
For internal redirects (to a DocumentNode of this neos installation) it would be awesome, specially for non-technical user, to search for DocumentNodes instead of copy pasting the url.

Some of our editors like to use the redirecthandler-ui to generate short-urls (like domain.tld/shortcut/) and redirect to a DocumentNode on the same website.

Add flush button to clear all redirects

Sometimes it's helpful to clear all redirect after exporting and working on the list of all redirects. Especially if the intent of the new list is to also clear out old redirects.

A new button would be added at the footer of the list or in a separate view to delete all or a subgroup of redirects.

A prompt should verify if the redirects should be deleted.

An additional privilege should limit the possibility to delete all redirects for user groups.

BUG: Cant use Browser back function

Behaviour

If you press the browsers back button on the import or export page you got the unrendered markup.

Expected

See the backend module.

Reproduce

  1. Visit redirect handler backend module
  2. Click on export redirects
  3. Press the back button in your browser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.