Skip to content

Commit

Permalink
Merge pull request #1945 from openzim/I1940-reintroduce-visualEditor-…
Browse files Browse the repository at this point in the history
…capability-check

Reintroduce VisualEditor capability check
  • Loading branch information
kelson42 authored Nov 10, 2023
2 parents 87333d0 + 102c2de commit c4c2dde
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/mwoffliner.lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ async function execute(argv: any) {
await MediaWiki.hasCoordinates(downloader)
await MediaWiki.hasWikimediaDesktopApi()
const hasWikimediaMobileApi = await MediaWiki.hasWikimediaMobileApi()
// TODO: Enable back once regression Phabricator:T350117 fixed
// await MediaWiki.hasVisualEditorApi()
await MediaWiki.hasVisualEditorApi()
await downloader.setBaseUrls(forceRender)

RedisStore.setOptions(argv.redis || config.defaults.redisPath)
Expand Down
3 changes: 1 addition & 2 deletions src/util/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ export const RULE_TO_REDIRECT = /window\.top !== window\.self/
export const WEBP_HANDLER_URL = 'https://gist.githubusercontent.com/rgaudin/60bb9cc6f187add506584258028b8ee1/raw/9d575b8e25d67eed2a9c9a91d3e053a0062d2fc7/web-handler.js'
export const MAX_FILE_DOWNLOAD_RETRIES = 5
export const BLACKLISTED_NS = ['Story'] // 'Story' Wikipedia namespace is content, but not indgestable by Parsoid https://github.com/openzim/mwoffliner/issues/1853
// TODO: Enable back once regression Phabricator:T350117 fixed
export const RENDERERS_LIST = ['WikimediaDesktop', /* 'VisualEditor',*/ 'WikimediaMobile']
export const RENDERERS_LIST = ['WikimediaDesktop', 'VisualEditor', 'WikimediaMobile']
3 changes: 1 addition & 2 deletions test/unit/downloader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ describe('Downloader class', () => {
await MediaWiki.hasCoordinates(downloader)
await MediaWiki.hasWikimediaDesktopApi()
await MediaWiki.hasWikimediaMobileApi()
// TODO: Enable back once regression Phabricator:T350117 fixed
// await MediaWiki.hasVisualEditorApi()
await MediaWiki.hasVisualEditorApi()
await downloader.setBaseUrls()
})

Expand Down
3 changes: 1 addition & 2 deletions test/unit/mwApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const initMW = async (downloader: Downloader) => {
await MediaWiki.getMwMetaData(downloader)
await MediaWiki.hasCoordinates(downloader)
await MediaWiki.hasWikimediaDesktopApi()
// TODO: Enable back once regression Phabricator:T350117 fixed
// await MediaWiki.hasVisualEditorApi()
await MediaWiki.hasVisualEditorApi()

await MediaWiki.getNamespaces([], downloader)
}
Expand Down
3 changes: 1 addition & 2 deletions test/unit/renderers/renderer.builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ describe('RendererBuilder', () => {
await MediaWiki.hasCoordinates(downloader)
await MediaWiki.hasWikimediaDesktopApi()
await MediaWiki.hasWikimediaMobileApi()
// TODO: Enable back once regression Phabricator:T350117 fixed
// await MediaWiki.hasVisualEditorApi()
await MediaWiki.hasVisualEditorApi()
await downloader.setBaseUrls()

const rendererBuilderOptions = {
Expand Down
3 changes: 1 addition & 2 deletions test/unit/saveArticles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ describe('saveArticles', () => {
await MediaWiki.hasCoordinates(downloader)
await MediaWiki.hasWikimediaDesktopApi()
await MediaWiki.hasWikimediaMobileApi()
// TODO: Enable back once regression Phabricator:T350117 fixed
// await MediaWiki.hasVisualEditorApi()
await MediaWiki.hasVisualEditorApi()
await downloader.setBaseUrls(renderer)
const _articlesDetail = await downloader.getArticleDetailsIds(['London'])
const articlesDetail = mwRetToArticleDetail(_articlesDetail)
Expand Down
3 changes: 1 addition & 2 deletions test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export async function setupScrapeClasses({ mwUrl = 'https://en.wikipedia.org', f
await MediaWiki.hasCoordinates(downloader)
await MediaWiki.hasWikimediaDesktopApi()
await MediaWiki.hasWikimediaMobileApi()
// TODO: Enable back once regression Phabricator:T350117 fixed
// await MediaWiki.hasVisualEditorApi()
await MediaWiki.hasVisualEditorApi()

const dump = new Dump(format, {} as any, MediaWiki.metaData)

Expand Down

0 comments on commit c4c2dde

Please sign in to comment.