Skip to content

Commit

Permalink
feat: Fix the display of add a new target action in the drawer News l…
Browse files Browse the repository at this point in the history
…ist only for the group content manager - EXO-65909
  • Loading branch information
IlhemEssaadi committed Aug 23, 2023
1 parent c1427c6 commit 076a01b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion webapp/src/main/webapp/WEB-INF/jsp/newsListView.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
PortalHttpServletResponseWrapper responseWrapper = ( PortalHttpServletResponseWrapper ) rcontext.getResponse();
String newsListUrl = "/portal/rest/v1/news/byTarget/" + newsTarget + "?offset=0&limit=" + limit + "&returnSize=true";
responseWrapper.addHeader("Link", "<" + newsListUrl + ">; rel=prefetch; as=fetch; crossorigin=use-credentials", false);
boolean canManageNews = NewsUtils.canManageNewsPublishTargets(currentIdentity);
%>
<div class="news-list-view-app" id="<%= appId %>">
<script type="text/javascript">
eXo.env.portal.canManageNews = <%=canManageNews%>;
require(['PORTLET/news/NewsListView'], app => app.init({
appId: '<%=appId%>',
saveSettingsURL: <%= "'" + saveSettingsURL + "'" %>,
Expand All @@ -87,7 +89,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
showArticleSpace: <%= showArticleSpace == null ? null : "'" + showArticleSpace + "'" %>,
showArticleReactions: <%= showArticleReactions == null ? null : "'" + showArticleReactions + "'" %>,
showArticleDate: <%= showArticleDate == null ? null : "'" + showArticleDate + "'" %>,
seeAllUrl: <%= seeAllUrl == null ? null : "'" + seeAllUrl + "'" %>
seeAllUrl: <%= seeAllUrl == null ? null : "'" + seeAllUrl + "'" %>,
}));
</script>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</template>
</v-select>
</div>
<div class="d-flex flex-row clickable text-decoration-underline">
<div v-if="canManageNews" class="d-flex flex-row clickable text-decoration-underline">
<a @click="createNewTarget"> {{ $t('news.list.settings.drawer.createNewTarget') }} </a>
</div>
<div v-if="newsTargets.length === 0" class="d-flex flex-row grey--text">
Expand Down Expand Up @@ -197,7 +197,8 @@ export default {
showArticleReactions: false,
showTooltip: false,
seeAllUrl: `${eXo.env.portal.context}/${eXo.env.portal.portalName}/news?filter=pinned`,
saveSettingsURL: ''
saveSettingsURL: '',
canManageNews: eXo.env.portal.canManageNews
}),
computed: {
backgroundColor(){
Expand Down

0 comments on commit 076a01b

Please sign in to comment.