aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-08-01 02:16:25 +0000
committerwreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-08-01 02:16:25 +0000
commit07a9ef7dbcbcd2b0202b4d529602e95039a62944 (patch)
tree0b81e12729cfba49f8d7a1690b04692ff8b25bb2
parenta36b6256ca273526c57e50837f615256b0a1354c (diff)
downloadreaction-07a9ef7dbcbcd2b0202b4d529602e95039a62944.tar.gz
reaction-07a9ef7dbcbcd2b0202b4d529602e95039a62944.zip
updated FieldArgs role after merge
-rw-r--r--lib/Reaction/UI/ViewPort/Role/Actions.pm13
-rw-r--r--lib/Reaction/UI/ViewPort/Role/FieldArgs.pm9
2 files changed, 5 insertions, 17 deletions
diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm
index 32c7bbb..eb8ad76 100644
--- a/lib/Reaction/UI/ViewPort/Role/Actions.pm
+++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm
@@ -5,12 +5,6 @@ use Reaction::UI::ViewPort::URI;
use namespace::clean -except => [ qw(meta) ];
-has actions => (
- is => 'ro',
- isa => 'ArrayRef',
- lazy_build => 1
-);
-
has action_order => (
is => 'ro',
isa => 'ArrayRef'
@@ -50,14 +44,17 @@ sub _build_computed_action_order {
return $ordered;
}
-sub _build_actions {
+sub actions {
my ($self) = @_;
my (@act, $i);
my $ctx = $self->ctx;
my $loc = $self->location;
my $target = $self->model;
+ my $valid_actions = $self->has_action_filter ?
+ $self->action_filter->($self->computed_action_order, $self->model)
+ : $self->computed_action_order;
- foreach my $proto_name ( @{ $self->computed_action_order } ) {
+ foreach my $proto_name ( @$valid_actions ) {
my $proto = $self->action_prototypes->{$proto_name};
my $uri = $proto->{uri} or confess('uri is required in prototype action');
my $label = exists $proto->{label} ? $proto->{label} : $proto_name;
diff --git a/lib/Reaction/UI/ViewPort/Role/FieldArgs.pm b/lib/Reaction/UI/ViewPort/Role/FieldArgs.pm
index bff31c2..0a2aa51 100644
--- a/lib/Reaction/UI/ViewPort/Role/FieldArgs.pm
+++ b/lib/Reaction/UI/ViewPort/Role/FieldArgs.pm
@@ -64,17 +64,8 @@ around _build_members => sub {
my $orig = shift;
my $self = shift;
$self->member_args->{computed_field_order} ||= $self->computed_field_order;
- $self->member_args->{computed_action_order} ||= [];
my $members = $self->$orig(@_);
- # cache everything yo
- for my $member (@$members){
- $member->clear_computed_action_order;
- my $order = $member->computed_action_order;
- @{ $self->member_args->{computed_action_order} } = @$order;
- last;
- }
-
return $members;
};