Skip to content

Add fields for PWA attributes

What does this MR do and why?

Fixes #385174 (closed)

Is a followup of !107884 (merged), !107822 (merged), !107886 (merged)

Screenshots or screen recordings

before: none

after:

image

Fun fact

The button text Choose File corresponds to the browser language but everything else to GitLab settings. For example button text could be in german Datei Auswählen but the rest in english. Is this intended?

How to set up and validate locally

  1. Go to Admin > Settings > Appearance
  2. Scroll to Progressive Web App (PWA). You should see the new fields
  3. Check your appearance settings via appearance api explained here.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/appearance"
  1. pwa_name, pwa_short_name, pwa_description and pwa_icon should be empty
  2. Go back to GUI and change the content of the new fields. Don't forgett to save/update settings (button at the bottom)
  3. Repeat step 3 and check if the values are set.
  4. Do it the other way around - set the fields via API and check if GUI is updated
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/appearance?pwa_name=GitLab PWA"

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/appearance?pwa_short_name=GitLab"

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/appearance?pwa_description=GitLab as PWA"

curl --location --request PUT "https://your.root.url/api/v4/application/appearance?data=image/png" \
--header "Content-Type: multipart/form-data" \
--header "PRIVATE-TOKEN: <your_access_token>" \
--form "pwa_icon=@/your/path/to/the/image/unicorn.png"
  1. Finally, try to upload pwa_icon via UI and also remove it via UI. (test the remove button)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

🛠 with at Siemens

Edited by Ezekiel Kigbo

Merge request reports