Skip to content

Commit

Permalink
Add id to filters in normal and advanced views (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
srpiatt authored Nov 29, 2023
1 parent 922badd commit f7dfa16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class ScEnvironmentsList extends React.Component {
!_.isEmpty(
_.find(
[
env.id,
env.name,
env.description,
env.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function ModeToggle({ mode, onToggle }) {
export default function FilterForm({ mode, filters, fields, onFilter }) {
const [form, setForm] = useState(
filters.reduce((acc, { key, value, match }) => ({ ...acc, [key]: { value: [...value], match } }), {
id: { value: [] },
name: { value: [] },
user: { value: [] },
project: { value: [] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class ScEnvAdvancedList extends React.Component {
const statusOptions = statusMap.map(({ name }) => ({ text: name, value: name }));

const fields = [
{ key: 'id', label: 'ID', icon: 'hashtag', hidden: true },
{ key: 'name', label: 'Name', icon: 'info' },
{ key: 'user', label: 'Created By', icon: 'user', options: options.user },
{ key: 'createdAt', label: 'Created At', icon: 'calendar alternate outline', type: 'date', filterable: false },
Expand Down Expand Up @@ -243,7 +244,8 @@ class ScEnvAdvancedList extends React.Component {
);
} else if (isStoreNotEmpty(store)) {
const fields = this.getEnvFields(store.list);
const tableColumns = fields.map(column => _.pick(column, ['key', 'label', 'sortable', 'type']));
const tableColumns = fields.filter(({ hidden = false }) => !hidden)
.map(column => _.pick(column, ['key', 'label', 'sortable', 'type']));
const { paginatedEnvList, filteredEnvsCount } = this.getPaginatedEnvs();
current = filteredEnvsCount;
total = store.total;
Expand Down

0 comments on commit f7dfa16

Please sign in to comment.