Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds auto-suggestions + validation for manual filters #1089

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cb7b5b9
First pass on manual filter & path regex/negated filters
Vigasaurus May 21, 2021
007d44d
Second pass - mostly everything user-facing is done
Vigasaurus May 21, 2021
6209d72
Bugfix in realtime view, formatting
Vigasaurus May 21, 2021
eb91a79
Fixes editing UX on list view
Vigasaurus May 22, 2021
a632e7a
Adds tests for exclusions and wildcards
Vigasaurus May 22, 2021
c684f1c
Various UI Improvements
Vigasaurus May 22, 2021
7dc65b9
Changelog
Vigasaurus May 22, 2021
fa7f6c2
Makes requested changes, adds different version of filter button
Vigasaurus May 25, 2021
81c5e05
Makes colorings on top bar elements consistent
Vigasaurus May 25, 2021
806975e
Merge branch 'master' into manual-filters
Vigasaurus May 25, 2021
22d38c4
80% of auto-complete filters progress
Vigasaurus May 27, 2021
4ca39cc
95% completed auto-complete setup
Vigasaurus May 27, 2021
1cb7732
Adds goals as auto-complete capable filter
Vigasaurus May 27, 2021
83887c4
Adds tests for suggestions, formats goals suggestion query
Vigasaurus May 27, 2021
e00929b
Merge branch 'manual-filters' of github.com:Vigasaurus/plausible-anal…
Vigasaurus May 27, 2021
f689642
Merge branch 'master' into manual-filters
Vigasaurus May 27, 2021
e041f75
Formatting
Vigasaurus May 27, 2021
91f3b44
Changelog
Vigasaurus May 27, 2021
d03b314
Removes cache-control header from tracker file
ukutaht May 28, 2021
296a76a
Dialyzer fix
Vigasaurus May 28, 2021
d0b7bfe
Real Dialyzer Fix
Vigasaurus May 28, 2021
2be99db
Fix p.js
ukutaht May 28, 2021
c37a2de
Revert "Adds manual filters on FE, capability for exclusion filters (…
ukutaht Jun 2, 2021
9f16603
Accept application/json in /api/event
ukutaht Jun 2, 2021
ad6faec
Stats API: Support IN filter expression (#1090)
ukutaht Jun 2, 2021
fa60ebd
Scrub port from x-forwarded-for
ukutaht Jun 2, 2021
c008381
Fix IP address parsing for ipv6 with port number
ukutaht Jun 3, 2021
a0a0c3a
add tzdata storage dir (#1104)
happysalada Jun 3, 2021
d9cc21f
Add site limit exempt config
ukutaht Jun 4, 2021
c0678cd
Chartjs v3 (#1111)
ukutaht Jun 7, 2021
02ad4c8
update js deps 2 (#1112)
ukutaht Jun 7, 2021
0a3623b
Replace "async defer" by "defer" in sniplet for dashboard (#1107)
divinerites Jun 7, 2021
0054c9f
Add api keys to CRM
ukutaht Jun 10, 2021
39287ab
Remove IO.inspect
ukutaht Jun 10, 2021
bb18af6
Close to finalized version of updated version
Vigasaurus Jun 10, 2021
f2e5ce8
Fixes time on page for globbed and negated page paths
Vigasaurus Jun 11, 2021
10f10c9
Fixes a couple of minor UX issues
Vigasaurus Jun 11, 2021
a299fab
Changes to split and pattern matched function for time_on_page
Vigasaurus Jun 11, 2021
cef0667
Merge branch 'master' into 'manual-filters'
Vigasaurus Jun 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ All notable changes to this project will be documented in this file.
- To authenticate against a local postgresql via socket authentication, the environment-variables
`DATABASE_SOCKET_DIR` & `DATABASE_NAME` were added.
- Time on Page metric available in detailed Top Pages report plausible/analytics#1007
- Glob (wildcard) based page, entry page and exit page filters plausible/analytics#1067
- Wildcard based page, entry page and exit page filters plausible/analytics#1067
- Exclusion filters for page, entry page and exit page filters plausible/analytics#1067
- Menu to add new and edit existing filters directly plausible/analytics#1067
- Menu (with auto-complete) to add new and edit existing filters directly plausible/analytics#1089
- Added `CLICKHOUSE_FLUSH_INTERVAL_MS` and `CLICKHOUSE_MAX_BUFFER_SIZE` configuration parameters plausible/analytics#1073

### Fixed
Expand Down
69 changes: 69 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,72 @@ iframe[hidden] {
.filter-list-text:hover ~ .filter-list-remove {
display: none;
}

.filter-select__control:focus-within {
box-shadow: rgb(255, 255, 255) 0px 0px 0px 0px, rgb(99, 102, 241) 0px 0px 0px 1px, rgba(0, 0, 0, 0) 0px 0px 0px 0px; /* indigo-500 */
}

.filter-select__control {
@apply dark:bg-gray-900 border-gray-300 dark:border-gray-700 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500;
}

.filter-select__control:hover {
@apply cursor-pointer;
border-color: rgb(156, 163, 175) !important; /* gray-400 */
}

.filter-select__indicator-separator {
@apply hidden;
}

.filter-select__indicator {
@apply text-gray-400;
}

.filter-select__input {
@apply w-full;
}

.filter-select__input input {
width: 100% !important;
box-shadow: none !important;
}

.dark .filter-select__input input {
color: rgb(209, 213, 219) !important; /* gray-300 */
}

.filter-select__value-container > :not(.filter-select__single-value) {
@apply w-full;
}

.filter-select__loading-indicator {
color: rgb(79, 70, 229) !important; /* indigo-600 */
}

.filter-select__loading-indicator > span {
height: 1.5em;
width: 1.5em;
}

.filter-select__single-value {
@apply dark:text-gray-400;
}

.filter-select__menu-list {
@apply dark:bg-gray-900;
}

.filter-select__option {
@apply dark:text-gray-300;
cursor: pointer !important;
}

.filter-select__option--is-focused {
background-color: rgb(165, 180, 252) !important; /* indigo-300 */
}

.dark .filter-select__option--is-focused {
background-color: rgb(79, 70, 229) !important; /* indigo-600 */
}

1 change: 1 addition & 0 deletions assets/css/modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
.modal__container {
background-color: #fff;
padding: 1rem 2rem;
max-width: 860px;
border-radius: 4px;
margin: 50px auto;
box-sizing: border-box;
Expand Down
8 changes: 4 additions & 4 deletions assets/js/dashboard/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ class DatePicker extends React.Component {

const leftClasses = `flex items-center px-2 border-r border-gray-300 rounded-l
dark:border-gray-500 dark:text-gray-100 ${
disabledLeft ? "bg-gray-300 dark:bg-gray-950" : "hover:bg-gray-200 dark:hover:bg-gray-900"
disabledLeft ? "bg-gray-200 dark:bg-gray-900" : ""
}`;
const rightClasses = `flex items-center px-2 rounded-r dark:text-gray-100 ${
disabledRight ? "bg-gray-300 dark:bg-gray-950" : "hover:bg-gray-200 dark:hover:bg-gray-900"
disabledRight ? "bg-gray-200 dark:bg-gray-900" : ""
}`;
return (
<div className="flex rounded shadow bg-white mr-4 cursor-pointer dark:bg-gray-800">
Expand Down Expand Up @@ -242,7 +242,7 @@ class DatePicker extends React.Component {
onKeyPress={this.open}
className="flex items-center justify-between rounded bg-white dark:bg-gray-800 shadow px-4
pr-3 py-2 leading-tight cursor-pointer text-sm font-medium text-gray-800
dark:text-gray-200 h-full hover:bg-gray-200 dark:hover:bg-gray-900"
dark:text-gray-200 h-full"
tabIndex="0"
role="button"
aria-haspopup="true"
Expand Down Expand Up @@ -312,7 +312,7 @@ class DatePicker extends React.Component {
to={{from: false, to: false, period, ...opts}}
onClick={this.close.bind(this)}
query={this.props.query}
className={`${boldClass } px-4 py-2 md:text-sm leading-tight hover:bg-gray-200
className={`${boldClass } px-4 py-2 md:text-sm leading-tight hover:bg-gray-100
dark:hover:bg-gray-900 hover:text-gray-900 dark:hover:text-gray-100 flex items-center justify-between`}
>
{text}
Expand Down
4 changes: 2 additions & 2 deletions assets/js/dashboard/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Filters extends React.Component {
}

renderDropdownFilter(history, [key, value], query) {
if (['goal', 'props'].includes(key)) {
if ('props' == key) {
return (
<div className="px-4 sm:py-2 py-3 md:text-sm leading-tight flex items-center justify-between" key={key + value}>
{this.filterText(key, value, query)}
Expand All @@ -201,7 +201,7 @@ class Filters extends React.Component {
renderListFilter(history, [key, value], query) {
return (
<span key={key} title={value} className="flex bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 shadow text-sm rounded mr-2 items-center">
{['goal', 'props'].includes(key) ? (
{'props' == key ? (
<span className="flex w-full h-full items-center py-2 pl-3">
{this.filterText(key, value, query)}
</span>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dashboard/historical.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Historical extends React.Component {
<div className="flex items-center w-full mb-2 sm:mb-0">
<SiteSwitcher site={this.props.site} loggedIn={this.props.loggedIn} />
<CurrentVisitors timer={this.props.timer} site={this.props.site} query={this.props.query} />
<Filters site={this.props.site} query={this.props.query} history={this.props.history} />
<Filters query={this.props.query} history={this.props.history} />
</div>
<Datepicker site={this.props.site} query={this.props.query} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions assets/js/dashboard/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ export function eventName(query) {

export const formattedFilters = {
'goal': 'Goal',
'props': 'Props',
'props': 'Goal properties',
'source': 'Source',
'utm_medium': 'UTM Medium',
'utm_source': 'UTM Source',
'utm_campaign': 'UTM Campaign',
'referrer': 'Referrer',
'referrer': 'Referrer URL',
'screen': 'Screen size',
'browser': 'Browser',
'browser_version': 'Browser Version',
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dashboard/realtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Realtime extends React.Component {
<div className="items-center justify-between w-full sm:flex">
<div className="flex items-center w-full mb-2 sm:mb-0">
<SiteSwitcher site={this.props.site} loggedIn={this.props.loggedIn} />
<Filters site={this.props.site} query={this.props.query} history={this.props.history} />
<Filters query={this.props.query} history={this.props.history} />
</div>
<Datepicker site={this.props.site} query={this.props.query} />
</div>
Expand Down
4 changes: 0 additions & 4 deletions assets/js/dashboard/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import PagesModal from './stats/modals/pages'
import EntryPagesModal from './stats/modals/entry-pages'
import ExitPagesModal from './stats/modals/exit-pages'
import CountriesModal from './stats/modals/countries'
import FilterModal from './stats/modals/filter'

import {BrowserRouter, Switch, Route, useLocation} from "react-router-dom";

Expand Down Expand Up @@ -51,9 +50,6 @@ export default function Router({site, loggedIn}) {
<Route path="/:domain/countries">
<CountriesModal site={site} />
</Route>
<Route path={["/:domain/filter/:field", "/:domain/filter"]}>
<FilterModal site={site} />
</Route>
</Switch>
</Route>
</BrowserRouter>
Expand Down
Loading