Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v2' into create-trust-relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkparti committed Apr 30, 2024
2 parents 4977138 + 7deae32 commit 3635c82
Show file tree
Hide file tree
Showing 9 changed files with 384 additions and 350 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [2.1.0-v2.2](https://github.com/Greenstand/treetracker-wallet-admin-client/compare/v2.1.0-v2.1...v2.1.0-v2.2) (2024-04-30)


### Bug Fixes

* modified filter features for improved functionality. ([7215b0b](https://github.com/Greenstand/treetracker-wallet-admin-client/commit/7215b0b6f82944bafc46eaf30046daf6ef70a0c3))

# [2.1.0-v2.1](https://github.com/Greenstand/treetracker-wallet-admin-client/compare/v2.0.0...v2.1.0-v2.1) (2024-04-09)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "treetracker-wallet-admin-client",
"version": "2.1.0-v2.1",
"version": "2.1.0-v2.2",
"private": true,
"dependencies": {
"@emotion/react": "^11.10.6",
Expand Down
52 changes: 26 additions & 26 deletions src/models/TrustRelationShipFilter.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { getDateText } from "../utils/formatting";
import { getDateText } from '../utils/formatting';

export default class TrustRelationshipsFilter {
// possible query options
state;
type;
requestType;
before;
after;
constructor(options) {
// assign options properties to created instance
Object.assign(this, options);
}
// where object contains the query options
getWhereObj() {
let where = {};
if (this.state) where.state = this.state.toLowerCase();
if (this.type) where.type = this.type.toLowerCase();
if (this.requestType) where.requestType = this.requestType.toLowerCase();
if (this.before) where.before = getDateText(this.before, 'YYYY-MM-DD');
if (this.after) where.after = getDateText(this.after, 'YYYY-MM-DD');
return where;
}
}
// possible query options
state;
type;
request_type;
before;
after;

constructor(options) {
// assign options properties to created instance
Object.assign(this, options);
}

// where object contains the query options
getWhereObj() {
let where = {};

if (this.state) where.state = this.state.toLowerCase();
if (this.type) where.type = this.type.toLowerCase();
if (this.request_type) where.request_type = this.request_type.toLowerCase();
if (this.before) where.before = getDateText(this.before, 'YYYY-MM-DD');
if (this.after) where.after = getDateText(this.after, 'YYYY-MM-DD');

return where;
}
}
2 changes: 1 addition & 1 deletion src/pages/TrustRelationship/TrustRelationship.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('Trust Relationships page', function () {
);
expect(await screen.findByTestId('table-pagination')).toBeInTheDocument();
expect(await screen.findByTestId('trust-relationships-table')).toBeInTheDocument();
expect(await screen.findByTestId('date-range-filter')).toBeInTheDocument();
// expect(await screen.findByTestId('date-range-filter')).toBeInTheDocument();
expect(await screen.findByTestId('state-select-filter')).toBeInTheDocument();
expect(await screen.findByTestId('requestType-select-filter')).toBeInTheDocument();
expect(await screen.findByTestId('type-select-filter')).toBeInTheDocument();
Expand Down
21 changes: 19 additions & 2 deletions src/pages/TrustRelationship/TrustRelationshipTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,23 @@ import {
TypeSelectFilter,
RequestTypeSelectFilter,
ResetButton,
DateRangeFilter,
// DateRangeFilter
} from './TrustRelationshipsFilters';
import TrustRelationshipSidePanel from './trustRelationshipSidePanel';
import CreateTrustRelationship from './CreateTrustRelationship/CreateTrustRelationship';

const FilterDialog = ({
anchorEl,
handleFilterClose,
filter,
setFilter,
statesList,
requestTypeList,
getStatusColor,
typeList,
defaultFilter,
}) => {
return (
const FilterDialog = ({
anchorEl,
handleFilterClose,
Expand Down Expand Up @@ -81,7 +93,7 @@ const FilterDialog = ({
typeList={typeList}
getStatusColor={getStatusColor}
/>
<DateRangeFilter filter={filter} setFilter={setFilter} />
{/* <DateRangeFilter filter={filter} setFilter={setFilter} /> */}
</Grid>
<Grid
item
Expand Down Expand Up @@ -199,9 +211,11 @@ const TrustRelationshipTableHeader = ({ tableTitle, getStatusColor }) => {
Filters
<FilterListIcon style={{ color: '#86C232', marginLeft: '8px' }} />
</FilterButton>
<FilterDialog
<FilterDialog
anchorEl={anchorEl}
handleFilterClose={handleFilterClose}
handleFilterClose={handleFilterClose}
filter={filter}
setFilter={setFilter}
statesList={statesList}
Expand Down Expand Up @@ -418,6 +432,9 @@ function TrustRelationshipTable({ tableTitle, tableRows, totalRowCount }) {
case 'updated_at':
newSortBy = 'updated_at';
break;
case 'updated_at':
newSortBy = 'updated_at';
break;
default:
newSortBy = columnName;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TrustRelationship/TrustRelationshipTable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('TrustRelationship Table', () => {
expect(
await screen.findByTestId('trust-relationships-table')
).toBeInTheDocument();
expect(await screen.findByTestId('date-range-filter')).toBeInTheDocument();
// expect(await screen.findByTestId('date-range-filter')).toBeInTheDocument();
expect(
await screen.findByTestId('state-select-filter')
).toBeInTheDocument();
Expand Down
Loading

0 comments on commit 3635c82

Please sign in to comment.