Skip to content
Open

Test #204

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions projects/diff/hunk-sorter.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../../bower_components/polymerfire/firebase-document.html">
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-document.html">
<link rel="import" href="../../ajax/backend-ajax.html">

<link rel="import" href="../project-behavior.html">

<dom-module id="hunk-sorter">
Expand All @@ -37,6 +39,11 @@
path="[[_remoteOrderingPath]]"
data="{{_remoteOrdering}}"
></firebase-document>
<backend-ajax
id="checkIfPathIsThere"
refurl="[[backendPath]]"
></backend-ajax>

</template>
<script>
/*global ProjectBehavior*/
Expand All @@ -59,6 +66,10 @@
_remoteOrderingPath: {
type: String,
computed: '_getOrderingPath(project, pullRequest)'
},
backendPath: {
type: String,
computed: '_updateBackendPath(project, pullRequest)'
}
},
observers: [
Expand Down Expand Up @@ -159,6 +170,11 @@
if (unsortedGroup.diff.length > 0) {
allGroups.push(unsortedGroup);
}
if (fbOrdering.groups === undefined && this.backendPath && defaultGroup.diff.length > 0) {
this.$.checkIfPathIsThere.body = defaultGroup;
this.$.checkIfPathIsThere.generateRequest();
}

this.set('groups', allGroups);
},

Expand Down Expand Up @@ -258,6 +274,10 @@
}
},

_updateBackendPath: function(project, pullRequest) {
return project.owner + '/' + project.name + '/pulls/' + pullRequest.number + '/check';
},

/**
* RFC4122 v4 compliant GUID generator
*/
Expand Down
3 changes: 3 additions & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a

b