diff options
author | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-07-08 22:54:19 +0000 |
---|---|---|
committer | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-07-08 22:54:19 +0000 |
commit | 7b5e71adcc00ae151a7908c2cddcd7323408efc7 (patch) | |
tree | 4d12552e007c79cb83eb728f2e435548272a3caf /lib/Reaction/UI/ViewPort/Collection | |
parent | 65b88951ac01b54d83a9d2c5b27c276e31b839fd (diff) | |
download | reaction-7b5e71adcc00ae151a7908c2cddcd7323408efc7.tar.gz reaction-7b5e71adcc00ae151a7908c2cddcd7323408efc7.zip |
use more MooseX::Types and support actionattribute in Action vp to explicitly provide the URI to post to
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Collection')
-rw-r--r-- | lib/Reaction/UI/ViewPort/Collection/Grid.pm | 15 | ||||
-rw-r--r-- | lib/Reaction/UI/ViewPort/Collection/Role/Order.pm | 10 | ||||
-rw-r--r-- | lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm | 8 |
3 files changed, 17 insertions, 16 deletions
diff --git a/lib/Reaction/UI/ViewPort/Collection/Grid.pm b/lib/Reaction/UI/ViewPort/Collection/Grid.pm index 95fe43a..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 { diff --git a/lib/Reaction/UI/ViewPort/Collection/Role/Order.pm b/lib/Reaction/UI/ViewPort/Collection/Role/Order.pm index 48a5001..da2edc8 100644 --- a/lib/Reaction/UI/ViewPort/Collection/Role/Order.pm +++ b/lib/Reaction/UI/ViewPort/Collection/Role/Order.pm @@ -3,19 +3,19 @@ package Reaction::UI::ViewPort::Collection::Role::Order; use Reaction::Role; use namespace::clean -except => [ qw(meta) ]; - -has enable_order_by => (is => 'rw', isa => 'ArrayRef'); -has coerce_order_by => (isa => 'HashRef', is => 'rw'); +use MooseX::Types::Moose qw/Int HashRef Str ArrayRef/; +has enable_order_by => (is => 'rw', isa => ArrayRef); +has coerce_order_by => (is => 'rw', isa => HashRef); has order_by => ( - isa => 'Str', + isa => Str, is => 'rw', trigger_adopt('order_by'), clearer => 'clear_order_by' ); has order_by_desc => ( - isa => 'Int', + isa => Int, is => 'rw', trigger_adopt('order_by'), lazy_build => 1 diff --git a/lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm b/lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm index 5947752..42907a9 100644 --- a/lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm +++ b/lib/Reaction/UI/ViewPort/Collection/Role/Pager.pm @@ -6,14 +6,14 @@ use aliased 'Reaction::InterfaceModel::Collection'; # XX This needs to be consumed after Ordered use namespace::clean -except => [ qw(meta) ]; - +use MooseX::Types::Moose qw/Int/; #has paged_collection => (isa => Collection, is => 'rw', lazy_build => 1); has pager => (isa => 'Data::Page', is => 'rw', lazy_build => 1); -has page => (isa => 'Int', is => 'rw', lazy_build => 1, trigger_adopt('page'), clearer => 'clear_page'); -has per_page => (isa => 'Int', is => 'rw', lazy_build => 1, trigger_adopt('page')); -has per_page_max => (isa => 'Int', is => 'rw', lazy_build => 1); +has page => (isa => Int, is => 'rw', lazy_build => 1, trigger_adopt('page'), clearer => 'clear_page'); +has per_page => (isa => Int, is => 'rw', lazy_build => 1, trigger_adopt('page')); +has per_page_max => (isa => Int, is => 'rw', lazy_build => 1); sub _build_page { 1 }; sub _build_per_page { 10 }; sub _build_per_page_max { 100 }; |