Skip to content

Commit

Permalink
Merge pull request #3324 from AtlasOfLivingAustralia/feature/issue2382
Browse files Browse the repository at this point in the history
Added a button to re-index projects for a program #2382
  • Loading branch information
temi authored Sep 12, 2024
2 parents 20e86c6 + 51c66cf commit e1d63ff
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,5 +442,11 @@ class ProgramController {
}
}

@PreAuthorise(accessLevel = 'alaAdmin')
def reindexProjects(String id) {
Map resp = programService.reindexProjects(id)
render resp as JSON
}


}
8 changes: 8 additions & 0 deletions grails-app/services/au/org/ala/merit/ProgramService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,12 @@ class ProgramService {
return webService.getJson("${grailsApplication.config.getProperty('ecodata.baseUrl')}program/listOfAllPrograms")
}

Map reindexProjects(String programId) {
String url = grailsApplication.config.getProperty('ecodata.baseUrl')+"admin/reindexProjects"
Map params = [programId:programId]

Map resp = webService.doPost(url, params)
resp
}

}
9 changes: 9 additions & 0 deletions grails-app/views/program/_admin.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
</div>
</div>

<g:if test="${fc.userIsAlaAdmin()}">
<div class="row mt-3">
<div class="col-sm-3">
<a class="btn btn-info btn-sm admin-action reindexButton" href="${g.createLink(action: 'reindexProjects', id: program.programId)}"><i
class="fa fa-plus"></i> Re-index projects in this program</a>
</div>
</div>
</g:if>

</div>


Expand Down

0 comments on commit e1d63ff

Please sign in to comment.