Skip to content

Commit

Permalink
Addition of deleted date to person field [B: 1742] (#484)
Browse files Browse the repository at this point in the history
* Addition of deleted date to person field

* Removed as_epoch
  • Loading branch information
droberts-ctrlo authored Dec 18, 2024
1 parent 1fa3a0a commit 9422cb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/GADS/Column/Person.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ use MooX::Types::MooseLike::Base qw/:all/;

extends 'GADS::Column';

with 'GADS::Role::Presentation::Column::Person';

our @person_properties = qw/id email username firstname surname freetext1 freetext2 organisation department_id team_id title value/;
our @person_properties = qw/id email username firstname surname freetext1 freetext2 organisation department_id team_id title value deleted/;

has set_filter => (
is => 'rw',
Expand Down
4 changes: 3 additions & 1 deletion lib/GADS/Datum/Person.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use namespace::clean;
extends 'GADS::Datum';

with 'GADS::Role::Presentation::Datum::Person';
with 'GADS::DateTime';

after set_value => sub {
my ($self, $value, %options) = @_;
Expand Down Expand Up @@ -169,6 +170,7 @@ has value_hash => (
team_id => $value->{team_id},
title => $value->{title},
value => $value->{value},
deleted => $value->{deleted},
};
}
elsif ($value) {
Expand Down Expand Up @@ -377,11 +379,11 @@ sub _build_for_code
team => $_->{team},
title => $_->{title},
text => $_->{value},
deleted => GADS::DateTime::parse_datetime($_->{deleted})->epoch,
}
} @{$self->value_hash};

$self->column->multivalue || @values > 1 ? \@values : $values[0];
}

1;

0 comments on commit 9422cb0

Please sign in to comment.