Search in sources :

Example 16 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class PoliticianRankingMenuItemFactoryImpl method createOverviewPage.

@Override
public void createOverviewPage(final VerticalLayout panelContent) {
    final ResponsiveRow grid = createGridLayout(panelContent);
    createButtonLink(grid, POLITICAL_EXPERIENCE_SUMMARY, VaadinIcons.BUG, COMMAND_DATAGRID, "All politicans, scoreboard assignments and days served in government, committees, speaker and party positions.");
    createButtonLink(grid, ALL_PARTIES, VaadinIcons.GROUP, COMMAND_ALL_PARTIES, "All parties summary by number of roles in parliament");
    createButtonLink(grid, CURRENT_PARTIES, VaadinIcons.GROUP, COMMAND_CURRENT_PARTIES, "Current parties roles in parliament");
    createButtonLink(grid, PAGE_VISIT_HISTORY_TEXT, VaadinIcons.BUG, COMMAND_PAGEVISITHISTORY, "View history of page visit for this page.");
}
Also used : ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow)

Example 17 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class AgentOperationsOverviewPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    getMenuItemFactory().createMainPageMenuBar(menuBar);
    LabelFactory.createHeader2Label(content, ADMIN_AGENT_OPERATION);
    final VerticalLayout overviewLayout = new VerticalLayout();
    overviewLayout.setSizeFull();
    content.addComponent(overviewLayout);
    content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
    final ResponsiveRow grid = createGridLayout(overviewLayout);
    for (final DataAgentTarget dataAgentTarget : DataAgentTarget.values()) {
        final Button importDataButton = new Button(MessageFormat.format(BUTTON_PATTERN, DataAgentOperation.IMPORT, dataAgentTarget), VaadinIcons.BULLSEYE);
        importDataButton.addClickListener(new StartAgentClickListener(dataAgentTarget, DataAgentOperation.IMPORT));
        importDataButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, DataAgentOperation.IMPORT, dataAgentTarget));
        createRowItem(grid, importDataButton, WILL_FETCH_DATA_FROM_SOURCE);
    }
    final String pageId = getPageId(parameters);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
    return content;
}
Also used : Button(com.vaadin.ui.Button) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) VerticalLayout(com.vaadin.ui.VerticalLayout) DataAgentTarget(com.hack23.cia.model.internal.application.data.impl.DataAgentTarget) StartAgentClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.StartAgentClickListener) Secured(org.springframework.security.access.annotation.Secured)

Example 18 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class DataSummaryOverviewPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    getMenuItemFactory().createMainPageMenuBar(menuBar);
    LabelFactory.createHeader2Label(content, ADMIN_DATA_SUMMARY);
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setSizeFull();
    content.addComponent(horizontalLayout);
    content.setExpandRatio(horizontalLayout, ContentRatio.LARGE);
    final DataContainer<DataSummary, String> dataContainer = getApplicationManager().getDataContainer(DataSummary.class);
    final List<DataSummary> all = dataContainer.getAll();
    if (!all.isEmpty()) {
        final DataSummary dataSummary = all.get(0);
        getFormFactory().addFormPanelTextFields(horizontalLayout, dataSummary, DataSummary.class, DATASUMMARY_FORM_FIELDS);
    }
    final VerticalLayout overviewLayout = new VerticalLayout();
    overviewLayout.setSizeFull();
    content.addComponent(overviewLayout);
    content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
    final ResponsiveRow grid = createGridLayout(overviewLayout);
    final Button refreshViewsButton = new Button(REFRESH_VIEWS, VaadinIcons.REFRESH);
    refreshViewsButton.addClickListener(new RefreshDataViewsClickListener());
    createRowItem(grid, refreshViewsButton, REFRESH_ALL_VIEWS);
    final Button updateSearchIndexButton = new Button(UPDATE_SEARCH_INDEX, VaadinIcons.REFRESH);
    updateSearchIndexButton.addClickListener(new UpdateSearchIndexClickListener());
    createRowItem(grid, updateSearchIndexButton, UPDATE_DOCUMENT_SEARCH_INDEX);
    final Button removeDataButton = new Button(REMOVE_POLITICIANS, VaadinIcons.DEL);
    removeDataButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.POLITICIAN));
    createRowItem(grid, removeDataButton, REMOVE_POLITICIANS);
    final Button removeDocumentsButton = new Button(REMOVE_DOCUMENTS, VaadinIcons.DEL);
    removeDocumentsButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.DOCUMENTS));
    createRowItem(grid, removeDocumentsButton, REMOVE_DOCUMENTS);
    final Button removeApplicationHistoryButton = new Button(REMOVE_APPLICATION_HISTORY, VaadinIcons.DEL);
    removeApplicationHistoryButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.APPLICATION_HISTORY));
    createRowItem(grid, removeApplicationHistoryButton, REMOVE_APPLICATION_HISTORY);
    return content;
}
Also used : Button(com.vaadin.ui.Button) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) RefreshDataViewsClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RefreshDataViewsClickListener) UpdateSearchIndexClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.UpdateSearchIndexClickListener) VerticalLayout(com.vaadin.ui.VerticalLayout) DataSummary(com.hack23.cia.service.api.DataSummary) RemoveDataClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RemoveDataClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 19 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class UserHomeSecuritySettingsPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();
    final String pageId = getPageId(parameters);
    userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId);
    LabelFactory.createHeader2Label(panelContent, SECURITY_SETTINGS);
    final Long userIdFromSecurityContext = UserContextUtil.getUserInternalIdFromSecurityContext();
    if (userIdFromSecurityContext == null) {
        UI.getCurrent().getNavigator().navigateTo(CommonsViews.MAIN_VIEW_NAME);
    } else {
        final VerticalLayout overviewLayout = new VerticalLayout();
        overviewLayout.setSizeFull();
        panelContent.addComponent(overviewLayout);
        panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE);
        final ResponsiveRow grid = createGridLayout(overviewLayout);
        createRowItem(grid, createEnableGoogleAuthButton(), "Enable MFA using google authenticator");
        createRowItem(grid, createDisableGoogleAuthButton(), "Disable MFA using google authenticator");
    }
    panel.setCaption(NAME + "::" + USERHOME + SECURITY_SETTINGS);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_USER_HOME_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    return panelContent;
}
Also used : ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

ResponsiveRow (com.jarektoro.responsivelayout.ResponsiveRow)19 PageModeMenuCommand (com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand)7 VerticalLayout (com.vaadin.ui.VerticalLayout)6 Secured (org.springframework.security.access.annotation.Secured)6 Button (com.vaadin.ui.Button)3 ClickListener (com.vaadin.ui.Button.ClickListener)2 FormLayout (com.vaadin.ui.FormLayout)2 Panel (com.vaadin.ui.Panel)2 DataAgentTarget (com.hack23.cia.model.internal.application.data.impl.DataAgentTarget)1 UserAccount (com.hack23.cia.model.internal.application.user.impl.UserAccount)1 DataSummary (com.hack23.cia.service.api.DataSummary)1 ManageUserAccountRequest (com.hack23.cia.service.api.action.admin.ManageUserAccountRequest)1 AccountOperation (com.hack23.cia.service.api.action.admin.ManageUserAccountRequest.AccountOperation)1 LoginRequest (com.hack23.cia.service.api.action.application.LoginRequest)1 RegisterUserRequest (com.hack23.cia.service.api.action.application.RegisterUserRequest)1 ApplicationLoginListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.ApplicationLoginListener)1 ManageUserAccountClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.ManageUserAccountClickListener)1 RefreshDataViewsClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RefreshDataViewsClickListener)1 RegisterUserClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RegisterUserClickListener)1 RemoveDataClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RemoveDataClickListener)1