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 9673dce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions 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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</v-card-text>
</v-card>
<news-settings-drawer v-if="canPublishNews" />
<news-publish-targets-management-drawer v-if="canPublishNews" />
<news-publish-targets-management-drawer v-if="canManageNews" />
</v-app>
</template>

Expand Down Expand Up @@ -104,6 +104,7 @@ export default {
hasMore: false,
offset: 0,
canPublishNews: false,
canManageNews: eXo.env.portal.canManageNews
}),
computed: {
displayHeader() {
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 9673dce

Please sign in to comment.