Skip to content

Commit

Permalink
Add summit timezone, change action operator, fix placeholder
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Castillo <[email protected]>
  • Loading branch information
tomrndom committed Jul 17, 2024
1 parent 1412d99 commit a8a5094
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/actions/audit-log-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const parseFilters = (filters, term = null) => {
if (isNumericString(term)) {
searchString += `entity_id==${term}`;
} else {
searchString += `action=@${escapedTerm}`
searchString += `action@@${escapedTerm}`
}

filter.push(searchString);
Expand Down
13 changes: 7 additions & 6 deletions src/components/audit-logs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Pagination } from "react-bootstrap";
import { connect } from "react-redux";
import { clearAuditLogParams, getAuditLog } from "../../actions/audit-log-actions";

const AuditLogs = ({ entityFilter = [], term, logEntries, perPage, lastPage, currentPage, order, orderDir, columns, getAuditLog, clearAuditLogParams, filters }) => {
const AuditLogs = ({ entityFilter = [], currentSummit, term, logEntries, perPage, lastPage, currentPage, order, orderDir, columns, getAuditLog, clearAuditLogParams, filters }) => {

const defaultFilters = {
user_id_filter: [],
Expand Down Expand Up @@ -167,8 +167,8 @@ const AuditLogs = ({ entityFilter = [], term, logEntries, perPage, lastPage, cu
format={{ date: "YYYY-MM-DD", time: "HH:mm" }}
inputProps={{ placeholder: T.translate("audit_log.placeholders.created_date_from") }}
onChange={(ev) => handleChangeDateFilter(ev, false)}
timezone={'UTC'}
value={epochToMomentTimeZone(auditLogFilters.created_date_filter[0], 'UTC')}
timezone={currentSummit.time_zone_id}
value={epochToMomentTimeZone(auditLogFilters.created_date_filter[0], currentSummit.time_zone_id)}
className={'event-list-date-picker'}
/>
</div>
Expand All @@ -178,8 +178,8 @@ const AuditLogs = ({ entityFilter = [], term, logEntries, perPage, lastPage, cu
format={{ date: "YYYY-MM-DD", time: "HH:mm" }}
inputProps={{ placeholder: T.translate("audit_log.placeholders.created_date_to") }}
onChange={(ev) => handleChangeDateFilter(ev, true)}
timezone={'UTC'}
value={epochToMomentTimeZone(auditLogFilters.created_date_filter[1], 'UTC')}
timezone={currentSummit.time_zone_id}
value={epochToMomentTimeZone(auditLogFilters.created_date_filter[1], currentSummit.time_zone_id)}
className={'event-list-date-picker'}
/>
</div>
Expand Down Expand Up @@ -218,7 +218,8 @@ const AuditLogs = ({ entityFilter = [], term, logEntries, perPage, lastPage, cu
);
};

const mapStateToProps = ({ auditLogState }) => ({
const mapStateToProps = ({ currentSummitState, auditLogState }) => ({
currentSummit: currentSummitState.currentSummit,
...auditLogState,
});

Expand Down
2 changes: 1 addition & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2831,7 +2831,7 @@
"order": "Order",
"apply_filters": "Apply Filters",
"placeholders": {
"search_log": "Search By Action / User Full Name",
"search_log": "Search By Action / Entity Id",
"user_id": "Filter by User",
"created_date_from": "Filter by Created Date From",
"created_date_to": "Filter by Created Date To"
Expand Down

0 comments on commit a8a5094

Please sign in to comment.