X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FReaction%2FUI%2FViewPort%2FCollection%2FGrid.pm;h=1cf3fd9a82b426c5939fac59b2395683bb51dfe0;hb=565a1fc7fe67c721f2766bdc3f55c5fcb33fc760;hp=3879233b288cbf69f7f508526cc9234f888ca620;hpb=f5e2ab69e2045b9ffe04b7436c7e2cf51bc4c4e9;p=catagits%2FReaction.git diff --git a/lib/Reaction/UI/ViewPort/Collection/Grid.pm b/lib/Reaction/UI/ViewPort/Collection/Grid.pm index 3879233..1cf3fd9 100644 --- a/lib/Reaction/UI/ViewPort/Collection/Grid.pm +++ b/lib/Reaction/UI/ViewPort/Collection/Grid.pm @@ -6,30 +6,31 @@ use aliased 'Reaction::InterfaceModel::Collection' => 'IM_Collection'; use aliased 'Reaction::UI::ViewPort::Collection::Grid::Member::WithActions'; use namespace::clean -except => [ qw(meta) ]; +use MooseX::Types::Moose qw/ArrayRef HashRef Int/; extends 'Reaction::UI::ViewPort::Collection'; -has field_order => ( is => 'ro', isa => 'ArrayRef', lazy_build => 1); -has excluded_fields => ( is => 'ro', isa => 'ArrayRef', lazy_build => 1); -has included_fields => ( is => 'ro', isa => 'ArrayRef', lazy_build => 1); -has computed_field_order => (is => 'ro', isa => 'ArrayRef', lazy_build => 1); +has field_order => ( is => 'ro', isa => ArrayRef, lazy_build => 1); +has excluded_fields => ( is => 'ro', isa => ArrayRef, lazy_build => 1); +has included_fields => ( is => 'ro', isa => ArrayRef, lazy_build => 1); +has computed_field_order => (is => 'ro', isa => ArrayRef, lazy_build => 1); has _raw_field_labels => ( is => 'rw', - isa => 'HashRef', + isa => HashRef, init_arg => 'field_labels', default => sub { {} }, ); has field_labels => ( is => 'ro', - isa => 'HashRef', + isa => HashRef, lazy_build => 1, init_arg => undef, ); has member_action_count => ( is => 'rw', - isa => 'Int', + isa => Int, required => 1, lazy => 1, default => sub { @@ -49,7 +50,7 @@ sub _build_field_labels { my $self = shift; my %labels = %{$self->_raw_field_labels}; for my $field ( @{$self->computed_field_order}) { - next if $labels{$field}; + next if defined $labels{$field}; $labels{$field} = join(' ', map{ ucfirst } split('_', $field)); } return \%labels;