From 0840c5222af819a51b16f2e68bbdc0d02cef633f Mon Sep 17 00:00:00 2001 From: kaarleol Date: Sat, 21 Sep 2024 16:22:43 +0300 Subject: [PATCH 1/4] Changes to locality composite date to block filling two time units --- frontend/src/components/Locality/Tabs/AgeTab.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Locality/Tabs/AgeTab.tsx b/frontend/src/components/Locality/Tabs/AgeTab.tsx index 2fffc46f..0bc2c79c 100644 --- a/frontend/src/components/Locality/Tabs/AgeTab.tsx +++ b/frontend/src/components/Locality/Tabs/AgeTab.tsx @@ -62,7 +62,7 @@ export const AgeTab = () => { sourceField="tu_name" targetField="bfa_min" selectorTable={} - disabled={editData.date_meth === 'absolute'} + disabled={editData.date_meth === 'absolute' || (!!editData.bfa_max && editData.date_meth === 'composite')} />, dropdown('frac_min', fracOptions, 'Minimum fraction', editData.date_meth === 'absolute'), ], @@ -75,7 +75,7 @@ export const AgeTab = () => { sourceField="tu_name" targetField="bfa_max" selectorTable={} - disabled={editData.date_meth === 'absolute'} + disabled={editData.date_meth === 'absolute' || (!!editData.bfa_min && editData.date_meth === 'composite')} />, dropdown('frac_max', fracOptions, 'Maximum fraction', editData.date_meth === 'absolute'), ], From 48c14687ff422fd4f4ccf50daa4e03f3bacecce4 Mon Sep 17 00:00:00 2001 From: kaarleol Date: Sat, 21 Sep 2024 17:17:14 +0300 Subject: [PATCH 2/4] Button colour + placement Co-authored-by: realtalin 57003465+realtalin@users.noreply.github.com --- .../components/DetailView/DetailBrowser.tsx | 6 ++--- .../src/components/DetailView/DetailView.tsx | 27 ++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/DetailView/DetailBrowser.tsx b/frontend/src/components/DetailView/DetailBrowser.tsx index 5e44973b..f8515195 100644 --- a/frontend/src/components/DetailView/DetailBrowser.tsx +++ b/frontend/src/components/DetailView/DetailBrowser.tsx @@ -16,7 +16,7 @@ export const DetailBrowser = () => { const previousIndex = currentIndex - 1 const style = { width: '18em', - marginLeft: '1em', + marginLeft: '0em', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', @@ -45,8 +45,8 @@ export const DetailBrowser = () => { return ( ({ return ( - + {!isUserPage && ( + + /> + + )} + {!isUserPage && } - {editRights.delete && !isNew && ( - - )} - {editRights.edit && !mode.staging && !initialState.mode.new && ( + + + {editRights.edit && !mode.staging && !initialState.mode.new && ( )} + {editRights.delete && !isNew && ( + + )} {(!mode.read || initialState.mode.new) && onWrite && ( )} - {!isUserPage && ( - - /> - - )} + {mode.staging ? stagingView : tabView} From 5c99e0bbee6fe34741d46fab4638ad1c45874a65 Mon Sep 17 00:00:00 2001 From: kaarleol Date: Sat, 21 Sep 2024 18:28:11 +0300 Subject: [PATCH 3/4] linting --- .../src/components/DetailView/DetailView.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/DetailView/DetailView.tsx b/frontend/src/components/DetailView/DetailView.tsx index dc821b0d..82c2c102 100644 --- a/frontend/src/components/DetailView/DetailView.tsx +++ b/frontend/src/components/DetailView/DetailView.tsx @@ -145,16 +145,18 @@ export const DetailView = ({ {!isUserPage && ( - - /> - - )} - + + /> + + )} + {!isUserPage && } - {editRights.edit && !mode.staging && !initialState.mode.new && ( + {editRights.edit && !mode.staging && !initialState.mode.new && ( )} {editRights.delete && !isNew && ( - )} @@ -173,7 +175,6 @@ export const DetailView = ({ )} - {mode.staging ? stagingView : tabView} From 7fa0f3bccf32abd9683bb1f8f9357c3b63357d9f Mon Sep 17 00:00:00 2001 From: kaarleol <127772376+kaarleol@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:36:10 +0300 Subject: [PATCH 4/4] Update AgeTab.tsx --- frontend/src/components/Locality/Tabs/AgeTab.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Locality/Tabs/AgeTab.tsx b/frontend/src/components/Locality/Tabs/AgeTab.tsx index 0bc2c79c..2fffc46f 100644 --- a/frontend/src/components/Locality/Tabs/AgeTab.tsx +++ b/frontend/src/components/Locality/Tabs/AgeTab.tsx @@ -62,7 +62,7 @@ export const AgeTab = () => { sourceField="tu_name" targetField="bfa_min" selectorTable={} - disabled={editData.date_meth === 'absolute' || (!!editData.bfa_max && editData.date_meth === 'composite')} + disabled={editData.date_meth === 'absolute'} />, dropdown('frac_min', fracOptions, 'Minimum fraction', editData.date_meth === 'absolute'), ], @@ -75,7 +75,7 @@ export const AgeTab = () => { sourceField="tu_name" targetField="bfa_max" selectorTable={} - disabled={editData.date_meth === 'absolute' || (!!editData.bfa_min && editData.date_meth === 'composite')} + disabled={editData.date_meth === 'absolute'} />, dropdown('frac_max', fracOptions, 'Maximum fraction', editData.date_meth === 'absolute'), ],