Skip to content

Commit

Permalink
made Pending default and fixed clear options button so its consistent…
Browse files Browse the repository at this point in the history
… with other pages (#365)
  • Loading branch information
happycodemonkey authored Nov 19, 2024
1 parent de245fe commit d52d606
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apcd-cms/src/apps/admin_extension/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ def getDate(row):
status_filter = self.request.GET.get('status')
org_filter = self.request.GET.get('org')

context['selected_status'] = 'All'
context['selected_status'] = ''
if status_filter is not None and status_filter != 'All':
context['selected_status'] = status_filter
queryStr += f'&status={status_filter}'
extensions_table_entries = table_filter(status_filter, extensions_table_entries, 'ext_status')

context['selected_org'] = 'All'
context['selected_org'] = ''
if org_filter is not None and org_filter != 'All':
context['selected_org'] = org_filter
queryStr += f'&org={org_filter}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import EditExtensionModal from 'apcd-components/Extensions/EditExtensionModal/Ed
import { formatDate } from 'utils/dateUtil';

export const AdminExtensions: React.FC = () => {
const [status, setStatus] = useState('All');
const [status, setStatus] = useState('Pending');
const [org, setOrg] = useState('All');
const [page, setPage] = useState(1);
const { data, isLoading, isError, refetch } = useExtensions(
Expand All @@ -24,7 +24,7 @@ export const AdminExtensions: React.FC = () => {
useState<ExtensionRow | null>(null);

const clearSelections = () => {
setStatus('');
setStatus('Pending');
setOrg('');
setPage(1);
};
Expand Down Expand Up @@ -105,7 +105,7 @@ export const AdminExtensions: React.FC = () => {
</option>
))}
</select>
{data?.selected_status || data?.selected_org ? (
{data?.selected_status !== "Pending" || data?.selected_org ? (
<button onClick={clearSelections}>Clear Options</button>
) : null}
</div>
Expand Down

0 comments on commit d52d606

Please sign in to comment.