Commit graph

17 commits

Author SHA1 Message Date
Thiemo Kreuz c5accc0300 Rename many functions and files for clarity
The main motivation here is to dramatically reduce the number
of places that use the same property name "enabled" for values
on different objects (e.g. "state", "actions", and "updates"
are all different things) with slightly different meanings. I
tried hard to come up with names that reflect better what each
meaning is.

Bug: T277639
Change-Id: Ie766259793f716262e3d4622ca55156d11f4842c
2021-04-08 11:04:02 +02:00
Stephen Niedzielski 7d86f0d732 [hygiene] [doc] consolidate docs in root readme
Move /docs/ui/README.md into /README.md. This fixes an issue where the
precommit script dirties the working directory on every commit (it
deletes docs/ui/README.md, which can be confusing) and makes the root
readme the single source of documentation.

Change-Id: Id99ca09b738a6fd3299f1acb4f238902461cdd95
2020-01-14 08:58:34 -07:00
Timo Tijhof a3796a24ee Doc: Refer to Node versions without "v" prefix
As of Node.js version 8, upstream has consistently avoided this
to avoid confusion with V8, the JavaScript engine that power
Node.js and Chromium.

Change-Id: I702cee3247cc69ab4aac313176c884c9c2785ea9
2019-06-10 17:30:26 +01:00
Stephen Niedzielski 6859d6f828 Hygiene: rename NPM test:node to test:unit
Rename the NPM test:node script to test:unit for consistency with
MobileFrontend.

Change-Id: I7329592ab5b375d816cd36a28a04cbe1d8f044a5
2019-01-24 08:29:27 -07:00
Thiemo Kreuz 485acf1488 Add feature flag to disable reference previews by default
This is a prerequisit for the later patch Ie0ccb03.

Any JavaScript code can check this feature flag via
mw.config.get( 'wgPopupsReferencePreviews' )

Bug: T213415
Change-Id: I17687c62cc8d738a4eb41738c9ce6662a5ec68d8
2019-01-21 11:24:33 +01:00
Jan Drewniak 83a28d177f Storybook.js for Popups
Storybook.js provides a framework for
viewing and working with UI components.
https://storybook.js.org/

This patch adds the Storybook.js UI library to Popups for
the purposes of viewing multiple previews at once.
This enables viewing page previews in the following states:

- with thumbnails
- without thumbnails
- with SVG thumbnails
- with narrow thumbnails
- with white background thumbnails
- in RTL languages
- in non-latin languages
- disambiguation popups

Storybook also allows users to change the image or text
of a popup through a GUI.

This patch sets up Storybook as a "mini" repo inside
the.storybook folder with a seperate package.json file
to avoid incompatibilities with the current webpack/babel
(or even Node) versions used in the Popups repo.

Storybook requires at least Node v8.3 to run.
(an .nvmrc file with 11.3.0 has been added to the .stories dir).

To start:
`cd .storybook && npm install && npm run start`.

Bug: T205989
Change-Id: I041e46c4f0cf173950015067e2dce81c023d3fdd
2019-01-08 14:19:00 +01:00
Thiemo Kreuz 096c74fae8 Fiy a few small typos in the Popups documentation
Change-Id: I0f02a41977eef0e1bf8fe4fc924c32e17ef78dd7
2018-12-11 18:23:30 +01:00
Stephen Niedzielski 89e592183f Hygiene: enable Redux DevTools for debug builds
Redux DevTools are available in all builds by passing the `?debug=true`
query string. Since globally enabling debug significantly slows load
times, also enable support when the build is non-production (debug)
which is known at transpile time. This enables a debuggable version of
Popups in an otherwise production-like MediaWiki without changing the
Popups release build product.

Also, update the readme with a couple debug tips and flip a few bullets
from hyphens to asterisks since that seems to be more prevalent.

Change-Id: I4cab0b8069b12505dbfa840939caac196bae2750
2018-07-02 14:54:36 -05:00
jdlrobson 4e3282e5ff Remove BetaFeature code
Popups is out of beta feature and this code is no longer needed.
Removing code is the happiest activity a developer can do.

Other changes:
* Remove redundant type field on extension.json
(If not set, the extension will default to the "other" section.)
* Repurpose `name` with `namemsg` and make use of existing i18n
messages

Bug: T193053
Change-Id: Iea832cd1f37b0e7df6ff95efd66e4a1ff2a9004e
2018-04-26 15:51:48 -07:00
Stephen Niedzielski eeba12ce50 Doc: add image to readme
Change-Id: I1fcef97d8a7477b5fcc19466e9884bd3f7caf2f3
2018-03-27 14:12:12 -05:00
Stephen Niedzielski 4dd9df12eb Doc: update some of the popups / preview terminology
Bug: T165036
Change-Id: Id75543d4d886e4cca8278baaf4f4a21c8e4389b7
2018-03-23 11:18:26 +01:00
Stephen Niedzielski 642cd3009e Doc: add Mobile Content Service example; fix tabs
Add example for developing with a local copy of the Mobile Content
Service. Also: make tabs consistent with the rest of the repo.

Change-Id: I4cfb562c18c12df828e84602d01514c8c3cc20e6
2018-03-14 11:39:54 -05:00
jdlrobson f5f21a8d09 RESTBase url is configurable
Allow developers to use different endpoints for summaries
= developer happiness

This is useful for the following use cases:
* A developer wants to test against a production endpoint via
CORS
* A developer has setup an API where REST is hosted elsewhere
e.g. http://localhost:6927/en.wikipedia.org/v1/
* A user wants to create their own REST summary compatible
endpoint
* A wiki e.g. wikidata wants to use a different endpoint which is compatible
with the summary endpoint.

We are unlikely to use it ourselves on Wikimedia wikis (the
default should suffice) but this will be a powerful tool for

When not configured this will continue to work as per normal

Change-Id: I8a7e12fbc43cddbac678e0d7b81d1e877b747b22
2018-03-09 16:15:19 +00:00
joakin 04fbc9dea2 Add code coverage reports npm script
Generate code coverage reports based on the node-qunit tests with
istanbul.

Changes:
* Update README with npm run coverage
* Add .istanbul.yml to configure istanbul
* Add npm script "coverage" that runs istanbul and generates the reports

Example report: http://popups-coverage.surge.sh/lcov-report/index.html

Change-Id: I9be8c04b858a3ce6f4e29af2685b79253e3b4dca
2017-03-03 13:34:33 +01:00
joakin 33c05394f4 Set up qunit running in node to migrate tests to commonjs
In order to run qunit tests on sources that use common.js modules, set
up infra to run qunit tests in the node cli when running:

    npm run test:node

Changes:
* Add npm script test:node that runs the tests
* Run node tests on CI (npm test)
* Add a qunit node test runner: mw-node-qunit
* Migrate a test from the root hierarchy and another one from the nested
  one to prove it works (globs fail otherwise)
  * reducers/settings.test.js to node qunit to prove it works
  * counts.test.js to node qunit to prove it works

Change-Id: I55d76b7db168f3745e0ac69852c152322ab385c3
2017-02-20 20:01:01 +01:00
joakin fa2b10a2e7 Hygiene: Move build/ext.popups/ to src/
This way, src contains sources, and dist contains distribution files.

Also, add some documentation about the folders in the README and an adr.

Change-Id: Ie0b9f6475b8423b90e927633d883bde3cd5d5e4d
2017-02-14 09:59:59 -08:00
joakin 82afb169f6 Docs: Add a README.md with development instructions
Change-Id: I1ff47d0925a5c97cc4653df875b745a8666cbd8a
2017-02-14 18:39:38 +01:00