Skip to content

Commit

Permalink
Still debugging main
Browse files Browse the repository at this point in the history
  • Loading branch information
EricSommerhalder committed Jul 3, 2020
1 parent 2d93fe2 commit 2032902
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/components/search-page/search-page.component.html
Expand Up @@ -84,8 +84,8 @@
</td>
</tr>
</table>
<a mat-button (click) = "previousPage()">Previous</a>
<a mat-button (click) = "nextPage()">Next</a>
<a mat-button (click) = "changePage(-1)">Previous</a>
<a mat-button (click) = "changePage(1)">Next</a>

</div>
</div> <!-- End wrapper -->
Expand Down
15 changes: 14 additions & 1 deletion src/app/components/search-page/search-page.component.ts
Expand Up @@ -35,7 +35,8 @@ type valueType = (possibleValues | PropertyValuePair);
styleUrls: ['./search-page.component.css']
})
export class SearchPageComponent implements OnInit {
result_page: number = 0;
resultPage: number = 0;
lastQuery: string;
arr: number[];
propertiesChosen: Property[];
valuesChosen: valueType[];
Expand Down Expand Up @@ -354,6 +355,7 @@ export class SearchPageComponent implements OnInit {
}
query += '}';
const querystring = this.sparqlPrep.compile(query, params);
this.lastQuery = querystring;
console.log(querystring);
this.fire(querystring);
}
Expand Down Expand Up @@ -472,6 +474,17 @@ export class SearchPageComponent implements OnInit {
curr.value = value;
this.changeValueOfLinkedRes(id, level - 1, curr);
}
changePage(increment: number) {
if (!this.lastQuery) {
return;
}
if (this.resultPage + increment > 0) {
this.resultPage += increment;
this.lastQuery += '\nOFFSET ' + this.resultPage;
console.log('Firing with:', this.lastQuery);
this.fire(this.lastQuery);
}
}
createEmptyPropValFromLevelWithValue(levels: number, value: valueType): PropertyValuePair {
let toReturn: PropertyValuePair = new PropertyValuePair(new Property('', '', ''), value);
while (levels > 0) {
Expand Down

0 comments on commit 2032902

Please sign in to comment.