Package org.jtalks.jcommune.plugin.api.web.dto

Examples of org.jtalks.jcommune.plugin.api.web.dto.CreateTopicBtnDto$CreateTopicBtnDtoComparator


                aclEvaluator.hasPermission(authentication, branchId, "BRANCH", "BranchPermission.CREATE_CODE_REVIEW");

        List<CreateTopicBtnDto> topicTypes = new ArrayList<>();

        if (hasTopicPermission) {
            topicTypes.add(new CreateTopicBtnDto("new-topic-btn", "label.addtopic", "label.addtopic.tip",
                    "/topics/new?branchId=" + branchId, CREATE_TOPIC_BUTTON_ORDER));
        }

        if (hasReviewPermission) {
            topicTypes.add(new CreateTopicBtnDto("new-code-review-btn", "label.addCodeReview", "label.addCodeReview.tip",
                    "/reviews/new?branchId=" + branchId, CREATE_CODE_REVIEW_BUTTON_ORDER));
        }

        List<TopicPlugin> topicPlugins = getEnabledTopicPlugins();
        for (TopicPlugin topicPlugin : topicPlugins) {
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    public CreateTopicBtnDto getCreateTopicBtnDto(long branchId) {
        Locale locale = ReadOnlySecurityService.getInstance().getCurrentUser().getLanguage().getLocale();
        return new CreateTopicBtnDto("new-question-btn", translateLabel("label.addQuestion", locale),
                translateLabel("label.addQuestion.tip", locale), CONTEXT + "/new?branchId=" + branchId, order);
    }
View Full Code Here

        UserReader userReader = mock(UserReader.class);
        when(userReader.getCurrentUser()).thenReturn(currentUser);
        ReadOnlySecurityService service = (ReadOnlySecurityService) ReadOnlySecurityService.getInstance();
        service.setUserReader(userReader);

        CreateTopicBtnDto createTopicBtnDto = new QuestionsAndAnswersPlugin().getCreateTopicBtnDto(1);
        assertEquals("Ask Question", createTopicBtnDto.getDisplayNameKey());
    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.plugin.api.web.dto.CreateTopicBtnDto$CreateTopicBtnDtoComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.