numerique-gouv / people

Teams management application
MIT License
9 stars 0 forks source link

🚧(app-regie) use mail domain slug for mail-domains navigation and requests #253

Closed daproclaima closed 1 week ago

daproclaima commented 2 weeks ago

Stop using mailDomain.id in frontend navigation and requests to the backend. Instead, use mailDomain.url as a slug.

A meaningful URL, easy to memorize for the user consulting a specific mail domain view.

With this change, instead of providing a UUID in the frontend application URL, we use the slug of a mail domain. As a result, a URL that used to have the format http://localhost:3000/mail-domains/6bbd8081-563a-4c5a-ae02-2785d18f2480 will look like http://localhost:3000/mail-domains/domainfr.

Changes in the code

Each navigation button supposed to redirect to the view of a specific mail domain will embed the slug of the mail domain instead of its id. Also, every http request sent to the django API on the api/mail-domains/ path related to a specific domain and its mailboxes will use the mail domain slug instead of its id (as introduced in commit b4bafb6efbcfae4ed8a116061ee471a27737c41e).

sampaccoud commented 2 weeks ago

What's the idea behing this change? Can you provide more details in the description of the pull request with our usual format : Purpose / Proposal?

mjeammet commented 2 weeks ago

cannot lint locally, I don't understand why 😢

EDIT : OK, fixed it with a delicate chmod 777. You're free to merge, @daproclaima