Search in sources :

Example 1 with ProjectScreenService

use of org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService in project kie-wb-common by kiegroup.

the class ProjectImportServiceImplRepositoryNamesTest method setup.

@Before
public void setup() {
    service = spy(new ProjectImportServiceImpl(ioService, metadataService, repositoryFactory, moduleService, validators, pathUtil, projectService, projectScreenService, newProjectEvent, repoService, spaceConfigStorageRegistry));
    when(spaceConfigStorageRegistry.get(anyString())).thenReturn(spaceConfigStorage);
    when(spaceConfigStorageRegistry.getBatch(anyString())).thenReturn(new SpaceConfigStorageRegistryImpl.SpaceStorageBatchImpl(spaceConfigStorage));
    when(spaceConfigStorageRegistry.exist(anyString())).thenReturn(true);
    when(validators.getValidators()).thenReturn(new ArrayList<>());
    when(ouService.getOrganizationalUnits()).thenReturn(new HashSet<OrganizationalUnit>() {

        {
            add(new OrganizationalUnitImpl("ou1Name", "ou1GroupId"));
        }
    });
    when(moduleService.resolveModule(any(Path.class))).thenAnswer((Answer<KieModule>) invocationOnMock -> {
        final Path path = (Path) invocationOnMock.getArguments()[0];
        final KieModule module = new KieModule(path, path, path, path, path, path, mock(POM.class));
        return module;
    });
    when(sessionInfo.getId()).thenReturn("sessionId");
    when(sessionInfo.getIdentity()).thenReturn(user);
    when(user.getIdentifier()).thenReturn("user");
    exProject1 = mock(ImportProject.class);
    importProjects = Collections.singletonList(exProject1);
    final OrganizationalUnit ou = mock(OrganizationalUnit.class);
    doReturn("ou").when(ou).getName();
    final GitRepository repository1 = mock(GitRepository.class);
    final Path repositoryRoot = mock(Path.class);
    final Path module1Root = mock(Path.class);
    when(organizationalUnit.getName()).thenReturn("ou");
    when(organizationalUnit.getSpace()).thenReturn(space);
    when(space.getName()).thenReturn("ou");
    when(exProject1.getName()).thenReturn("module1");
    when(exProject1.getRoot()).thenReturn(module1Root);
    when(repository1.getBranch("dev_branch")).thenReturn(Optional.of(new Branch("dev_branch", repositoryRoot)));
    final Optional<Branch> main = Optional.of(new Branch("main", PathFactory.newPath("testFile", "file:///")));
    when(repository1.getDefaultBranch()).thenReturn(main);
    when(repositoryRoot.toURI()).thenReturn("default:///");
    when(module1Root.toURI()).thenReturn("default:///module1");
    when(ouService.getOrganizationalUnit(eq("ou"))).thenReturn(ou);
    doReturn("module1").when(repository1).getAlias();
    final WorkspaceProject project = spy(new WorkspaceProject());
    doReturn(repository1.getAlias()).when(project).getName();
    doReturn(mock(Module.class)).when(project).getMainModule();
    doReturn(mock(OrganizationalUnit.class)).when(project).getOrganizationalUnit();
    doReturn(project).when(projectService).resolveProject(repository1);
    doReturn(project).when(projectService).resolveProject(any(Path.class));
    final ProjectScreenModel model = new ProjectScreenModel();
    model.setPOM(new POM());
    doReturn(model).when(projectScreenService).load(any());
}
Also used : Path(org.uberfire.backend.vfs.Path) RepositoryFactory(org.guvnor.structure.server.repositories.RepositoryFactory) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) OrganizationalUnitService(org.guvnor.structure.organizationalunit.OrganizationalUnitService) POM(org.guvnor.common.services.project.model.POM) PathFactory(org.uberfire.backend.vfs.PathFactory) KieModuleService(org.kie.workbench.common.services.shared.project.KieModuleService) SessionInfo(org.uberfire.rpc.SessionInfo) Module(org.guvnor.common.services.project.model.Module) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) Assert.fail(org.junit.Assert.fail) SpaceConfigStorage(org.guvnor.structure.organizationalunit.config.SpaceConfigStorage) ProjectScreenService(org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService) Mockito.doReturn(org.mockito.Mockito.doReturn) NewProjectEvent(org.guvnor.common.services.project.events.NewProjectEvent) MetadataService(org.guvnor.common.services.shared.metadata.MetadataService) SpaceConfigStorageRegistry(org.guvnor.structure.organizationalunit.config.SpaceConfigStorageRegistry) ProjectScreenModel(org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel) KieModule(org.kie.workbench.common.services.shared.project.KieModule) List(java.util.List) ImportProjectValidators(org.kie.workbench.common.screens.examples.validation.ImportProjectValidators) PathUtil(org.guvnor.common.services.project.backend.server.utils.PathUtil) Optional(java.util.Optional) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) SpaceConfigStorageRegistryImpl(org.guvnor.structure.backend.organizationalunit.config.SpaceConfigStorageRegistryImpl) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Mockito.doCallRealMethod(org.mockito.Mockito.doCallRealMethod) Space(org.uberfire.spaces.Space) Mock(org.mockito.Mock) OrganizationalUnitImpl(org.guvnor.structure.organizationalunit.impl.OrganizationalUnitImpl) RunWith(org.junit.runner.RunWith) Mockito.spy(org.mockito.Mockito.spy) Captor(org.mockito.Captor) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Answer(org.mockito.stubbing.Answer) ArgumentCaptor(org.mockito.ArgumentCaptor) ProjectAlreadyExistException(org.kie.workbench.common.screens.examples.exception.ProjectAlreadyExistException) Path(org.uberfire.backend.vfs.Path) Before(org.junit.Before) Event(javax.enterprise.event.Event) OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) Answers(org.mockito.Answers) Assert.assertNotNull(org.junit.Assert.assertNotNull) RepositoryService(org.guvnor.structure.repositories.RepositoryService) Test(org.junit.Test) GitRepository(org.guvnor.structure.repositories.impl.git.GitRepository) Mockito.when(org.mockito.Mockito.when) WorkspaceProjectService(org.guvnor.common.services.project.service.WorkspaceProjectService) Mockito.verify(org.mockito.Mockito.verify) Mockito.never(org.mockito.Mockito.never) User(org.jboss.errai.security.shared.api.identity.User) ImportProject(org.kie.workbench.common.screens.examples.model.ImportProject) IOService(org.uberfire.io.IOService) Collections(java.util.Collections) Branch(org.guvnor.structure.repositories.Branch) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) SpaceConfigStorageRegistryImpl(org.guvnor.structure.backend.organizationalunit.config.SpaceConfigStorageRegistryImpl) OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) ImportProject(org.kie.workbench.common.screens.examples.model.ImportProject) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) OrganizationalUnitImpl(org.guvnor.structure.organizationalunit.impl.OrganizationalUnitImpl) POM(org.guvnor.common.services.project.model.POM) GitRepository(org.guvnor.structure.repositories.impl.git.GitRepository) Branch(org.guvnor.structure.repositories.Branch) Module(org.guvnor.common.services.project.model.Module) KieModule(org.kie.workbench.common.services.shared.project.KieModule) ProjectScreenModel(org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel) KieModule(org.kie.workbench.common.services.shared.project.KieModule) Before(org.junit.Before)

Example 2 with ProjectScreenService

use of org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService in project kie-wb-common by kiegroup.

the class ExamplesServiceImplTest method setup.

@Before
public void setup() throws Exception {
    when(spaceConfigStorageRegistry.get(Mockito.<String>any())).thenReturn(spaceConfigStorage);
    when(spaceConfigStorageRegistry.getBatch(Mockito.<String>any())).thenReturn(new SpaceConfigStorageRegistryImpl.SpaceStorageBatchImpl(spaceConfigStorage));
    when(spaceConfigStorageRegistry.exist(Mockito.<String>any())).thenReturn(true);
    when(ou.getSpace()).thenReturn(space);
    when(space.getName()).thenReturn("ou");
    service = spy(new ExamplesServiceImpl(ioService, repositoryFactory, moduleService, ouService, projectService, metadataService, newProjectEvent, projectScreenService, validators, spaceConfigStorageRegistry, systemFS, pathUtil, repositoryService));
    FileUtils.deleteDirectory(new File(".kie-wb-playground"));
    when(this.validators.getValidators()).thenReturn(new ArrayList<>());
    doAnswer(invocationOnMock -> {
        String spaceName = (String) invocationOnMock.getArguments()[0];
        String defaultGroupId = (String) invocationOnMock.getArguments()[1];
        OrganizationalUnitImpl o = new OrganizationalUnitImpl(spaceName, defaultGroupId);
        organizationalUnits.put(spaceName, o);
        return o;
    }).when(ouService).createOrganizationalUnit(Mockito.<String>any(), Mockito.<String>any());
    doAnswer(invocationOnMock -> organizationalUnits.get(invocationOnMock.getArguments()[0])).when(ouService).getOrganizationalUnit(Mockito.<String>any());
    when(ouService.getOrganizationalUnits()).thenReturn(new HashSet<OrganizationalUnit>() {

        {
            add(new OrganizationalUnitImpl("ou1Name", "ou1GroupId"));
            add(new OrganizationalUnitImpl("ou2Name", "ou2GroupId"));
        }
    });
    when(moduleService.resolveModule(Mockito.<Path>any())).thenAnswer((Answer<KieModule>) invocationOnMock -> {
        final Path path = (Path) invocationOnMock.getArguments()[0];
        final KieModule module = new KieModule(path, path, path, path, path, path, mock(POM.class));
        return module;
    });
    when(sessionInfo.getId()).thenReturn("sessionId");
    when(sessionInfo.getIdentity()).thenReturn(user);
    when(user.getIdentifier()).thenReturn("user");
    doAnswer(invocationOnMock -> organizationalUnits.containsKey(invocationOnMock.getArguments()[0])).when(service).existSpace(any());
}
Also used : Arrays(java.util.Arrays) RepositoryInfo(org.guvnor.structure.organizationalunit.config.RepositoryInfo) RepositoryFactory(org.guvnor.structure.server.repositories.RepositoryFactory) URL(java.net.URL) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) OrganizationalUnitService(org.guvnor.structure.organizationalunit.OrganizationalUnitService) ExampleRepository(org.kie.workbench.common.screens.examples.model.ExampleRepository) POM(org.guvnor.common.services.project.model.POM) PathFactory(org.uberfire.backend.vfs.PathFactory) KieModuleService(org.kie.workbench.common.services.shared.project.KieModuleService) Map(java.util.Map) After(org.junit.After) Spy(org.mockito.Spy) Mockito.doAnswer(org.mockito.Mockito.doAnswer) WorkspaceProjectContextChangeEvent(org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent) SessionInfo(org.uberfire.rpc.SessionInfo) Module(org.guvnor.common.services.project.model.Module) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) SpaceConfigStorage(org.guvnor.structure.organizationalunit.config.SpaceConfigStorage) ProjectScreenService(org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService) Mockito.doReturn(org.mockito.Mockito.doReturn) NewProjectEvent(org.guvnor.common.services.project.events.NewProjectEvent) MetadataService(org.guvnor.common.services.shared.metadata.MetadataService) SpaceConfigStorageRegistry(org.guvnor.structure.organizationalunit.config.SpaceConfigStorageRegistry) Set(java.util.Set) KieModule(org.kie.workbench.common.services.shared.project.KieModule) List(java.util.List) ImportProjectValidators(org.kie.workbench.common.screens.examples.validation.ImportProjectValidators) Assert.assertFalse(org.junit.Assert.assertFalse) PathUtil(org.guvnor.common.services.project.backend.server.utils.PathUtil) Optional(java.util.Optional) EventSourceMock(org.uberfire.mocks.EventSourceMock) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) SpaceConfigStorageRegistryImpl(org.guvnor.structure.backend.organizationalunit.config.SpaceConfigStorageRegistryImpl) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Space(org.uberfire.spaces.Space) Mock(org.mockito.Mock) OrganizationalUnitImpl(org.guvnor.structure.organizationalunit.impl.OrganizationalUnitImpl) RunWith(org.junit.runner.RunWith) HashMap(java.util.HashMap) Mockito.spy(org.mockito.Mockito.spy) Captor(org.mockito.Captor) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Answer(org.mockito.stubbing.Answer) ExamplesMetaData(org.kie.workbench.common.screens.examples.model.ExamplesMetaData) ArgumentCaptor(org.mockito.ArgumentCaptor) Path(org.uberfire.backend.vfs.Path) Before(org.junit.Before) Event(javax.enterprise.event.Event) OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) Assert.assertNotNull(org.junit.Assert.assertNotNull) RepositoryService(org.guvnor.structure.repositories.RepositoryService) Assert.assertTrue(org.junit.Assert.assertTrue) FileUtils(org.apache.commons.io.FileUtils) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) GitRepository(org.guvnor.structure.repositories.impl.git.GitRepository) Mockito.when(org.mockito.Mockito.when) WorkspaceProjectService(org.guvnor.common.services.project.service.WorkspaceProjectService) File(java.io.File) ExampleOrganizationalUnit(org.kie.workbench.common.screens.examples.model.ExampleOrganizationalUnit) Mockito.verify(org.mockito.Mockito.verify) ImportUtils.makeGitRepository(org.kie.workbench.common.screens.examples.backend.server.ImportUtils.makeGitRepository) Mockito(org.mockito.Mockito) Mockito.never(org.mockito.Mockito.never) Assert.assertNull(org.junit.Assert.assertNull) Paths(java.nio.file.Paths) User(org.jboss.errai.security.shared.api.identity.User) ImportProject(org.kie.workbench.common.screens.examples.model.ImportProject) IOService(org.uberfire.io.IOService) Collections(java.util.Collections) FileSystem(org.uberfire.java.nio.file.FileSystem) Assert.assertEquals(org.junit.Assert.assertEquals) Branch(org.guvnor.structure.repositories.Branch) Path(org.uberfire.backend.vfs.Path) SpaceConfigStorageRegistryImpl(org.guvnor.structure.backend.organizationalunit.config.SpaceConfigStorageRegistryImpl) OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) ExampleOrganizationalUnit(org.kie.workbench.common.screens.examples.model.ExampleOrganizationalUnit) File(java.io.File) OrganizationalUnitImpl(org.guvnor.structure.organizationalunit.impl.OrganizationalUnitImpl) KieModule(org.kie.workbench.common.services.shared.project.KieModule) Before(org.junit.Before)

Example 3 with ProjectScreenService

use of org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService in project kie-wb-common by kiegroup.

the class POMWizardPageTest method setUp.

@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
    gavEditor = new GAVEditor(gavEditorView);
    pomEditor = spy(new POMEditorPanel(pomEditorView, syncBeanManager, gavPreferences, projectScopedResolutionStrategySupplier));
    // POMEditorView implementation updates a nested GAVEditor presenter. Mock the implementation to avoid use of real widgets
    doAnswer(new Answer<Void>() {

        @Override
        public Void answer(final InvocationOnMock invocation) throws Throwable {
            final String artifactId = (String) invocation.getArguments()[0];
            gavEditor.setArtifactID(artifactId);
            return null;
        }
    }).when(pomEditorView).setArtifactID(any());
    // POMEditorView implementation updates a nested GAVEditor presenter. Mock the implementation to avoid use of real widgets
    doAnswer(new Answer<Void>() {

        @Override
        public Void answer(final InvocationOnMock invocation) throws Throwable {
            final GAV gav = (GAV) invocation.getArguments()[0];
            gavEditor.setGAV(gav);
            return null;
        }
    }).when(pomEditorView).setGAV(any());
    // POMEditorView implementation updates a nested GAVEditor presenter. Mock the implementation to avoid use of real widgets
    doAnswer(new Answer<Void>() {

        @Override
        public Void answer(final InvocationOnMock invocation) throws Throwable {
            final ArtifactIdChangeHandler handler = (ArtifactIdChangeHandler) invocation.getArguments()[0];
            gavEditor.addArtifactIdChangeHandler(handler);
            return null;
        }
    }).when(pomEditorView).addArtifactIdChangeHandler(any());
    page = spy(new POMWizardPage(pomEditor, view, event, new CallerMock<ProjectScreenService>(projectScreenService), new CallerMock<ValidationService>(validationService)));
    page.initialise();
    doAnswer(invocationOnMock -> {
        ((ParameterizedCommand<GAVPreferences>) invocationOnMock.getArguments()[1]).execute(gavPreferences);
        return null;
    }).when(gavPreferences).load(any(), any(), any());
}
Also used : POMEditorPanel(org.guvnor.common.services.project.client.POMEditorPanel) ArtifactIdChangeHandler(org.guvnor.common.services.project.client.ArtifactIdChangeHandler) InvocationOnMock(org.mockito.invocation.InvocationOnMock) GAVEditor(org.guvnor.common.services.project.client.GAVEditor) ValidationService(org.kie.workbench.common.services.shared.validation.ValidationService) ProjectScreenService(org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService) GAV(org.guvnor.common.services.project.model.GAV) ParameterizedCommand(org.uberfire.mvp.ParameterizedCommand) Before(org.junit.Before)

Example 4 with ProjectScreenService

use of org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService in project kie-wb-common by kiegroup.

the class ProjectScreen method getDuplicateCommand.

CommandWithFileNameAndCommitMessage getDuplicateCommand() {
    return details -> {
        copyPopUpPresenter.getView().hide();
        view.showBusyIndicator(view.getLoadingMessage());
        promises.promisify(projectScreenService, s -> {
            s.copy(workspaceProject, details.getNewFileName());
        }).then(i -> {
            view.hideBusyIndicator();
            notificationEvent.fire(new NotificationEvent(view.getItemSuccessfullyDuplicatedMessage(), NotificationEvent.NotificationType.SUCCESS));
            return promises.resolve();
        }).catch_(this::onError);
    };
}
Also used : DeleteProjectPopUpScreen(org.kie.workbench.common.screens.library.client.screens.project.delete.DeleteProjectPopUpScreen) Arrays(java.util.Arrays) UpdatedAssetsEvent(org.kie.workbench.common.screens.library.client.screens.assets.events.UpdatedAssetsEvent) Promises(org.uberfire.client.promise.Promises) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) SettingsPresenter(org.kie.workbench.common.screens.library.client.settings.SettingsPresenter) NewFileUploader(org.kie.workbench.common.screens.defaulteditor.client.editor.NewFileUploader) ChangeRequestStatusUpdatedEvent(org.guvnor.structure.repositories.changerequest.portable.ChangeRequestStatusUpdatedEvent) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Promise(elemental2.promise.Promise) ContributorsListPresenter(org.kie.workbench.common.screens.library.client.screens.organizationalunit.contributors.tab.ContributorsListPresenter) LibraryPlaces(org.kie.workbench.common.screens.library.client.util.LibraryPlaces) Inject(javax.inject.Inject) RenameProjectPopUpScreen(org.kie.workbench.common.screens.library.client.screens.project.rename.RenameProjectPopUpScreen) ChangeRequestStatus(org.guvnor.structure.repositories.changerequest.portable.ChangeRequestStatus) ProjectMainActions(org.kie.workbench.common.screens.library.client.screens.project.actions.ProjectMainActions) Elemental2DomUtil(org.jboss.errai.common.client.dom.elemental2.Elemental2DomUtil) WorkbenchPartTitle(org.uberfire.client.annotations.WorkbenchPartTitle) HTMLElement(elemental2.dom.HTMLElement) ChangeRequestListPresenter(org.kie.workbench.common.screens.library.client.screens.project.changerequest.list.ChangeRequestListPresenter) Observes(javax.enterprise.event.Observes) WorkspaceProjectContextChangeEvent(org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent) ProjectContributorsListServiceImpl(org.kie.workbench.common.screens.library.client.screens.organizationalunit.contributors.tab.ProjectContributorsListServiceImpl) NewResourcePresenter(org.kie.workbench.common.widgets.client.handlers.NewResourcePresenter) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) WorkbenchScreen(org.uberfire.client.annotations.WorkbenchScreen) ProjectScreenService(org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService) Path(org.uberfire.backend.vfs.Path) ProjectNameValidator(org.kie.workbench.common.screens.projecteditor.client.validation.ProjectNameValidator) SERVER_MANAGEMENT(org.kie.workbench.common.services.shared.resources.PerspectiveIds.SERVER_MANAGEMENT) Event(javax.enterprise.event.Event) ChangeRequestListUpdatedEvent(org.guvnor.structure.repositories.changerequest.portable.ChangeRequestListUpdatedEvent) CopyPopUpPresenter(org.uberfire.ext.editor.commons.client.file.popups.CopyPopUpPresenter) OnMayClose(org.uberfire.lifecycle.OnMayClose) LibraryService(org.kie.workbench.common.screens.library.api.LibraryService) RepositoryContributorsUpdatedEvent(org.guvnor.common.services.project.events.RepositoryContributorsUpdatedEvent) CommandWithFileNameAndCommitMessage(org.uberfire.ext.editor.commons.client.file.CommandWithFileNameAndCommitMessage) NewResourceSuccessEvent(org.kie.workbench.common.widgets.client.handlers.NewResourceSuccessEvent) Callback(com.google.gwt.core.client.Callback) List(java.util.List) Caller(org.jboss.errai.common.client.api.Caller) AssetsScreen(org.kie.workbench.common.screens.library.client.screens.assets.AssetsScreen) DeleteBranchPopUpScreen(org.kie.workbench.common.screens.library.client.screens.project.branch.delete.DeleteBranchPopUpScreen) PostConstruct(javax.annotation.PostConstruct) ProjectController(org.guvnor.common.services.project.client.security.ProjectController) WorkbenchPartView(org.uberfire.client.annotations.WorkbenchPartView) LibraryPerspective(org.kie.workbench.common.screens.library.client.perspective.LibraryPerspective) UberElemental(org.uberfire.client.mvp.UberElemental) NotificationEvent(org.uberfire.workbench.events.NotificationEvent)

Example 5 with ProjectScreenService

use of org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService in project kie-wb-common by kiegroup.

the class ProjectScreen method reimport.

public void reimport() {
    projectController.canUpdateProject(workspaceProject).then(userCanUpdateProject -> {
        if (userCanUpdateProject) {
            final Path pomXMLPath = workspaceProject.getMainModule().getPomXMLPath();
            view.showBusyIndicator(view.getLoadingMessage());
            promises.promisify(projectScreenService, s -> {
                s.reImport(pomXMLPath);
            }).then(i -> {
                view.hideBusyIndicator();
                notificationEvent.fire(new NotificationEvent(view.getReimportSuccessfulMessage(), NotificationEvent.NotificationType.SUCCESS));
                return promises.resolve();
            }).catch_(this::onError);
        }
        return promises.resolve();
    });
}
Also used : Path(org.uberfire.backend.vfs.Path) DeleteProjectPopUpScreen(org.kie.workbench.common.screens.library.client.screens.project.delete.DeleteProjectPopUpScreen) Arrays(java.util.Arrays) UpdatedAssetsEvent(org.kie.workbench.common.screens.library.client.screens.assets.events.UpdatedAssetsEvent) Promises(org.uberfire.client.promise.Promises) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) SettingsPresenter(org.kie.workbench.common.screens.library.client.settings.SettingsPresenter) NewFileUploader(org.kie.workbench.common.screens.defaulteditor.client.editor.NewFileUploader) ChangeRequestStatusUpdatedEvent(org.guvnor.structure.repositories.changerequest.portable.ChangeRequestStatusUpdatedEvent) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Promise(elemental2.promise.Promise) ContributorsListPresenter(org.kie.workbench.common.screens.library.client.screens.organizationalunit.contributors.tab.ContributorsListPresenter) LibraryPlaces(org.kie.workbench.common.screens.library.client.util.LibraryPlaces) Inject(javax.inject.Inject) RenameProjectPopUpScreen(org.kie.workbench.common.screens.library.client.screens.project.rename.RenameProjectPopUpScreen) ChangeRequestStatus(org.guvnor.structure.repositories.changerequest.portable.ChangeRequestStatus) ProjectMainActions(org.kie.workbench.common.screens.library.client.screens.project.actions.ProjectMainActions) Elemental2DomUtil(org.jboss.errai.common.client.dom.elemental2.Elemental2DomUtil) WorkbenchPartTitle(org.uberfire.client.annotations.WorkbenchPartTitle) HTMLElement(elemental2.dom.HTMLElement) ChangeRequestListPresenter(org.kie.workbench.common.screens.library.client.screens.project.changerequest.list.ChangeRequestListPresenter) Observes(javax.enterprise.event.Observes) WorkspaceProjectContextChangeEvent(org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent) ProjectContributorsListServiceImpl(org.kie.workbench.common.screens.library.client.screens.organizationalunit.contributors.tab.ProjectContributorsListServiceImpl) NewResourcePresenter(org.kie.workbench.common.widgets.client.handlers.NewResourcePresenter) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) WorkbenchScreen(org.uberfire.client.annotations.WorkbenchScreen) ProjectScreenService(org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService) Path(org.uberfire.backend.vfs.Path) ProjectNameValidator(org.kie.workbench.common.screens.projecteditor.client.validation.ProjectNameValidator) SERVER_MANAGEMENT(org.kie.workbench.common.services.shared.resources.PerspectiveIds.SERVER_MANAGEMENT) Event(javax.enterprise.event.Event) ChangeRequestListUpdatedEvent(org.guvnor.structure.repositories.changerequest.portable.ChangeRequestListUpdatedEvent) CopyPopUpPresenter(org.uberfire.ext.editor.commons.client.file.popups.CopyPopUpPresenter) OnMayClose(org.uberfire.lifecycle.OnMayClose) LibraryService(org.kie.workbench.common.screens.library.api.LibraryService) RepositoryContributorsUpdatedEvent(org.guvnor.common.services.project.events.RepositoryContributorsUpdatedEvent) CommandWithFileNameAndCommitMessage(org.uberfire.ext.editor.commons.client.file.CommandWithFileNameAndCommitMessage) NewResourceSuccessEvent(org.kie.workbench.common.widgets.client.handlers.NewResourceSuccessEvent) Callback(com.google.gwt.core.client.Callback) List(java.util.List) Caller(org.jboss.errai.common.client.api.Caller) AssetsScreen(org.kie.workbench.common.screens.library.client.screens.assets.AssetsScreen) DeleteBranchPopUpScreen(org.kie.workbench.common.screens.library.client.screens.project.branch.delete.DeleteBranchPopUpScreen) PostConstruct(javax.annotation.PostConstruct) ProjectController(org.guvnor.common.services.project.client.security.ProjectController) WorkbenchPartView(org.uberfire.client.annotations.WorkbenchPartView) LibraryPerspective(org.kie.workbench.common.screens.library.client.perspective.LibraryPerspective) UberElemental(org.uberfire.client.mvp.UberElemental) NotificationEvent(org.uberfire.workbench.events.NotificationEvent)

Aggregations

ProjectScreenService (org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService)5 List (java.util.List)4 Event (javax.enterprise.event.Event)4 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)4 Arrays (java.util.Arrays)3 WorkspaceProjectContextChangeEvent (org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent)3 Before (org.junit.Before)3 Path (org.uberfire.backend.vfs.Path)3 Callback (com.google.gwt.core.client.Callback)2 HTMLElement (elemental2.dom.HTMLElement)2 Promise (elemental2.promise.Promise)2 PostConstruct (javax.annotation.PostConstruct)2 Observes (javax.enterprise.event.Observes)2 Inject (javax.inject.Inject)2 ProjectController (org.guvnor.common.services.project.client.security.ProjectController)2 RepositoryContributorsUpdatedEvent (org.guvnor.common.services.project.events.RepositoryContributorsUpdatedEvent)2 ChangeRequestListUpdatedEvent (org.guvnor.structure.repositories.changerequest.portable.ChangeRequestListUpdatedEvent)2 ChangeRequestStatus (org.guvnor.structure.repositories.changerequest.portable.ChangeRequestStatus)2 ChangeRequestStatusUpdatedEvent (org.guvnor.structure.repositories.changerequest.portable.ChangeRequestStatusUpdatedEvent)2 Caller (org.jboss.errai.common.client.api.Caller)2