aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/util/CurrentUserUtils.ts6
-rw-r--r--src/client/views/collections/CollectionCardDeckView.tsx23
-rw-r--r--src/client/views/pdf/GPTPopup/GPTPopup.tsx4
3 files changed, 25 insertions, 8 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 251771e8e..009a07314 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -738,9 +738,9 @@ pie title Minerals in my tap water
{ title: "Create", icon:"heart", toolTip:"Create your first custom grouping!", btnType: ButtonType.ToggleButton, expertMode: false, toolType:"custom1", funcs: {}, scripts: { onClick: '{ return showFreeform(this.toolType, _readOnly_);}'}},
{ title: "Create", icon:"star", toolTip:"Create your second custom grouping!", btnType: ButtonType.ToggleButton, expertMode: false, toolType:"custom2", funcs: {}, scripts: { onClick: '{ return showFreeform(this.toolType, _readOnly_);}'}},
{ title: "Create", icon:"satellite", toolTip:"Create your third custom grouping!", btnType: ButtonType.ToggleButton, expertMode: false, toolType:"custom3", funcs: {}, scripts: { onClick: '{ return showFreeform(this.toolType, _readOnly_);}'}},
- { title: "Custom 1", icon: "Custom 1", width: 10, toolTip: "Set visibilty!", subMenu: CurrentUserUtils.cardGroupTools("heart"), expertMode: false, toolType:CollectionViewType.Card, funcs: {hidden: `!isThatCardGroup(0)`, linearView_IsOpen: `SelectionManager_selectedDocType(this.toolType, this.expertMode)`} }, // Always available
- { title: "Custom 2", icon: "Custom 2", width: 80, toolTip: "Set visibilty!", subMenu: CurrentUserUtils.cardGroupTools("star"), expertMode: false, toolType:CollectionViewType.Card, funcs: {hidden: `!isThatCardGroup(1)`, linearView_IsOpen: `SelectionManager_selectedDocType(this.toolType, this.expertMode)`} }, // Always available
- { title: "Custom 3", icon: "Custom 3", width: 80, toolTip: "Set visibilty!", subMenu: CurrentUserUtils.cardGroupTools("satellite"), expertMode: false, toolType:CollectionViewType.Card, funcs: {hidden: `!isThatCardGroup(2)`, linearView_IsOpen: `SelectionManager_selectedDocType(this.toolType, this.expertMode)`} }, // Always available
+ { title: "Custom 1", icon: "Custom 1", width: 10, toolTip: "Set visibilty!", subMenu: CurrentUserUtils.cardGroupTools("heart"), expertMode: false, toolType:CollectionViewType.Card, funcs: {hidden: `!showFreeform("custom1", true)`, linearView_IsOpen: `SelectionManager_selectedDocType(this.toolType, this.expertMode)`} }, // Always available
+ { title: "Custom 2", icon: "Custom 2", width: 80, toolTip: "Set visibilty!", subMenu: CurrentUserUtils.cardGroupTools("star"), expertMode: false, toolType:CollectionViewType.Card, funcs: {hidden: `!showFreeform("custom2", true)`, linearView_IsOpen: `SelectionManager_selectedDocType(this.toolType, this.expertMode)`} }, // Always available
+ { title: "Custom 3", icon: "Custom 3", width: 80, toolTip: "Set visibilty!", subMenu: CurrentUserUtils.cardGroupTools("satellite"), expertMode: false, toolType:CollectionViewType.Card, funcs: {hidden: `!showFreeform("custom3", true)`, linearView_IsOpen: `SelectionManager_selectedDocType(this.toolType, this.expertMode)`} }, // Always available
]
}
diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx
index 8a63fc6d9..2ca03a40d 100644
--- a/src/client/views/collections/CollectionCardDeckView.tsx
+++ b/src/client/views/collections/CollectionCardDeckView.tsx
@@ -26,6 +26,7 @@ import { GPTPopupMode } from '../pdf/GPTPopup/GPTPopup';
import { reaction } from 'mobx';
import { NumListCast } from '../../../fields/Doc';
import { undoBatch } from '../../util/UndoManager';
+import { CalendarContainer } from 'react-datepicker';
@observer
export class CollectionCardView extends CollectionSubView() {
@@ -52,7 +53,7 @@ export class CollectionCardView extends CollectionSubView() {
return false;
}
// Get the group number for the current index from the customGroupDictionary
- const groupNumber = this.customGroupDictionary[currCustom].get(index);
+ const groupNumber = this.getButtonGroup(currCustom, l.layout)
// Check if the group number is in the active groups
return groupNumber !== undefined && activeGroups.includes(groupNumber);
});
@@ -319,8 +320,8 @@ export class CollectionCardView extends CollectionSubView() {
break;
case 'custom':
- typeA = this.customGroupDictionary[NumCast(this._props.Document.customSortNumber)].get(docs.indexOf(docA)) ?? '9999';
- typeB = this.customGroupDictionary[NumCast(this._props.Document.customSortNumber)].get(docs.indexOf(docB)) ?? '9999';
+ typeA = this.getButtonGroup(NumCast(this._props.Document.customSortNumber), docA.layout) ?? '9999'
+ typeB = this.getButtonGroup(NumCast(this._props.Document.customSortNumber), docB.layout) ?? '9999'
break;
case 'gpt':
@@ -411,6 +412,7 @@ export class CollectionCardView extends CollectionSubView() {
* @returns
*/
translateOverflowX(realIndex: number, calcIndex: number, calcRowCards: number) {
+
if (realIndex < this.maxRowCount) {
return 0;
}
@@ -683,7 +685,7 @@ export class CollectionCardView extends CollectionSubView() {
const groupNumber = NumCast(this._props.Document.customSortNumber);
let amButtons = 4;
- let activeButtonIndex = this.customGroupDictionary[groupNumber].get(childPairIndex);
+ let activeButtonIndex = this.getButtonGroup(groupNumber, doc)
if (isChat && doc) {
if (this.amGPTGroups > 4){
@@ -711,6 +713,19 @@ export class CollectionCardView extends CollectionSubView() {
);
}
+ getButtonGroup(groupNumber: number, doc: Doc) {
+ switch (groupNumber){
+ case 0:
+ return NumCast(doc.custom1Group)
+ case 1:
+ return NumCast(doc.custom2Group)
+ case 2:
+ return NumCast(doc.custom3Group)
+ default:
+ break
+ }
+ }
+
@computed get translateWrapperX() {
let translate = 0;
diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
index 3d138fa7d..4fb757d8a 100644
--- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx
+++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
@@ -156,7 +156,9 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> {
public addDoc: (doc: Doc | Doc[], sidebarKey?: string | undefined) => boolean = () => false;
public addToCollection: ((doc: Doc | Doc[], annotationKey?: string | undefined) => boolean) | undefined;
-
+ /**
+ * Sorts cards in the CollectionCardDeckView
+ */
generateSort = async () => {
this.setLoading(true);
this.setSortDone(false);