Kailash Nadh d3f543cb15 Fix issues with Buefy responsive styles. 3 年之前
..
cypress e0bf1f1b77 Fix broken Cypress tests. 3 年之前
fontello 070472c12d Add missing speedometer Fontello icon to the campaigns UI. 3 年之前
public 4dbac141f2 Add Romanian i18n language pack contributed by @gabrielpioaru. 3 年之前
src d3f543cb15 Fix issues with Buefy responsive styles. 3 年之前
.browserslistrc 97583fe4b4 Rewrite frontend with Vue+Buevy and ditch React+Ant Design. 5 年之前
.editorconfig 97583fe4b4 Rewrite frontend with Vue+Buevy and ditch React+Ant Design. 5 年之前
.env.sample 6c234f1b1d fix: use inbuilt frontend dev server to proxy API 4 年之前
.eslintrc.js 97583fe4b4 Rewrite frontend with Vue+Buevy and ditch React+Ant Design. 5 年之前
.gitignore 97583fe4b4 Rewrite frontend with Vue+Buevy and ditch React+Ant Design. 5 年之前
README.md 570a81f966 WIP: Add tests 4 年之前
babel.config.js 97583fe4b4 Rewrite frontend with Vue+Buevy and ditch React+Ant Design. 5 年之前
cypress.json 9f3eb7e4a4 Fix Cypress tests to accommodate new admin UI URI. 3 年之前
package.json 7aee36eab1 Add support for blocklisting e-mail domains. 3 年之前
vue.config.js 68512d2dcd Add i18n support to TinyMCE. 3 年之前
yarn.lock 7aee36eab1 Add support for blocklisting e-mail domains. 3 年之前

README.md

listmonk frontend (Vue + Buefy)

It's best if the listmonk/frontend directory is opened in an IDE as a separate project where the frontend directory is the root of the project.

For developer setup instructions, refer to the main project's README.

Globals

In main.js, Buefy and vue-i18n are attached globally. In addition:

  • $api (collection of API calls from api/index.js)
  • $utils (util functions from util.js). They are accessible within Vue as this.$api and this.$utils.

Some constants are defined in constants.js.

APIs and states

The project uses a global vuex state to centrally store the responses to pretty much all APIs (eg: fetch lists, campaigns etc.) except for a few exceptions. These are called models and have been defined in constants.js. The definitions are in store/index.js.

There is a global state loading (eg: loading.campaigns, loading.lists) that indicates whether an API call for that particular "model" is running. This can be used anywhere in the project to show loading spinners for instance. All the API definitions are in api/index.js. It also describes how each API call sets the global loading status alongside storing the API responses.

IMPORTANT: All JSON field names in GET API responses are automatically camel-cased when they're pulled for the sake of consistentcy in the frontend code and for complying with the linter spec in the project (Vue/AirBnB schema). For example, content_type becomes contentType. When sending responses to the backend, however, they should be snake-cased manually. This is overridden for certain calls such as /api/config and /api/settings using the preserveCase: true param in api/index.js.

Icon pack

Buefy by default uses Material Design Icons (MDI) with icon classes prefixed by mdi-.

listmonk uses only a handful of icons from the massive MDI set packed as web font, using Fontello. To add more icons to the set using fontello:

  • Go to Fontello and drag and drop frontend/fontello/config.json (This is the full MDI set converted from TTF to SVG icons to work with Fontello).
  • Use the UI to search for icons and add them to the selection (add icons from under the Custom section)
  • Download the Fontello pack and from the ZIP:
    • Copy and overwrite config.json to frontend/fontello
    • Copy fontello.woff2 to frontend/src/assets/icons.
    • Open css/fontello.css and copy the individual icon definitions and overwrite the ones in frontend/src/assets/icons/fontello.css