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
jbarrett committed Feb 13, 2015
2 parents 3fd18af + 26ec31b commit 878c13a
Show file tree
Hide file tree
Showing 25 changed files with 916 additions and 122 deletions.
112 changes: 110 additions & 2 deletions lib/DDGC/DB/Result/InstantAnswer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,24 @@ column perl_module => {
is_nullable => 1,
};

# JSON array of dependencies
column perl_dependencies => {
data_type => 'text',
is_nullable => 1,
};

# idea, planning, alpha, beta, qa, ready, live, disabled
column dev_milestone => {
data_type => 'text',
is_nullable => 1,
};

# is the IA live or not live?
column is_live => {
data_type => 'integer',
is_nullable => 1,
};

# JSON associative array of dates when milestones reached { idea: "date", planning: "date" , .. }
column milestone_dates => {
data_type => 'text',
Expand Down Expand Up @@ -100,6 +112,12 @@ column screenshot => {
is_nullable => 1,
};

# JSON array of mockups urls
column mockups => {
data_type => 'text',
is_nullable => 1,
};

# eg 'info', broad brush for v1.
column template_group => {
data_type => 'text',
Expand All @@ -112,6 +130,12 @@ column custom_templates => {
is_nullable => 1,
};

# JSON array of triggers
column triggers => {
data_type => 'text',
is_nullable => 1,
};

# primary example query
column example_query => {
data_type => 'text',
Expand Down Expand Up @@ -179,12 +203,96 @@ column type => {
is_nullable => 1,
};

# IA sponsor
column assignee => {
# IA producer (must be an admin)
column producer => {
data_type => 'text',
is_nullable => 1,
};

# IA designer (must be an admin)
column designer => {
data_type => 'text',
is_nullable => 1,
};

# IA developer
column developer => {
data_type => 'text',
is_nullable => 1,
};

# code review (can be completed, aka '1', or not completed, aka '0')
column code_review => {
data_type => 'integer',
is_nullalbe => 1,
};

# design review (can be completed, aka '1', or not completed, aka '0')
column design_review => {
data_type => 'integer',
is_nullalbe => 1,
};

# name of the test machine on which the IA is on when in QA
column test_machine => {
data_type => 'text',
is_nullable => 1,
};

# test results on IE 8
column browsers_ie => {
data_type => 'integer',
is_nullable => 1,
};

# test results on Google Chrome
column browsers_chrome => {
data_type => 'integer',
is_nullable => 1,
};

# test results on Firefox
column browsers_firefox => {
data_type => 'integer',
is_nullable => 1,
};

# test results on Safari
column browsers_safari => {
data_type => 'integer',
is_nullable => 1,
};

# test results on Opera
column browsers_opera => {
data_type => 'integer',
is_nullable => 1,
};

# test results on Android
column mobile_android => {
data_type => 'integer',
is_nullable => 1,
};

# test results on iOS
column mobile_ios => {
data_type => 'integer',
is_nullable => 1,
};

# test results for relevancy
column tested_relevancy => {
data_type => 'integer',
is_nullable => 1,
};

# test results on staging machine
column tested_staging => {
data_type => 'integer',
is_nullable => 1,
};

column src_options => {
data_type => 'text',
is_nullable => 1,
Expand Down
6 changes: 6 additions & 0 deletions lib/DDGC/DB/Result/InstantAnswer/Issues.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ column tags => {
column repo => {
data_type => 'text',
};

column is_pr => {
data_type => 'text',
is_nullable => 1,
};

primary_key (qw/issue_id repo/);

belongs_to 'instant_answer', 'DDGC::DB::Result::InstantAnswer', 'instant_answer_id', {on_delete => 'cascade'};
Expand Down
5 changes: 0 additions & 5 deletions lib/DDGC/DB/Result/Token/Language.pm
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ sub add_user_translation {
username => $user->username,
})->first;
unless ($found) {
$self->search_related('token_language_translations',{
'token_language_translation_votes.id' => undef,
},{
join => [qw( token_language_translation_votes )]
})->delete;
my $plurals=$self->max_msgstr_index;
for (my $i = $plurals; $i > -1; $i--) {
return 0 unless $translation->{'msgstr'.$i};
Expand Down
10 changes: 5 additions & 5 deletions lib/DDGC/Web/Controller/Campaign/SubmitResponse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ sub respond : Chained('base') : PathPart('respond') : Args(0) {
my $confidence = confidence(@languages);


if ( $response_length < $campaign->{min_length} + 10 ) {
if ( $response_length < $campaign->{min_length} + 20 ) {
$flag_response = 1;
if ( $response_length < $campaign->{min_length} ) {
$short_response = 1;
Expand All @@ -89,7 +89,10 @@ sub respond : Chained('base') : PathPart('respond') : Args(0) {
return $c->detach;
}

my $subject_extra = '';
if ($campaign_name eq 'share') {
($language ne "en" || $confidence < 0.57) && ($subject_extra = '** POSSIBLE SPAM ** ');
($flag_response) && ($subject_extra = '** SHORT RESPONSE ** ');
my $report_url = $c->chained_uri( 'Admin::Campaign', 'bad_user_response', { user => $username, campaign => $campaign_name} );
$c->stash->{'extra'} = <<"BAD_RESPONSE_LINK"
Language: $language, Confidence: $confidence<br />
Expand All @@ -99,10 +102,7 @@ sub respond : Chained('base') : PathPart('respond') : Args(0) {
BAD_RESPONSE_LINK
}

my $subject =
(($flag_response)? "** SHORT RESPONSE ** " : "" ) .
(($language ne "en" || $confidence < 0.65)? "** POSSIBLE SPAM ** " : "") .
"$campaign_name response from $username";
my $subject = "${subject_extra}$campaign_name response from $username";
my $error = 0;
try {
$c->d->postman->template_mail(
Expand Down
Loading

0 comments on commit 878c13a

Please sign in to comment.