Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/AppLoader/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export async function initializeAsync({
const meResponse = await querySingleResource({
resource: 'me',
params: {
fields: 'id,firstName,surname,username,userRoles[id],userGroups[id],' +
fields: 'id,firstName,surname,userRoles[id],userGroups[id],' +
'organisationUnits[id,path],teiSearchOrganisationUnits[id,path],settings',
},
});
Expand All @@ -158,7 +158,6 @@ export async function initializeAsync({
id: currentUserId,
firstName = '',
surname = '',
username = '',
userRoles = [],
userGroups = [],
organisationUnits: captureScope = [],
Expand All @@ -169,7 +168,6 @@ export async function initializeAsync({
CurrentUser.set({
firstName,
surname,
username,
uiLocale: userSettings?.keyUiLocale ?? '',
userRoles: userRoles.map((role: { id: string }) => role.id),
organisationUnits: captureScope,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const addNoteForNewSingleEventEpic = (
ofType(newEventDataEntryActionTypes.ADD_NEW_EVENT_NOTE),
map((action) => {
const payload = action.payload;
const { firstName, surname, username } = CurrentUser.get();
const { firstName, surname } = CurrentUser.get();
const clientId = uuid();
const note = {
value: payload.note,
Expand All @@ -36,7 +36,6 @@ export const addNoteForNewSingleEventEpic = (
surname,
uid: clientId,
},
storedBy: username,
storedAt: fromClientDate(moment().toISOString()).getServerZonedISOString(),
clientId: uuid(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ const NotesPlain = ({
label={<>
<div className={classes.noteItemHeader}>
<div className={classes.noteItemUser} data-test="note-user">
{n.createdBy ?
`${n.createdBy.firstName} ${n.createdBy.surname}`
: `${n.storedBy}` }
{n.createdBy && `${n.createdBy.firstName} ${n.createdBy.surname}`}
Comment thread
henrikmv marked this conversation as resolved.
</div>
<div className={classes.noteItemDate} data-test="note-date">
<span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export type Note = {
clientId: string;
storedBy: string;
createdBy?: {
firstName: string;
surname: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const addNoteForViewEventEpic = (action$: any, store: any, { fromClientDa
const payload = action.payload;
const eventId = state.viewEventPage.eventId;
const useNewEndpoint = featureAvailable(FEATURES.newNoteEndpoint);
const { firstName, surname, username } = CurrentUser.get();
const { firstName, surname } = CurrentUser.get();
const clientId = uuid();
const serverData = createServerData(eventId, payload.note, useNewEndpoint);

Expand All @@ -65,7 +65,6 @@ export const addNoteForViewEventEpic = (action$: any, store: any, { fromClientDa
surname,
uid: clientId,
},
storedBy: username,
storedAt: fromClientDate(moment().toISOString()).getServerZonedISOString(),
clientId: uuid(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export type EnrollmentData = {
orgUnit?: string;
program?: string;
status?: string;
storedBy?: string;
scheduledAt?: string;
trackedEntity?: string;
trackedEntityType?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const addNoteForNewEnrollmentEventEpic = (
ofType(newEventWidgetDataEntryActionTypes.EVENT_NOTE_ADD),
map((action: any) => {
const payload = action.payload;
const { firstName, surname, username } = CurrentUser.get();
const { firstName, surname } = CurrentUser.get();
const clientId = uuid();
const note = {
value: payload.note,
Expand All @@ -30,7 +30,6 @@ export const addNoteForNewEnrollmentEventEpic = (
surname,
uid: clientId,
},
storedBy: username,
storedAt: fromClientDate(moment().toISOString()).getServerZonedISOString(),
clientId: uuid(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const addNoteForEnrollmentEpic = (
const state = store.value;
const { enrollmentId, note } = action.payload;
const useNewEndpoint = featureAvailable(FEATURES.newNoteEndpoint);
const { firstName, surname, username } = CurrentUser.get();
const { firstName, surname } = CurrentUser.get();
const clientId = uuid();

const serverData = createServerData(note, useNewEndpoint);
Expand All @@ -45,7 +45,6 @@ export const addNoteForEnrollmentEpic = (
surname,
uid: clientId,
},
storedBy: username,
storedAt: fromClientDate(moment().toISOString()).getServerZonedISOString(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export type ClientNote = {
surname: string;
uid: string;
};
storedBy: string;
storedAt: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const addNoteForEventEpic = (
const payload = action.payload;
const eventId = state.dataEntries[payload.dataEntryId].eventId;
const useNewEndpoint = featureAvailable(FEATURES.newNoteEndpoint);
const { firstName, surname, username } = CurrentUser.get();
const { firstName, surname } = CurrentUser.get();
const clientId = uuid();

const serverData = createServerData(eventId, payload.note, useNewEndpoint);
Expand All @@ -60,7 +60,6 @@ export const addNoteForEventEpic = (
surname,
uid: clientId,
},
storedBy: username,
storedAt: fromClientDate(moment().toISOString()).getServerZonedISOString(),
};
const formNote: FormNote = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export type ClientNote = {
surname: string;
uid: string;
};
storedBy: string;
storedAt: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const requestScheduleEvent = ({
notes: Array<{
value: string;
storedAt?: string;
storedBy?: string;
createdBy?: any;
note?: string;
}>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export const WidgetEventSchedule = ({
const [notes, setNotes] = useState<Array<{
value: string;
storedAt: string;
storedBy?: string;
createdBy?: any;
note?: string;
}>>([]);
Expand Down Expand Up @@ -148,9 +147,8 @@ export const WidgetEventSchedule = ({
]);

const onAddNote = (note: string) => {
const { username, firstName, surname } = CurrentUser.get();
const { firstName, surname } = CurrentUser.get();
const newNote = {
storedBy: username,
storedAt: fromClientDate(moment().toISOString()).getServerZonedISOString(),
value: note,
createdBy: { firstName, surname },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export type Props = {
notes: Array<{
value: string;
storedAt: string;
storedBy?: string;
createdBy?: any;
note?: string;
}>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export type OrgUnitRef = {
export type CurrentUserType = {
firstName: string;
surname: string;
username: string;
uiLocale: string;
userRoles: string[];
organisationUnits: OrgUnitRef[];
Expand Down
Loading