From: Vásáry Dániel Date: Tue, 30 Jan 2024 16:08:09 +0000 (+0100) Subject: Prepare project start button added X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=cacbe0f787d5f7d95a88123eaa40876ac52e3da8;p=sly-crm.git Prepare project start button added --- diff --git a/KB.md b/KB.md index 26390f8..fc50373 100644 --- a/KB.md +++ b/KB.md @@ -109,4 +109,5 @@ https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ ##### Col reorder -https://stackoverflow.com/questions/14021298/zk-reordering-in-listbox/14021556#14021556 \ No newline at end of file +https://stackoverflow.com/questions/14021298/zk-reordering-in-listbox/14021556#14021556 + diff --git a/lis-app/src/test/java/hu/user/lis/FakertIT.java b/lis-app/src/test/java/hu/user/lis/FakertIT.java new file mode 100644 index 0000000..1f3a692 --- /dev/null +++ b/lis-app/src/test/java/hu/user/lis/FakertIT.java @@ -0,0 +1,41 @@ + +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.lis; + +import com.github.javafaker.Company; +import com.github.javafaker.Faker; +import lombok.extern.log4j.Log4j2; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.Locale; + +@Log4j2 +@SpringBootTest +@ActiveProfiles("dev") +@RunWith(SpringRunner.class) +@ComponentScan("hu.user.lis") +public class FakertIT { + @Test + public void test() { + Faker faker = new Faker(new Locale("hu-HU")); + for (int i = 0; i < 10; i++) { + log.info("Személynév: {}", faker.name().fullName()); + log.info("Cím: {}", faker.address().fullAddress()); + Company company = faker.company(); + log.info("Cégnév: {}, ágazat: {}, munkakör: {}", company.name(), company.industry(), company.profession()); + log.info("Chuck Norris tény :) : {}", faker.chuckNorris().fact()); + } + } + + +} + diff --git a/lis-ui/src/main/java/hu/user/lis/ui/editor/common/EntityAttachmentEditorModel.java b/lis-ui/src/main/java/hu/user/lis/ui/editor/common/EntityAttachmentEditorModel.java index 2f92f77..6147b5b 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/editor/common/EntityAttachmentEditorModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/editor/common/EntityAttachmentEditorModel.java @@ -50,7 +50,7 @@ public abstract class EntityAttachmentEditorModel extend public void onUploadFile(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { UploadEvent evt = (UploadEvent) ctx.getTriggerEvent(); if (!evt.getMedia().getName().toLowerCase().endsWith(".pdf")) { - Messagebox.show("Csak PDF állomány feltöltése támogatott.", "Error", Messagebox.OK, Messagebox.ERROR); + Messagebox.show("Csak PDF állomány feltöltése támogatott."); return; } EDocument document = EDocument.builder() diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java b/lis-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java index 9509cab..8e67ec8 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java @@ -8,6 +8,7 @@ import hu.user.lis.ui.data.common.CachedSpringDataModel; import hu.user.lis.ui.event.EventBus; import hu.user.lis.ui.event.SaveEntityEvent; import hu.user.lis.ui.view.common.FilterActiveViewModel; +import hu.user.lis.workflow.invoice.service.WorkflowManagerService; import lombok.Getter; import lombok.extern.log4j.Log4j2; import org.zkoss.bind.BindUtils; @@ -17,6 +18,7 @@ import org.zkoss.bind.annotation.Init; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zk.ui.util.Notification; import org.zkoss.zul.Messagebox; import java.util.Map; @@ -30,9 +32,11 @@ import static hu.user.lis.ui.data.common.CachedDataModel.NATURAL; public class ProjectsViewModel extends FilterActiveViewModel implements EventListener { @WireVariable @Getter - ProjectsDataModel projectsDataModel; + private ProjectsDataModel projectsDataModel; @WireVariable - EventBus eventBus; + private EventBus eventBus; + @WireVariable + private WorkflowManagerService workflowManagerService; @Override protected CachedSpringDataModel getDataModel() { @@ -113,4 +117,21 @@ public class ProjectsViewModel extends FilterActiveViewModel implements } }); } + + @Command + public void onStartProcess() { + Project selectedEntity = getSelectedEntity(); + if (Objects.nonNull(selectedEntity)) { + Messagebox.show("Biztosan elindítja a projekt mappa és fájl előkészítést?", "Megerősítés", + Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION, e -> { + if (e.getName().equals("onOK")) { + String processId = workflowManagerService.startPrepareProjectProcess(selectedEntity); + Notification.show("A folyamat elindult, azonosító: {}: " + processId, null, null, null, 3000, true); + } + }); + + } else { + Messagebox.show("Nincs kiválasztott projekt."); + } + } } diff --git a/lis-ui/src/main/resources/web/projects.zul b/lis-ui/src/main/resources/web/projects.zul index 2f9a51f..9c42ba9 100644 --- a/lis-ui/src/main/resources/web/projects.zul +++ b/lis-ui/src/main/resources/web/projects.zul @@ -10,6 +10,10 @@ + + -