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:
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
- Go to
Admin > Settings > Appearance
- Scroll to
Progressive Web App (PWA)
. You should see the new fields - Check your appearance settings via
appearance api
explained here.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/appearance"
-
pwa_name
,pwa_short_name
,pwa_description
andpwa_icon
should be empty - Go back to GUI and change the content of the new fields. Don't forgett to save/update settings (button at the bottom)
- Repeat step 3 and check if the values are set.
- 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"
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Ezekiel Kigbo