From 5a79795e4f3a6a3bc1826e73e21f1de8a2b27299 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 09:33:00 +1300 Subject: [PATCH 01/26] Indicate tags are clickable by cursor --- client/homebrew/pages/basePages/listPage/brewItem/brewItem.less | 1 + 1 file changed, 1 insertion(+) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less index e8c7aa39a2..e7a9ad5481 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less @@ -59,6 +59,7 @@ white-space: nowrap; display: inline-block; font-weight: bold; + cursor : pointer; } &:hover{ .links{ From c6821819c7af88187d68f006e0c99ddfde626c0f Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 09:36:17 +1300 Subject: [PATCH 02/26] Initial functionality pass on BrewItem --- .../pages/basePages/listPage/brewItem/brewItem.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx index 56c08e2af5..41a7f07f8e 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx @@ -20,7 +20,8 @@ const BrewItem = createClass({ authors : [], stubbed : true }, - reportError : ()=>{} + updateListFilter : ()=>{}, + reportError : ()=>{} }; }, @@ -44,6 +45,11 @@ const BrewItem = createClass({ }); }, + updateFilter : function(type, term){ + console.log(`BrewItem: TYPE: ${type}; TERM: ${term}`); + this.props.updateListFilter(type, term); + }, + renderDeleteBrewLink : function(){ if(!this.props.brew.editId) return; @@ -129,7 +135,7 @@ const BrewItem = createClass({ {brew.tags.map((tag, idx)=>{ const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/); - return {matches[2]}; + return {this.updateFilter('tag', matches[2]);}}>{matches[2]}; })} : <> From 0762b82c402aed07a71904189841a1816553d441 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 09:46:02 +1300 Subject: [PATCH 03/26] Initial functionality of basic tag filtering --- .../pages/basePages/listPage/brewItem/brewItem.jsx | 2 +- client/homebrew/pages/basePages/listPage/listPage.jsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx index 41a7f07f8e..c7f11d6214 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx @@ -46,7 +46,7 @@ const BrewItem = createClass({ }, updateFilter : function(type, term){ - console.log(`BrewItem: TYPE: ${type}; TERM: ${term}`); + // console.log(`BrewItem: TYPE: ${type}; TERM: ${term}`); this.props.updateListFilter(type, term); }, diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 2696d4e7a3..bebd0b002c 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -82,7 +82,7 @@ const ListPage = createClass({ if(!brews || !brews.length) return
No Brews.
; return _.map(brews, (brew, idx)=>{ - return ; + return ; }); }, @@ -129,6 +129,7 @@ const ListPage = createClass({ }, handleFilterTextChange : function(e){ + // console.log(e); this.setState({ filterString : e.target.value, }); @@ -136,6 +137,12 @@ const ListPage = createClass({ return; }, + updateListFilter : function(type, term){ + // console.log(`ListPage: TYPE: ${type}; TERM: ${term}`); + const e = { target: { value: term } }; + this.handleFilterTextChange(e); + }, + updateUrl : function(filterTerm, sortType, sortDir){ const url = new URL(window.location.href); const urlParams = new URLSearchParams(url.search); From 6dcc6d36b725fbb3af8488537ace8679eca2f7b8 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 12:23:39 +1300 Subject: [PATCH 04/26] Add separate tag filter --- .../pages/basePages/listPage/listPage.jsx | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index bebd0b002c..51af85cdb2 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -36,6 +36,7 @@ const ListPage = createClass({ return { filterString : this.props.query?.filter || '', + filterTags : [], sortType : this.props.query?.sort || null, sortDir : this.props.query?.dir || null, query : this.props.query, @@ -138,18 +139,31 @@ const ListPage = createClass({ }, updateListFilter : function(type, term){ - // console.log(`ListPage: TYPE: ${type}; TERM: ${term}`); - const e = { target: { value: term } }; - this.handleFilterTextChange(e); + this.updateUrl(this.state.filterString, this.state.sortType, this.state.sortDir, term); }, - updateUrl : function(filterTerm, sortType, sortDir){ + updateUrl : function(filterTerm, sortType, sortDir, filterTag=''){ const url = new URL(window.location.href); const urlParams = new URLSearchParams(url.search); urlParams.set('sort', sortType); urlParams.set('dir', sortDir); + let filterTags = urlParams.getAll('tag'); + if(filterTag != '') { + if(!filterTags.includes(filterTag)){ + filterTags.push(filterTag); + } else { + filterTags = filterTags.filter((tag)=>{ return tag != filterTag; }); + } + } + urlParams.delete('tag'); + filterTags.forEach((tag)=>{ urlParams.append('tag', tag); }); + + this.setState({ + filterTags + }); + if(!filterTerm) urlParams.delete('filter'); else @@ -201,6 +215,15 @@ const ListPage = createClass({ return brewStrings.includes(testString); }); + + if(this.state.filterTags.length > 0) { + brews = _.filter(brews, (brew)=>{ + return this.state.filterTags.some((tag)=>{ + return brew.tags?.includes(tag); + }); + }); + } + return _.orderBy(brews, (brew)=>{ return this.sortBrewOrder(brew); }, this.state.sortDir); }, From 041c7ed48f6126ca89f8780a2332952a35129df7 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 12:48:20 +1300 Subject: [PATCH 05/26] Shift to AND operation for multiple tags --- client/homebrew/pages/basePages/listPage/listPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 51af85cdb2..e37fee8e56 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -218,7 +218,7 @@ const ListPage = createClass({ if(this.state.filterTags.length > 0) { brews = _.filter(brews, (brew)=>{ - return this.state.filterTags.some((tag)=>{ + return this.state.filterTags.every((tag)=>{ return brew.tags?.includes(tag); }); }); From 632882d370241fc066fd42a4c752b2cd8974ad4d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 16:02:36 +1300 Subject: [PATCH 06/26] Use the whole tag in the tag filter --- client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx index c7f11d6214..eb89097371 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx @@ -135,7 +135,7 @@ const BrewItem = createClass({ {brew.tags.map((tag, idx)=>{ const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/); - return {this.updateFilter('tag', matches[2]);}}>{matches[2]}; + return {this.updateFilter('tag', tag);}}>{matches[2]}; })} : <> From 6c4dad675f608a873bb69f4257b66cf32beac7ad Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 16:34:12 +1300 Subject: [PATCH 07/26] Switch to case-insensitive tag comparison --- .../pages/basePages/listPage/listPage.jsx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index e37fee8e56..499bbfb5bf 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -207,22 +207,28 @@ const ListPage = createClass({ const testString = _.deburr(this.state.filterString).toLowerCase(); brews = _.filter(brews, (brew)=>{ + // Filter by user entered text const brewStrings = _.deburr([ brew.title, brew.description, brew.tags].join('\n') .toLowerCase()); - return brewStrings.includes(testString); - }); + const filterTextTest = brewStrings.includes(testString); - if(this.state.filterTags.length > 0) { - brews = _.filter(brews, (brew)=>{ - return this.state.filterTags.every((tag)=>{ - return brew.tags?.includes(tag); + // Filter by user selected tags + let filterTagTest = true; + if(this.state.filterTags.length > 0){ + filterTagTest = this.state.filterTags.every((tag)=>{ + if(typeof brew.tags == 'string') return false; + return brew.tags.findIndex((brewTag)=>{ + return brewTag.toLowerCase() == tag.toLowerCase(); + }) >= 0; }); - }); - } + } + + return filterTextTest && filterTagTest; + }); return _.orderBy(brews, (brew)=>{ return this.sortBrewOrder(brew); }, this.state.sortDir); }, From 875e1023fc9dc596482ac1c15c97f9f95a139fc1 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 17:09:33 +1300 Subject: [PATCH 08/26] Add styling for different tag types --- .../basePages/listPage/brewItem/brewItem.less | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less index e7a9ad5481..c967327990 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less @@ -60,6 +60,26 @@ display: inline-block; font-weight: bold; cursor : pointer; + &.type { + background-color: #0080003b; + color: #008000; + border-color: #008000; + } + &.group { + background-color: #5050503b; + color: #000000; + border-color: #000000; + } + &.meta { + background-color: #0000803b; + color: #000080; + border-color: #000080; + } + &.system { + background-color: #8000003b; + color: #800000; + border-color: #800000; + } } &:hover{ .links{ From 995d1c63d8742734fdc97c58c1ecd542e710dbb6 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 17:17:03 +1300 Subject: [PATCH 09/26] Make tag removal from URL case insensitive --- client/homebrew/pages/basePages/listPage/listPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 499bbfb5bf..4cc079e523 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -151,10 +151,10 @@ const ListPage = createClass({ let filterTags = urlParams.getAll('tag'); if(filterTag != '') { - if(!filterTags.includes(filterTag)){ + if(filterTags.findIndex((tag)=>{return tag.toLowerCase()==filterTag.toLowerCase();}) == -1){ filterTags.push(filterTag); } else { - filterTags = filterTags.filter((tag)=>{ return tag != filterTag; }); + filterTags = filterTags.filter((tag)=>{ return tag.toLowerCase() != filterTag.toLowerCase(); }); } } urlParams.delete('tag'); From 9e12ab71f84bde4e05b59bf8c022ca7303d134b3 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 17:46:55 +1300 Subject: [PATCH 10/26] Switch to better brew.tags array check --- client/homebrew/pages/basePages/listPage/listPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 4cc079e523..f5c7e6e5d9 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -219,8 +219,8 @@ const ListPage = createClass({ // Filter by user selected tags let filterTagTest = true; if(this.state.filterTags.length > 0){ - filterTagTest = this.state.filterTags.every((tag)=>{ - if(typeof brew.tags == 'string') return false; + filterTagTest = this.state.filterTags?.every((tag)=>{ + if(!Array.isArray(brew.tags)) return false; return brew.tags.findIndex((brewTag)=>{ return brewTag.toLowerCase() == tag.toLowerCase(); }) >= 0; From ab8716d071f4657a645a66ce1b94cedba551665a Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 18:40:20 +1300 Subject: [PATCH 11/26] Add icons before special tags --- .../basePages/listPage/brewItem/brewItem.less | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less index c967327990..c634fa2d1a 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less @@ -64,21 +64,45 @@ background-color: #0080003b; color: #008000; border-color: #008000; + &:before{ + content: '\f0ad'; + font-family: 'Font Awesome 5 Free'; + font-size: 12px; + margin-right: 3px; + } } &.group { background-color: #5050503b; color: #000000; border-color: #000000; + &:before{ + content: '\f500'; + font-family: 'Font Awesome 5 Free'; + font-size: 12px; + margin-right: 3px; + } } &.meta { background-color: #0000803b; color: #000080; border-color: #000080; + &:before{ + content: '\f05a'; + font-family: 'Font Awesome 5 Free'; + font-size: 12px; + margin-right: 3px; + } } &.system { background-color: #8000003b; color: #800000; border-color: #800000; + &:before{ + content: '\f518'; + font-family: 'Font Awesome 5 Free'; + font-size: 12px; + margin-right: 3px; + } } } &:hover{ From cfecc001aa01dfce4c5d6c5b59e9dd069af4b111 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 3 Dec 2023 19:14:20 +1300 Subject: [PATCH 12/26] Add brew tag sorting --- client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx index eb89097371..f81d3816b4 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx @@ -115,6 +115,9 @@ const BrewItem = createClass({ const brew = this.props.brew; if(Array.isArray(brew.tags)) { // temporary fix until dud tags are cleaned brew.tags = brew.tags?.filter((tag)=>tag); //remove tags that are empty strings + brew.tags.sort((a, b)=>{ + return a.indexOf(':') - b.indexOf(':') != 0 ? a.indexOf(':') - b.indexOf(':') : a.localeCompare(b); + }); } const dateFormatString = 'YYYY-MM-DD HH:mm:ss'; From 7e98f7941650fb728a5e1ff1f0f7a7844a1cb89f Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 4 Dec 2023 07:53:49 +1300 Subject: [PATCH 13/26] Make alphabetical tag sorting case insensitive --- client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx index f81d3816b4..bdbf269f99 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx @@ -116,7 +116,7 @@ const BrewItem = createClass({ if(Array.isArray(brew.tags)) { // temporary fix until dud tags are cleaned brew.tags = brew.tags?.filter((tag)=>tag); //remove tags that are empty strings brew.tags.sort((a, b)=>{ - return a.indexOf(':') - b.indexOf(':') != 0 ? a.indexOf(':') - b.indexOf(':') : a.localeCompare(b); + return a.indexOf(':') - b.indexOf(':') != 0 ? a.indexOf(':') - b.indexOf(':') : a.toLowerCase().localeCompare(b.toLowerCase()); }); } const dateFormatString = 'YYYY-MM-DD HH:mm:ss'; From 2c997458b29fe620f92fc3c4c4ee4fad54dbb74e Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 4 Dec 2023 07:54:19 +1300 Subject: [PATCH 14/26] Simplify filter tag test --- client/homebrew/pages/basePages/listPage/listPage.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index f5c7e6e5d9..475172d5a5 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -219,8 +219,7 @@ const ListPage = createClass({ // Filter by user selected tags let filterTagTest = true; if(this.state.filterTags.length > 0){ - filterTagTest = this.state.filterTags?.every((tag)=>{ - if(!Array.isArray(brew.tags)) return false; + filterTagTest = Array.isArray(brew.tags) && this.state.filterTags?.every((tag)=>{ return brew.tags.findIndex((brewTag)=>{ return brewTag.toLowerCase() == tag.toLowerCase(); }) >= 0; From efecfac68afed103452beb04e791f5673f62842a Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 4 Dec 2023 08:10:32 +1300 Subject: [PATCH 15/26] Simplify tag styling --- .../basePages/listPage/brewItem/brewItem.less | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less index c634fa2d1a..a8bc4473ca 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less @@ -60,15 +60,17 @@ display: inline-block; font-weight: bold; cursor : pointer; + &:before { + font-family: 'Font Awesome 5 Free'; + font-size: 12px; + margin-right: 3px; + } &.type { background-color: #0080003b; color: #008000; border-color: #008000; &:before{ content: '\f0ad'; - font-family: 'Font Awesome 5 Free'; - font-size: 12px; - margin-right: 3px; } } &.group { @@ -77,9 +79,6 @@ border-color: #000000; &:before{ content: '\f500'; - font-family: 'Font Awesome 5 Free'; - font-size: 12px; - margin-right: 3px; } } &.meta { @@ -88,9 +87,6 @@ border-color: #000080; &:before{ content: '\f05a'; - font-family: 'Font Awesome 5 Free'; - font-size: 12px; - margin-right: 3px; } } &.system { @@ -99,9 +95,6 @@ border-color: #800000; &:before{ content: '\f518'; - font-family: 'Font Awesome 5 Free'; - font-size: 12px; - margin-right: 3px; } } } From d262f586fcfd4b69f28a468425ae3a3c53bd45f1 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 4 Dec 2023 21:45:59 +1300 Subject: [PATCH 16/26] Add basic selected tags display to List Page --- .../pages/basePages/listPage/listPage.jsx | 20 +++++- .../pages/basePages/listPage/listPage.less | 69 ++++++++++++++++++- 2 files changed, 85 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 475172d5a5..441fb828f3 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -158,7 +158,12 @@ const ListPage = createClass({ } } urlParams.delete('tag'); + // Add tags to URL in the order they were clicked filterTags.forEach((tag)=>{ urlParams.append('tag', tag); }); + // Sort tags before updating state + filterTags.sort((a, b)=>{ + return a.indexOf(':') - b.indexOf(':') != 0 ? a.indexOf(':') - b.indexOf(':') : a.toLowerCase().localeCompare(b.toLowerCase()); + }); this.setState({ filterTags @@ -187,6 +192,17 @@ const ListPage = createClass({ ; }, + renderTagsOptions : function(){ + if(this.state.filterTags?.length == 0) return; + console.log('renderTags'); + return
+ {_.map(this.state.filterTags, (tag, idx)=>{ + const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/); + return {this.updateListFilter('tag', tag);}}>{matches[2]}; + })} +
; + }, + renderSortOptions : function(){ return
Sort by :
@@ -197,9 +213,6 @@ const ListPage = createClass({ {/* {this.renderSortOption('Latest', 'latest')} */} {this.renderFilterOption()} - - -
; }, @@ -258,6 +271,7 @@ const ListPage = createClass({ {this.props.navItems} {this.renderSortOptions()} + {this.renderTagsOptions()}
diff --git a/client/homebrew/pages/basePages/listPage/listPage.less b/client/homebrew/pages/basePages/listPage/listPage.less index bcffbf3e7c..e2e079f248 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.less +++ b/client/homebrew/pages/basePages/listPage/listPage.less @@ -52,7 +52,7 @@ } } } - .sort-container{ + .sort-container { font-family : 'Open Sans', sans-serif; position : sticky; top : 0; @@ -124,4 +124,71 @@ } + .tags-container { + font-family : 'Open Sans', sans-serif; + position : sticky; + top : 0; + left : 0; + width : 100%; + height : 30px; + background-color : #555; + border-top : 1px solid #666; + border-bottom : 1px solid #666; + color : white; + text-align : center; + z-index : 1; + display : flex; + justify-content : center; + align-items : center; + column-gap : 15px; + row-gap : 5px; + flex-wrap : wrap; + span { + text-transform : uppercase; + font-family : 'Open Sans', sans-serif; + font-size : 11px; + font-weight : bold; + border : 1px solid; + border-radius : 3px; + padding : 3px; + cursor : pointer; + &:before { + font-family: 'Font Awesome 5 Free'; + font-size: 12px; + margin-right: 3px; + } + &.type { + background-color: #0080003b; + color: #008000; + border-color: #008000; + &:before{ + content: '\f0ad'; + } + } + &.group { + background-color: #5050503b; + color: #000000; + border-color: #000000; + &:before{ + content: '\f500'; + } + } + &.meta { + background-color: #0000803b; + color: #000080; + border-color: #000080; + &:before{ + content: '\f05a'; + } + } + &.system { + background-color: #8000003b; + color: #800000; + border-color: #800000; + &:before{ + content: '\f518'; + } + } + } + } } From 34be05ac51cb746a8e2791c19d67518563214b4d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 5 Dec 2023 10:00:25 +1300 Subject: [PATCH 17/26] Add X icon to tag window --- .../pages/basePages/listPage/listPage.less | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.less b/client/homebrew/pages/basePages/listPage/listPage.less index e2e079f248..3b31e7d63e 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.less +++ b/client/homebrew/pages/basePages/listPage/listPage.less @@ -157,10 +157,17 @@ font-size: 12px; margin-right: 3px; } + &:after { + content: '\f00d'; + font-family: 'Font Awesome 5 Free'; + font-size: 12px; + margin-left: 3px; + color: #dfdfdf; + } &.type { background-color: #0080003b; - color: #008000; - border-color: #008000; + color: #00d000; + border-color: #00a000; &:before{ content: '\f0ad'; } @@ -175,16 +182,16 @@ } &.meta { background-color: #0000803b; - color: #000080; - border-color: #000080; + color: #0000d0; + border-color: #0000a0; &:before{ content: '\f05a'; } } &.system { background-color: #8000003b; - color: #800000; - border-color: #800000; + color: #d00000; + border-color: #a00000; &:before{ content: '\f518'; } From 2f13b895105dd9d15baff6aca2de6bc22c915de9 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 5 Dec 2023 12:41:27 +1300 Subject: [PATCH 18/26] Styling tweak --- .../pages/basePages/listPage/listPage.less | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.less b/client/homebrew/pages/basePages/listPage/listPage.less index 3b31e7d63e..2343141c4e 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.less +++ b/client/homebrew/pages/basePages/listPage/listPage.less @@ -152,6 +152,7 @@ border-radius : 3px; padding : 3px; cursor : pointer; + color: #dfdfdf; &:before { font-family: 'Font Awesome 5 Free'; font-size: 12px; @@ -162,35 +163,30 @@ font-family: 'Font Awesome 5 Free'; font-size: 12px; margin-left: 3px; - color: #dfdfdf; } &.type { - background-color: #0080003b; - color: #00d000; + background-color: #008000; border-color: #00a000; &:before{ content: '\f0ad'; } } &.group { - background-color: #5050503b; - color: #000000; + background-color: #505050; border-color: #000000; &:before{ content: '\f500'; } } &.meta { - background-color: #0000803b; - color: #0000d0; + background-color: #000080; border-color: #0000a0; &:before{ content: '\f05a'; } } &.system { - background-color: #8000003b; - color: #d00000; + background-color: #800000; border-color: #a00000; &:before{ content: '\f518'; From 75809a5f425137e3f880e0522019b3b16d2a6153 Mon Sep 17 00:00:00 2001 From: Sean Robertson Date: Wed, 6 Dec 2023 08:28:51 +1300 Subject: [PATCH 19/26] Remove forced uppercase --- client/homebrew/pages/basePages/listPage/listPage.less | 1 - 1 file changed, 1 deletion(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.less b/client/homebrew/pages/basePages/listPage/listPage.less index 2343141c4e..eb0f11d642 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.less +++ b/client/homebrew/pages/basePages/listPage/listPage.less @@ -144,7 +144,6 @@ row-gap : 5px; flex-wrap : wrap; span { - text-transform : uppercase; font-family : 'Open Sans', sans-serif; font-size : 11px; font-weight : bold; From 46a0a66fb6ebdf53f74a5bb039463b0835f9c2fe Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 22 Feb 2024 19:20:42 +1300 Subject: [PATCH 20/26] Use currentColor once instead of multiple border-color declarations --- .../homebrew/pages/basePages/listPage/brewItem/brewItem.less | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less index 46a347b3ef..9bee4e5ebd 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.less @@ -63,6 +63,7 @@ white-space: nowrap; display: inline-block; font-weight: bold; + border-color: currentColor; cursor : pointer; &:before { font-family: 'Font Awesome 5 Free'; @@ -72,7 +73,6 @@ &.type { background-color: #0080003b; color: #008000; - border-color: #008000; &:before{ content: '\f0ad'; } @@ -80,7 +80,6 @@ &.group { background-color: #5050503b; color: #000000; - border-color: #000000; &:before{ content: '\f500'; } @@ -88,7 +87,6 @@ &.meta { background-color: #0000803b; color: #000080; - border-color: #000080; &:before{ content: '\f05a'; } @@ -96,7 +94,6 @@ &.system { background-color: #8000003b; color: #800000; - border-color: #800000; &:before{ content: '\f518'; } From 43209186ee52cf71bb9150e05ab8237d6334def9 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 22 Feb 2024 19:27:17 +1300 Subject: [PATCH 21/26] Remove obsolete styling from tags-container --- client/homebrew/pages/basePages/listPage/listPage.less | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.less b/client/homebrew/pages/basePages/listPage/listPage.less index bf2c89e836..0aa4a278df 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.less +++ b/client/homebrew/pages/basePages/listPage/listPage.less @@ -126,18 +126,11 @@ } .tags-container { - font-family : 'Open Sans', sans-serif; - position : sticky; - top : 0; - left : 0; - width : 100%; height : 30px; background-color : #555; border-top : 1px solid #666; - border-bottom : 1px solid #666; + border-bottom : 1px solid #666; color : white; - text-align : center; - z-index : 1; display : flex; justify-content : center; align-items : center; From a2b97abb2ed0674471857ba91d810c01e4b06819 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 25 Feb 2024 11:47:34 +1300 Subject: [PATCH 22/26] Remove missed console.log debugging lines --- client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx | 1 - client/homebrew/pages/basePages/listPage/listPage.jsx | 2 -- 2 files changed, 3 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx index e21f6e8a3f..869fb3044c 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx @@ -46,7 +46,6 @@ const BrewItem = createClass({ }, updateFilter : function(type, term){ - // console.log(`BrewItem: TYPE: ${type}; TERM: ${term}`); this.props.updateListFilter(type, term); }, diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 261d6ec6b3..096c6bbb70 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -130,7 +130,6 @@ const ListPage = createClass({ }, handleFilterTextChange : function(e){ - // console.log(e); this.setState({ filterString : e.target.value, }); @@ -194,7 +193,6 @@ const ListPage = createClass({ renderTagsOptions : function(){ if(this.state.filterTags?.length == 0) return; - console.log('renderTags'); return
{_.map(this.state.filterTags, (tag, idx)=>{ const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/); From 26263c0bf876397a339e60197546bf0821ffb4f3 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Feb 2024 13:01:13 +1300 Subject: [PATCH 23/26] Remove unused function parameter `type` --- .../homebrew/pages/basePages/listPage/brewItem/brewItem.jsx | 2 +- client/homebrew/pages/basePages/listPage/listPage.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx index 869fb3044c..0369305d5e 100644 --- a/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx +++ b/client/homebrew/pages/basePages/listPage/brewItem/brewItem.jsx @@ -137,7 +137,7 @@ const BrewItem = createClass({ {brew.tags.map((tag, idx)=>{ const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/); - return {this.updateFilter('tag', tag);}}>{matches[2]}; + return {this.updateFilter(tag);}}>{matches[2]}; })}
: <> diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 096c6bbb70..2717152ec2 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -137,7 +137,7 @@ const ListPage = createClass({ return; }, - updateListFilter : function(type, term){ + updateListFilter : function(term){ this.updateUrl(this.state.filterString, this.state.sortType, this.state.sortDir, term); }, @@ -196,7 +196,7 @@ const ListPage = createClass({ return
{_.map(this.state.filterTags, (tag, idx)=>{ const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/); - return {this.updateListFilter('tag', tag);}}>{matches[2]}; + return {this.updateListFilter(tag);}}>{matches[2]}; })}
; }, From 9d38c937b4d1d925ad4d67a038c941203a74225a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 03:43:17 +0000 Subject: [PATCH 24/26] Bump eslint from 8.56.0 to 8.57.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 34 +++++++++++++++++----------------- package.json | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 770ff67168..9f39b3bd58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-plugin-jest": "^27.9.0", "eslint-plugin-react": "^7.33.2", "jest": "^29.7.0", @@ -1958,9 +1958,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1978,13 +1978,13 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -2005,9 +2005,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { @@ -5588,16 +5588,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", diff --git a/package.json b/package.json index 884d293ec5..b44d1cc4dc 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-plugin-jest": "^27.9.0", "eslint-plugin-react": "^7.33.2", "jest": "^29.7.0", From f9d8344dbac3a23bcb1d6d3653add157d5120cd3 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Feb 2024 21:16:37 +1300 Subject: [PATCH 25/26] Remove unnecessary function --- client/homebrew/pages/basePages/listPage/listPage.jsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/homebrew/pages/basePages/listPage/listPage.jsx b/client/homebrew/pages/basePages/listPage/listPage.jsx index 2717152ec2..2385b4490f 100644 --- a/client/homebrew/pages/basePages/listPage/listPage.jsx +++ b/client/homebrew/pages/basePages/listPage/listPage.jsx @@ -83,7 +83,7 @@ const ListPage = createClass({ if(!brews || !brews.length) return
No Brews.
; return _.map(brews, (brew, idx)=>{ - return ; + return { this.updateUrl(this.state.filterString, this.state.sortType, this.state.sortDir, tag); }}/>; }); }, @@ -137,10 +137,6 @@ const ListPage = createClass({ return; }, - updateListFilter : function(term){ - this.updateUrl(this.state.filterString, this.state.sortType, this.state.sortDir, term); - }, - updateUrl : function(filterTerm, sortType, sortDir, filterTag=''){ const url = new URL(window.location.href); const urlParams = new URLSearchParams(url.search); @@ -196,7 +192,7 @@ const ListPage = createClass({ return
{_.map(this.state.filterTags, (tag, idx)=>{ const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/); - return {this.updateListFilter(tag);}}>{matches[2]}; + return { this.updateUrl(this.state.filterString, this.state.sortType, this.state.sortDir, tag); }}>{matches[2]}; })}
; }, From 713865fb406e4347184aec6e14dffa4d54e958c3 Mon Sep 17 00:00:00 2001 From: Rodrigo Kuerten Date: Tue, 27 Feb 2024 10:21:53 -0300 Subject: [PATCH 26/26] Remove background-attachment property --- themes/V3/5ePHB/style.less | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 23c3992fd2..c155d1c093 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -307,7 +307,6 @@ margin-left : -0.16cm; background-color : var(--HB_Color_MonsterStatBackground); background-image : @monsterBlockBackground; - background-attachment : unset; background-blend-mode : overlay; border-style : solid; border-width : 7px 6px;