So we've recently migrated beta-vct to beta-commons. The beta env of the tool (https://beta-videocuttool.wmcloud.org/) is primarily for testing changes before we go live on prod.
[P0]
[BUG]
import.meta.env.VITE_ENV !== "production" check is failling on production, as import.meta.env.VITE_ENV is not being picked up by vite (even though its set up in Dockerfile.prd).
This causes tool to pickup BETA_COMMONS_BASE_URL on client side (for production as well), causing issues to upload
[P1/P2]
This ticket addresses the following concerns.
- Currently in beta-vct, the placeholder input url begins with commons.wikimedia.org which might be misleading to users. Remove the hardcoded placeholder from this, and use a generic one (which shows commons.wikimedia.beta.org for beta env, and commons.wikimedia.org for prod env)
- We have a couple of util functions retrieveVideoData and checkFileExist which have a hardcoded check for commons.wikimedia.org. Remove all instances of this hardcoded url, use dyanmic base url fetched from ENV_SETTINGS.
- Also as a precautionary measure, add a error notification if video doesn't exist/not found in commons/beta-commons (based on the env). We can have the error message like Video: {video_title} not found in {commons link based on env}. Video url: {final generated video url}