diff --git a/campaigns.go b/campaigns.go index 7c33e89..64c9cf4 100644 --- a/campaigns.go +++ b/campaigns.go @@ -84,7 +84,8 @@ func handleGetCampaigns(c echo.Context) error { single = true } if query != "" { - query = string(regexFullTextQuery.ReplaceAll([]byte(query), []byte("&"))) + query = `%` + + string(regexFullTextQuery.ReplaceAll([]byte(query), []byte("&"))) + `%` } err := app.queries.QueryCampaigns.Select(&out.Results, id, pq.StringArray(status), query, pg.Offset, pg.Limit) diff --git a/frontend/fontello/config.json b/frontend/fontello/config.json index d8d691a..5e8f936 100644 --- a/frontend/fontello/config.json +++ b/frontend/fontello/config.json @@ -496,6 +496,20 @@ "cancel" ] }, + { + "uid": "110ec51ea49a7f0cc9bfbde321f3c28d", + "css": "magnify", + "code": 59427, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M396.5 125Q468.8 125 531.3 161.1T629.9 259.8 666 396.5Q666 496.1 601.6 572.3L613.3 584H646.5L853.5 791 791 853.5 584 646.5V613.3L572.3 601.6Q496.1 666 396.5 666 322.3 666 259.8 629.9T161.1 531.3 125 395.5 161.1 259.8 259.8 161.1 396.5 125ZM396.5 209Q318.4 209 263.7 263.7T209 396.5 263.7 529.3 396.5 584 529.3 529.3 584 396.5 529.3 263.7 396.5 209Z", + "width": 1000 + }, + "search": [ + "magnify" + ] + }, { "uid": "f4ad3f6d071a0bfb3a8452b514ed0892", "css": "vector-square", @@ -12200,20 +12214,6 @@ "magnet-on" ] }, - { - "uid": "110ec51ea49a7f0cc9bfbde321f3c28d", - "css": "magnify", - "code": 59416, - "src": "custom_icons", - "selected": false, - "svg": { - "path": "M396.5 125Q468.8 125 531.3 161.1T629.9 259.8 666 396.5Q666 496.1 601.6 572.3L613.3 584H646.5L853.5 791 791 853.5 584 646.5V613.3L572.3 601.6Q496.1 666 396.5 666 322.3 666 259.8 629.9T161.1 531.3 125 395.5 161.1 259.8 259.8 161.1 396.5 125ZM396.5 209Q318.4 209 263.7 263.7T209 396.5 263.7 529.3 396.5 584 529.3 529.3 584 396.5 529.3 263.7 396.5 209Z", - "width": 1000 - }, - "search": [ - "magnify" - ] - }, { "uid": "cd529f71c055cf2da4843aafc1d70c8d", "css": "magnify-minus", diff --git a/frontend/src/assets/icons/fontello.css b/frontend/src/assets/icons/fontello.css index 10bf8e7..3d6cf7e 100644 --- a/frontend/src/assets/icons/fontello.css +++ b/frontend/src/assets/icons/fontello.css @@ -75,3 +75,4 @@ .mdi-arrow-up:before { content: '\e820'; } /* '' */ .mdi-arrow-down:before { content: '\e821'; } /* '' */ .mdi-cancel:before { content: '\e822'; } /* '' */ +.mdi-magnify:before { content: '\e823'; } /* '' */ diff --git a/frontend/src/assets/icons/fontello.woff2 b/frontend/src/assets/icons/fontello.woff2 index e6a4f86..fb07f15 100644 Binary files a/frontend/src/assets/icons/fontello.woff2 and b/frontend/src/assets/icons/fontello.woff2 differ diff --git a/frontend/src/views/Campaigns.vue b/frontend/src/views/Campaigns.vue index c568a45..8b99a7b 100644 --- a/frontend/src/views/Campaigns.vue +++ b/frontend/src/views/Campaigns.vue @@ -3,7 +3,7 @@

Campaigns - ({{ campaigns.total }}) + ({{ campaigns.total }})

@@ -12,6 +12,16 @@
+
+ + + + +
+
-

Lists ({{ lists.total }})

+

Lists + ({{ lists.total }}) +

New diff --git a/frontend/src/views/Subscribers.vue b/frontend/src/views/Subscribers.vue index 3698609..2fb515d 100644 --- a/frontend/src/views/Subscribers.vue +++ b/frontend/src/views/Subscribers.vue @@ -3,8 +3,7 @@

Subscribers - ({{ subscribers.total }}) - + ({{ subscribers.total }}) » {{ currentList.name }} @@ -21,9 +20,9 @@
- @@ -51,7 +50,7 @@
Query + icon-left="magnify">Query Reset
diff --git a/queries.sql b/queries.sql index 04ab602..62ef264 100644 --- a/queries.sql +++ b/queries.sql @@ -380,7 +380,7 @@ SELECT COUNT(*) OVER () AS total, campaigns.*, ( FROM campaigns WHERE ($1 = 0 OR id = $1) AND status=ANY(CASE WHEN ARRAY_LENGTH($2::campaign_status[], 1) != 0 THEN $2::campaign_status[] ELSE ARRAY[status] END) - AND ($3 = '' OR (to_tsvector(name || subject) @@ to_tsquery($3))) + AND ($3 = '' OR CONCAT(name, subject) ILIKE $3) ORDER BY campaigns.updated_at DESC OFFSET $4 LIMIT $5; -- name: get-campaign