Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
MariagraziaAlastra committed Mar 6, 2015
2 parents e69749b + 8a1e17e commit ae5f80e
Show file tree
Hide file tree
Showing 17 changed files with 350 additions and 54 deletions.
1 change: 1 addition & 0 deletions lib/DDGC/DB/Result/InstantAnswer/Issues.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ column body => {
column tags => {
data_type => 'text',
is_nullable => 1,
serializer_class => 'JSON',
};

column repo => {
Expand Down
96 changes: 83 additions & 13 deletions lib/DDGC/Web/Controller/InstantAnswer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,24 @@ sub queries :Chained('base') :PathPart('queries') :Args(0) {

}

sub dev_pipeline_redirect :Chained('base') :PathPart('pipeline') :Args(0) {
my ( $self, $c, $view ) = @_;

$c->res->redirect($c->chained_uri('InstantAnswer', 'dev_pipeline', 'dev'));
}

sub dev_pipeline_base :Chained('base') :PathPart('pipeline') :CaptureArgs(1) {
my ( $self, $c, $view ) = @_;

$c->stash->{view} = $view;
$c->stash->{ia_page} = "IADevPipeline";
$c->stash->{title} = "Dev Pipeline";

if ($view eq 'dev') {
$c->stash->{logged_in} = $c->user;
$c->stash->{is_admin} = $c->user? $c->user->admin : 0;
}

$c->add_bc('Instant Answers', $c->chained_uri('InstantAnswer','index'));
$c->add_bc('Dev Pipeline', $c->chained_uri('InstantAnswer', 'dev_pipeline', $view));
}
Expand Down Expand Up @@ -193,20 +205,77 @@ sub dev_pipeline_json :Chained('dev_pipeline_base') :PathPart('json') :Args(0) {
ready => \@ready,
};
} elsif ($view eq 'live') {
my @ial = $rs->search(
{'issues.is_pr' => { '!=' => 1 },
'me.dev_milestone' => { '=' => 'live'},
},
{
columns => [ qw/ name id repo dev_milestone producer designer developer/ ],
order_by => [ qw/ name/ ],
prefetch => [ qw/ issues / ],
result_class => 'DBIx::Class::ResultClass::HashRefInflator',
$rs = $c->d->rs('InstantAnswer::Issues');

my @result = $rs->search({'is_pr' => 0})->all;

my %ial;
my $ia;
my $id;
my $dev_milestone;
my @tags;
my %temp_tags;

for my $issue (@result) {
$id = $issue->instant_answer_id;
$ia = $c->d->rs('InstantAnswer')->find($id);
$dev_milestone = $ia->dev_milestone;
my @issues;
if ($dev_milestone eq 'live') {
for my $tag (@{$issue->tags}) {
if (!$temp_tags{$tag->{name}}) {
$temp_tags{$tag->{name}} = {
name => $tag->{name},
color => $tag->{color}
};
}
}

if (defined $ial{$id}) {
my @existing_issues = @{$ial{$id}->{issues}};
push(@existing_issues, {
issue_id => $issue->issue_id,
title => $issue->title,
tags => $issue->tags
});

$ial{$id}->{issues} = \@existing_issues;
} else {
push(@issues, {
issue_id => $issue->issue_id,
title => $issue->title,
tags => $issue->tags
});

$ial{$id} = {
name => $ia->name,
id => $ia->id,
repo => $ia->repo,
dev_milestone => $ia->dev_milestone,
producer => $ia->producer,
designer => $ia->designer,
developer => $ia->developer,
issues => \@issues
};


}
}
)->all;
}

my @sorted_ial;

foreach my $ia_id (sort keys %ial) {
push(@sorted_ial, $ial{$ia_id});
}

foreach my $tag_name (sort keys %temp_tags) {
push(@tags, $temp_tags{$tag_name});
}

$c->stash->{x} = {
ia => \@ial
ia => \@sorted_ial,
tags => \@tags
};
}

Expand Down Expand Up @@ -267,6 +336,7 @@ sub ia_base :Chained('base') :PathPart('view') :CaptureArgs(1) { # /ia/view/cal
)->all;

$c->stash->{topic_list} = \@topics;
$c->stash->{dev_milestone} = $dev_milestone;
if ($dev_milestone eq 'live') {
$c->add_bc('Instant Answers', $c->chained_uri('InstantAnswer','index'));
} else {
Expand Down Expand Up @@ -296,14 +366,14 @@ sub ia_json :Chained('ia_base') :PathPart('json') :Args(0) {
id => $issue->issue_id,
title => $issue->title,
body => $issue->body,
tags => $issue->tags? from_json($issue->tags) : undef
tags => $issue->tags
);
} else {
push(@ia_issues, {
issue_id => $issue->issue_id,
title => $issue->title,
body => $issue->body,
tags => $issue->tags? from_json($issue->tags) : undef
tags => $issue->tags
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ddg_community_platform",
"version": "0.60.0",
"version": "0.61.0",
"engines": {
"node": ">=0.10.0"
},
Expand Down
1 change: 1 addition & 0 deletions root/static/css/ddgc0.60.0.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions root/static/css/ia0.60.0.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions root/static/js/ddgc0.60.0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions root/static/js/ia0.60.0.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion script/ghIssues.pl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sub getIssues{
issue_id => $issue->{'number'} || '',
title => decode_utf8($issue->{'title'}) || '',
body => decode_utf8($issue->{'body'}) || '',
tags => encode_json($issue->{'labels'}) || '',
tags => $issue->{'labels'} || '',
created => $issue->{'created_at'} || '',
is_pr => $is_pr,
);
Expand Down
Loading

0 comments on commit ae5f80e

Please sign in to comment.