-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[26544] dialog on mail change of activated mediorder patient #695
Open
PatrickDenzler
wants to merge
2
commits into
elexis:master
Choose a base branch
from
PatrickDenzler:26544
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,20 @@ | |
import java.time.LocalDateTime; | ||
import java.time.ZoneId; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.eclipse.core.runtime.IAdaptable; | ||
import org.eclipse.jface.dialogs.MessageDialog; | ||
import org.eclipse.jface.viewers.ArrayContentProvider; | ||
import org.eclipse.jface.viewers.ComboViewer; | ||
import org.eclipse.jface.viewers.LabelProvider; | ||
import org.eclipse.jface.viewers.StructuredSelection; | ||
import org.eclipse.nebula.widgets.cdatetime.CDT; | ||
import org.eclipse.nebula.widgets.cdatetime.CDateTime; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.events.VerifyEvent; | ||
import org.eclipse.swt.events.VerifyListener; | ||
import org.eclipse.swt.layout.GridData; | ||
import org.eclipse.swt.layout.GridLayout; | ||
import org.eclipse.swt.widgets.Composite; | ||
|
@@ -30,7 +34,9 @@ | |
import ch.elexis.core.data.service.LocalLockServiceHolder; | ||
import ch.elexis.core.l10n.Messages; | ||
import ch.elexis.core.model.IPatient; | ||
import ch.elexis.core.model.ISticker; | ||
import ch.elexis.core.services.holder.CoreModelServiceHolder; | ||
import ch.elexis.core.services.holder.StickerServiceHolder; | ||
import ch.elexis.core.types.Gender; | ||
import ch.elexis.core.ui.locks.IUnlockable; | ||
import ch.elexis.core.ui.util.SWTHelper; | ||
|
@@ -161,6 +167,21 @@ public String getText(Object element) { | |
|
||
setUnlocked(LocalLockServiceHolder.get().isLocked(pat)); | ||
|
||
textEmail.addVerifyListener(new VerifyListener() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Das müsstest du als Lambda implementieren können, da VerifyListener ein FunctionalInterface ist. Das reduziert den ganzen Boilerplate Code hier ... |
||
|
||
@Override | ||
public void verifyText(VerifyEvent e) { | ||
var lSticker = StickerServiceHolder.get().getStickers(pat); | ||
if (lSticker.stream().anyMatch(sticker -> sticker.getId().equals("activate_mediorder"))) { | ||
if (!MessageDialog.openConfirm(getShell(), Messages.Core_E_Mail + " " + Messages.Core_Edit, | ||
Messages.Mediorder_changeEmail_text)) { | ||
e.doit = false; | ||
} | ||
textEmail.removeVerifyListener(this); | ||
} | ||
} | ||
}); | ||
|
||
return comp; | ||
} | ||
|
||
|
@@ -193,7 +214,7 @@ protected void performApply() { | |
if (bd != null) { | ||
pat.setDateOfBirth(LocalDateTime.ofInstant(bd.toInstant(), ZoneId.systemDefault())); | ||
} | ||
|
||
pat.setLastName(textNachname.getText()); | ||
pat.setFirstName(textVorname.getText()); | ||
pat.setEmail(textEmail.getText()); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wir haben jetzt schon an ein paar Stellen den literal String
activate_mediorder
- wir kopieren den immer, das gefällt mir nicht. Hast du einen Vorschlag wie und wo wir den als Konstante in einer Klasse ablegen können?Dann kannst du das dort dokumentieren, und es ist auch leicht referenzen darauf zu finden?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich würde eine Constants Klasse in
ch.elexis.core.ui.mediorder
vorschlagen.