Commit Graph

1088 Commits

Author SHA1 Message Date
Tarek Khalil f8480ed911
FEATURE: Exposing a way to add a generic report filter (#6816)
* FEATURE: Exposing a way to add a generic report filter

## Why do we need this change?

Part of the work discussed [here](https://meta.discourse.org/t/gain-understanding-of-file-uploads-usage/104994), and implemented a first spike [here](https://github.com/discourse/discourse/pull/6809), I am trying to expose a single generic filter selector per report.

## How does this work?

We basically expose a simple, single generic filter that is computed and displayed based on backend values passed into the report.

This would be a simple contract between the frontend and the backend.

**Backend changes:** we simply need to return a list of dropdown / select options, and enable the report's newly introduced `custom_filtering` property.

For example, for our [Top Uploads](https://github.com/discourse/discourse/pull/6809/files#diff-3f97cbb8726f3310e0b0c386dbe89e22R1423) report, it can look like this on the backend:

```ruby
report.custom_filtering = true
report.custom_filter_options = [{ id: "any", name: "Any" }, { id: "jpg", name: "JPEG" } ]
```

In our javascript report HTTP call, it will look like:

```js
{
  "custom_filtering": true,
  "custom_filter_options": [
    {
      "id": "any",
      "name": "Any"
    },
    {
      "id": "jpg",
      "name": "JPG"
    }
  ]
}
```

**Frontend changes:** We introduced a generic `filter` param and a `combo-box` which hooks up into the existing framework for fetching a report.

This works alright, with the limitation of being a single custom filter per report. If we wanted to add, for an instance a `filesize filter`, this will not work for us. _I went through with this approach because it is hard to predict and build abstractions for requirements or problems we don't have yet, or might not have._

## How does it look like?

![a1ktg1odde](https://user-images.githubusercontent.com/45508821/50485875-f17edb80-09ee-11e9-92dd-1454ab041fbb.gif)

## More on the bigger picture

The major concern here I have is the solution I introduced might serve the `think small` version of the reporting work, but I don't think it serves the `think big`, I will try to shed some light into why.

Within the current design, It is hard to maintain QueryParams for dynamically generated params (based on the idea of introducing more than one custom filter per report).

To allow ourselves to have more than one generic filter, we will need to:

a. Use the Route's model to retrieve the report's payload (we are now dependent on changes of the QueryParams via computed properties)
b. After retrieving the payload, we can use the `setupController` to define our dynamic QueryParams based on the custom filters definitions we received from the backend
c. Load a custom filter specific Ember component based on the definitions we received from the backend
2019-03-15 12:15:38 +00:00
venarius dc4541a95c FIX: Text content search warning if more than 50 results 2019-03-11 12:56:15 -04:00
Penar Musaraj 64a3d63ddc DEV: Rename some icons with deprecated names 2019-02-28 13:03:14 -05:00
David Taylor e67474daf4 UX: Don't link to theme source unless it's http(s) 2019-02-28 17:01:59 +00:00
David Taylor 3517103398 UX: Correct locale key for theme compatibility error 2019-02-28 14:40:33 +00:00
Joffrey JAFFEUX fbedaea5ed
FIX: prevents double network calls and other quirks on admin emails (#7074) 2019-02-26 17:53:52 +01:00
Joffrey JAFFEUX 900e187627
DEV: removing blank files (#7057) 2019-02-25 09:52:44 +01:00
Penar Musaraj 74ed72e825 DEV: Remove `d-checkbox` component
Replaces the last occurrence of `d-checkbox` with a regular input element.

Includes a minor refactor of admin site text search.
2019-02-21 09:54:54 -05:00
Penar Musaraj cafe637407
UX: List popular themes and components in admin panel (#6997)
Reorganizes theme create/upload flows into one install flow
Adds quick list of popular themes/components with one-click installation
2019-02-20 14:58:31 -05:00
David Taylor 49e7073438 FIX: Hide advanced theme fields behind a flag, pending UI improvement 2019-02-19 22:25:00 +00:00
David Taylor dbcf05d62c DEV: Code style improvements following review
Followup to 05ee1d1aba
2019-02-19 20:02:29 +00:00
Joffrey JAFFEUX 9ade04b709
FIX: removes legacy browsers-refresh button (#7028) 2019-02-19 16:38:21 +01:00
David Taylor 05ee1d1aba
FEATURE: Added settings/translations support to theme editor UI (#7026)
- These advanced fields are hidden behind an 'advanced' button, so will not affect normal use
- The editor has been refactored into a component, and styling cleaned up so menu items do not overlap on small screens
- Styling has been added to indicate which fields are in use for a theme
- Icons have been added to identify which fields have errors
2019-02-19 12:56:01 +00:00
Joffrey JAFFEUX cba0dd33ee
REFACTOR: admin-customize-color (#7018) 2019-02-19 09:31:11 +01:00
Joffrey JAFFEUX 2c6bf184bc
REFACTOR: admin-badge-preview (#7017) 2019-02-19 09:30:52 +01:00
Joffrey JAFFEUX 3bf61fca66
REFACTOR: admin-user-field-item (#7016) 2019-02-19 09:30:38 +01:00
Joffrey JAFFEUX ee692414ce
REFACTORING: admin-edit-badge-groupings (#7015) 2019-02-19 09:30:24 +01:00
Penar Musaraj 62043e6904 UX: Hide branch/private repo options in admin theme import modal 2019-02-08 10:17:29 -05:00
Joffrey JAFFEUX 44d9bc12c9
FEATURE: color-palettes component (#6992) 2019-02-08 14:01:14 +01:00
Joffrey JAFFEUX e54612c914
fix tests (#6987) 2019-02-08 11:38:15 +01:00
Kris f849169619 UX: Modifications to admin/customize layout 2019-02-07 22:27:35 -05:00
Kris a52b2c9625 UX: Moving the create theme buttons, adding buttons to theme index 2019-02-05 21:40:17 -05:00
Kris 94f16ba931 UX: Make button icons use lighter color instead of opacity 2019-01-31 13:59:49 -05:00
Kris f7deb52c90 FIX: Class name for external-link on customize page 2019-01-28 17:15:36 -05:00
David Taylor a48731e359
FEATURE: Support additional metadata in theme about.json (#6944)
New `about.json` fields (all optional):
 - `authors`: An arbitrary string describing the theme authors
 - `theme_version`: An arbitrary string describing the theme version
 - `minimum_discourse_version`: Theme will be auto-disabled for lower versions. Must be a valid version descriptor.
 - `maximum_discourse_version`: Theme will be auto-disabled for lower versions. Must be a valid version descriptor.

A localized description for a theme can be provided in the language files under the `theme_metadata.description` key

The admin UI has been re-arranged to display this new information, and give more prominence to the remote theme options.
2019-01-25 14:19:01 +00:00
Joffrey JAFFEUX bd31423137
DEV: refactoring admin-logs-screened-ip-addresses (#6932) 2019-01-23 17:40:37 +01:00
Joffrey JAFFEUX 0aa049791e
DEV: refactoring admin-backups-index (#6933) 2019-01-23 17:40:24 +01:00
Joffrey JAFFEUX 60974932c4
DEV: refactoring api-keys (#6931) 2019-01-23 17:40:05 +01:00
David Taylor afd449089f
FEATURE: Import and export themes in a .tar.gz format (#6916) 2019-01-23 14:40:21 +00:00
Joe d720215183 UX: admin badge page improvements 2019-01-23 11:29:51 +01:00
David Taylor 2e59a37687
FEATURE: List unused theme components (#6924) 2019-01-23 09:20:13 +00:00
Penar Musaraj 9886934ef5 DEV: fix some deprecated SVG icon refs 2019-01-22 14:42:00 -05:00
Kris 66f6382090 FIX: Icon missing due to typo 2019-01-22 13:01:21 -05:00
Joffrey JAFFEUX fc710de3ab
DEV: refactoring admin user index (#6927) 2019-01-22 16:44:55 +01:00
Joffrey JAFFEUX bce9c37f15
DEV: refactoring permalink-form (#6925) 2019-01-22 15:09:21 +01:00
Joffrey JAFFEUX 80d42b4ea2
icons deprecations fixes (#6920) 2019-01-22 12:02:02 +01:00
Joffrey JAFFEUX 9148f7675b
FIX: better handling of resizing in stacked charts (#6921) 2019-01-22 11:20:50 +01:00
Joffrey JAFFEUX a9edcb2e10
fixes few icons deprecations warnings (#6915) 2019-01-21 16:56:05 +01:00
Joffrey JAFFEUX b95165b838
FEATURE: adds a new chart report to track pageviews (#6913) 2019-01-21 15:17:04 +01:00
Joffrey JAFFEUX 52f2e0d6b9
SECURITY: fix possible XSS with badges (#6912) 2019-01-21 13:08:26 +01:00
David Taylor 880311dd4d
FEATURE: Support for localized themes (#6848)
- Themes can supply translation files in a format like `/locales/{locale}.yml`. These files should be valid YAML, with a single top level key equal to the locale being defined. For now these can only be defined using the `discourse_theme` CLI, importing a `.tar.gz`, or from a GIT repository.

- Fallback is handled on a global level (if the locale is not defined in the theme), as well as on individual keys (if some keys are missing from the selected interface language).

- Administrators can override individual keys on a per-theme basis in the /admin/customize/themes user interface.

- Theme developers should access defined translations using the new theme prefix variables:
  JavaScript: `I18n.t(themePrefix("my_translation_key"))`
  Handlebars: `{{theme-i18n "my_translation_key"}}` or `{{i18n (theme-prefix "my_translation_key")}}`

- To design for backwards compatibility, theme developers can check for the presence of the `themePrefix` variable in JavaScript

- As part of this, the old `{{themeSetting.setting_name}}` syntax is deprecated in favour of `{{theme-setting "setting_name"}}`
2019-01-17 11:46:11 +00:00
Jeff Atwood 1d4d4b81e6 remove stray chars 2019-01-16 15:05:43 -08:00
Jeff Atwood f0999f27a7 UX: soften the "problems" alert on dashboard 2019-01-16 14:58:19 -08:00
Penar Musaraj 18055f5e37 DEV: show remote theme repository URL 2019-01-16 11:09:16 -05:00
Arpit Jalan 1591c42a06 FIX: profile picture not showing up on user admin page 2019-01-16 09:21:11 +05:30
Kris 8176d26dbd UX: Reducing usage of btn-small, simplifying styles 2019-01-11 19:41:09 -05:00
Joffrey JAFFEUX f9648de897
DEV: upgrades from Ember 2.13 to Ember 3.5.1 (#6808)
Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: David Taylor <david@taylorhq.com>
2019-01-10 11:06:01 +01:00
Robin Ward 8b3ddcf646 FIX: Add topic status to flagged topics list
Previously at a glance it was impossible to tell if a topic was closed
before digging deeper.
2019-01-09 10:59:35 -05:00
Joffrey JAFFEUX 0402f0f357
UX: new site setting to define activity metrics displayed on dashboard 2018-12-26 10:29:07 +01:00
Rishabh 3d2c72dd33 UX: Switch placeholder to an SSH url if importing a private theme 2018-12-20 17:01:50 +05:30