opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
85 stars 66 forks source link

Move manifest.json into country config #7466

Open euanmillar opened 1 month ago

euanmillar commented 1 month ago

Image

It's not possible to change the name of the PWA because the manifest.json is in the client package as opposed to country config. Is there any way that this can be configurable?

Tech design

    location /manifest.json {
        proxy_pass http://countryconfig:3040/static/manifest.json;
    }

    location /images/ {
        proxy_pass http://countryconfig:3040/static/images/;
    }

these blocks redirect client queries to the defined urls directly to country config.

import { defineConfig } from 'vite';

export default defineConfig({
  server: {
    proxy: {
      '/manifest.json': {
        target: 'http://localhost:3040/static/',
        changeOrigin: true
      },
      '/images/': {
        target: 'http://localhost:3040/static/',
        changeOrigin: true
      }
    }
  }
});
rikukissa commented 1 month ago

Related https://github.com/opencrvs/opencrvs-core/issues/7177

naftis commented 4 weeks ago

@tareq89 When building the client with yarn build we get this:

PWA v0.20.0
WARNING: "theme_color" is missing from the web manifest, your application will not be able to be installed

Could you check if you can fix this at the same time?

rikukissa commented 4 weeks ago

@tareq89 @naftis I also updated the task description as it's probably so that manifest.json also needs to be in core, regardless it also being in CC

Copy both manifest.json and app icons into the directory. Note that OpenCRVS still should have at least a default manifest.json so build works

tareq89 commented 4 weeks ago

@tareq89 When building the client with yarn build we get this:

PWA v0.20.0
WARNING: "theme_color" is missing from the web manifest, your application will not be able to be installed

Could you check if you can fix this at the same time?

When this error occurs? can you give me steps to reproduce this? looks like it happens when you try to install the app in the mobile, is it?

naftis commented 4 weeks ago

@tareq89 When building the client with yarn build we get this:

PWA v0.20.0
WARNING: "theme_color" is missing from the web manifest, your application will not be able to be installed

Could you check if you can fix this at the same time?

When this error occurs? can you give me steps to reproduce this? looks like it happens when you try to install the app in the mobile, is it?

For me it happens when I run yarn build in client:

➜  client git:(ocrvs-7439) ✗ yarn build
yarn run v1.22.22
$ VITE_APP_VERSION=$VERSION NODE_OPTIONS=--max_old_space_size=8000 vite build
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
vite v5.3.1 building for production...
....
PWA v0.20.0
WARNING: "theme_color" is missing from the web manifest, your application will not be able to be installed
....
Done in 32.73s.
Zangetsu101 commented 1 week ago

@tareq89 Could you please finish up cherry-picking the changes? For core both 1.6 & 1.5.1 are remaining. For countryconfig only 1.5.1 is left