Skip to content

Commit

Permalink
Merge pull request #10 from gimnathperera/ci/github-package-configura…
Browse files Browse the repository at this point in the history
…tions

Ci/GitHub package configurations
  • Loading branch information
gimnathperera authored Sep 18, 2023
2 parents 3ed3a20 + 6f684e5 commit 0250442
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-chicken-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gimnathperera/react-mui-multi-search': patch
---

fix: applying same filter value for the same key
9 changes: 0 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:

- name: Install dependencies
run: npm install --frozen-lockfile
- name: Debug NPM_AUTH_TOKEN
run: echo $NPM_AUTH_TOKEN

- name: Create Release Pull Request or Publish
id: changesets
Expand All @@ -37,10 +35,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Publish to GitHub Packages
run: |
echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> ~/.npmrc
npm publish --registry=https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 7 additions & 2 deletions src/components/MultiSearch/MultiSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export const MultiSearch: React.FC<Props> = ({
}, [onPrint]);

const handleAddFilterByParam = useCallback(({ filterKey, filterValue }: FilteredBy) => {
const filterExists = searchParams.find(
param => param.key === filterKey && param.value === filterValue,
);
if (filterExists) return;

setSearchParams(prevSearchParams => [
...prevSearchParams,
{ key: filterKey, value: filterValue },
Expand Down Expand Up @@ -74,11 +79,11 @@ export const MultiSearch: React.FC<Props> = ({
</StyledIconButton>
</SearchBarContainer>
</Grid>
{searchParams.length > 0 && (
{searchParams.length > 0 ? (
<Grid item xs={12}>
<AppliedFilters searchParams={searchParams} onDelete={handleRemoveSearchParam} />
</Grid>
)}
) : null}
</Grid>
);
};

0 comments on commit 0250442

Please sign in to comment.