@leav/ui 1.8.0-c4bc6f9a → 1.9.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_gqlTypes/index.d.ts +72 -54
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.d.ts +2 -2
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.js.map +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.d.ts +2 -2
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js.map +1 -1
- package/dist/components/Notifications/hooks/useNotificationSubscription.d.ts +9 -3
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/hooks/useGetLibraryDetailExtendedQuery/useGetLibraryDetailExtendedQuery.d.ts +1 -1
- package/dist/hooks/useGetRecordUpdatesSubscription/useGetRecordUpdatesSubscription.d.ts +9 -3
- package/dist/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.js.map +1 -1
- package/package.json +6 -6
|
@@ -8215,7 +8215,7 @@ export declare const CheckApplicationExistenceDocument: Apollo.DocumentNode;
|
|
|
8215
8215
|
* },
|
|
8216
8216
|
* });
|
|
8217
8217
|
*/
|
|
8218
|
-
export declare function useCheckApplicationExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckApplicationExistenceQuery, CheckApplicationExistenceQueryVariables>): Apollo.
|
|
8218
|
+
export declare function useCheckApplicationExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckApplicationExistenceQuery, CheckApplicationExistenceQueryVariables>): Apollo.InteropQueryResult<CheckApplicationExistenceQuery, Exact<{
|
|
8219
8219
|
id?: InputMaybe<Scalars["ID"]["input"]>;
|
|
8220
8220
|
endpoint?: InputMaybe<Scalars["String"]["input"]>;
|
|
8221
8221
|
}>>;
|
|
@@ -8251,7 +8251,7 @@ export declare function useGetApplicationByIdQuery(baseOptions: Apollo.QueryHook
|
|
|
8251
8251
|
skip?: boolean;
|
|
8252
8252
|
} | {
|
|
8253
8253
|
skip: boolean;
|
|
8254
|
-
})): Apollo.
|
|
8254
|
+
})): Apollo.InteropQueryResult<GetApplicationByIdQuery, Exact<{
|
|
8255
8255
|
id: Scalars["ID"]["input"];
|
|
8256
8256
|
}>>;
|
|
8257
8257
|
export declare function useGetApplicationByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetApplicationByIdQuery, GetApplicationByIdQueryVariables>): Apollo.LazyQueryResultTuple<GetApplicationByIdQuery, Exact<{
|
|
@@ -8279,7 +8279,7 @@ export declare const GetApplicationModulesDocument: Apollo.DocumentNode;
|
|
|
8279
8279
|
* },
|
|
8280
8280
|
* });
|
|
8281
8281
|
*/
|
|
8282
|
-
export declare function useGetApplicationModulesQuery(baseOptions?: Apollo.QueryHookOptions<GetApplicationModulesQuery, GetApplicationModulesQueryVariables>): Apollo.
|
|
8282
|
+
export declare function useGetApplicationModulesQuery(baseOptions?: Apollo.QueryHookOptions<GetApplicationModulesQuery, GetApplicationModulesQueryVariables>): Apollo.InteropQueryResult<GetApplicationModulesQuery, Exact<{
|
|
8283
8283
|
[key: string]: never;
|
|
8284
8284
|
}>>;
|
|
8285
8285
|
export declare function useGetApplicationModulesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetApplicationModulesQuery, GetApplicationModulesQueryVariables>): Apollo.LazyQueryResultTuple<GetApplicationModulesQuery, Exact<{
|
|
@@ -8338,7 +8338,7 @@ export declare function useCheckAttributeExistenceQuery(baseOptions: Apollo.Quer
|
|
|
8338
8338
|
skip?: boolean;
|
|
8339
8339
|
} | {
|
|
8340
8340
|
skip: boolean;
|
|
8341
|
-
})): Apollo.
|
|
8341
|
+
})): Apollo.InteropQueryResult<CheckAttributeExistenceQuery, Exact<{
|
|
8342
8342
|
id: Scalars["ID"]["input"];
|
|
8343
8343
|
}>>;
|
|
8344
8344
|
export declare function useCheckAttributeExistenceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CheckAttributeExistenceQuery, CheckAttributeExistenceQueryVariables>): Apollo.LazyQueryResultTuple<CheckAttributeExistenceQuery, Exact<{
|
|
@@ -8392,7 +8392,7 @@ export declare const GetAttributeByIdDocument: Apollo.DocumentNode;
|
|
|
8392
8392
|
* },
|
|
8393
8393
|
* });
|
|
8394
8394
|
*/
|
|
8395
|
-
export declare function useGetAttributeByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetAttributeByIdQuery, GetAttributeByIdQueryVariables>): Apollo.
|
|
8395
|
+
export declare function useGetAttributeByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetAttributeByIdQuery, GetAttributeByIdQueryVariables>): Apollo.InteropQueryResult<GetAttributeByIdQuery, Exact<{
|
|
8396
8396
|
id?: InputMaybe<Scalars["ID"]["input"]>;
|
|
8397
8397
|
}>>;
|
|
8398
8398
|
export declare function useGetAttributeByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAttributeByIdQuery, GetAttributeByIdQueryVariables>): Apollo.LazyQueryResultTuple<GetAttributeByIdQuery, Exact<{
|
|
@@ -8426,7 +8426,7 @@ export declare function useGetAttributesByLibQuery(baseOptions: Apollo.QueryHook
|
|
|
8426
8426
|
skip?: boolean;
|
|
8427
8427
|
} | {
|
|
8428
8428
|
skip: boolean;
|
|
8429
|
-
})): Apollo.
|
|
8429
|
+
})): Apollo.InteropQueryResult<GetAttributesByLibQuery, Exact<{
|
|
8430
8430
|
library: Scalars["String"]["input"];
|
|
8431
8431
|
}>>;
|
|
8432
8432
|
export declare function useGetAttributesByLibLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAttributesByLibQuery, GetAttributesByLibQueryVariables>): Apollo.LazyQueryResultTuple<GetAttributesByLibQuery, Exact<{
|
|
@@ -8457,7 +8457,7 @@ export declare const GetAttributesDocument: Apollo.DocumentNode;
|
|
|
8457
8457
|
* },
|
|
8458
8458
|
* });
|
|
8459
8459
|
*/
|
|
8460
|
-
export declare function useGetAttributesQuery(baseOptions?: Apollo.QueryHookOptions<GetAttributesQuery, GetAttributesQueryVariables>): Apollo.
|
|
8460
|
+
export declare function useGetAttributesQuery(baseOptions?: Apollo.QueryHookOptions<GetAttributesQuery, GetAttributesQueryVariables>): Apollo.InteropQueryResult<GetAttributesQuery, Exact<{
|
|
8461
8461
|
pagination?: InputMaybe<Pagination>;
|
|
8462
8462
|
sort?: InputMaybe<SortAttributes>;
|
|
8463
8463
|
filters?: InputMaybe<AttributesFiltersInput>;
|
|
@@ -8491,7 +8491,7 @@ export declare const GetVersionProfilesDocument: Apollo.DocumentNode;
|
|
|
8491
8491
|
* },
|
|
8492
8492
|
* });
|
|
8493
8493
|
*/
|
|
8494
|
-
export declare function useGetVersionProfilesQuery(baseOptions?: Apollo.QueryHookOptions<GetVersionProfilesQuery, GetVersionProfilesQueryVariables>): Apollo.
|
|
8494
|
+
export declare function useGetVersionProfilesQuery(baseOptions?: Apollo.QueryHookOptions<GetVersionProfilesQuery, GetVersionProfilesQueryVariables>): Apollo.InteropQueryResult<GetVersionProfilesQuery, Exact<{
|
|
8495
8495
|
filters?: InputMaybe<VersionProfilesFiltersInput>;
|
|
8496
8496
|
sort?: InputMaybe<SortVersionProfilesInput>;
|
|
8497
8497
|
}>>;
|
|
@@ -8527,7 +8527,7 @@ export declare function useGetVersionableAttributesByLibraryQuery(baseOptions: A
|
|
|
8527
8527
|
skip?: boolean;
|
|
8528
8528
|
} | {
|
|
8529
8529
|
skip: boolean;
|
|
8530
|
-
})): Apollo.
|
|
8530
|
+
})): Apollo.InteropQueryResult<GetVersionableAttributesByLibraryQuery, Exact<{
|
|
8531
8531
|
libraryId: Scalars["String"]["input"];
|
|
8532
8532
|
}>>;
|
|
8533
8533
|
export declare function useGetVersionableAttributesByLibraryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetVersionableAttributesByLibraryQuery, GetVersionableAttributesByLibraryQueryVariables>): Apollo.LazyQueryResultTuple<GetVersionableAttributesByLibraryQuery, Exact<{
|
|
@@ -8588,7 +8588,7 @@ export declare function useExportQuery(baseOptions: Apollo.QueryHookOptions<Expo
|
|
|
8588
8588
|
skip?: boolean;
|
|
8589
8589
|
} | {
|
|
8590
8590
|
skip: boolean;
|
|
8591
|
-
})): Apollo.
|
|
8591
|
+
})): Apollo.InteropQueryResult<ExportQuery, Exact<{
|
|
8592
8592
|
library: Scalars["ID"]["input"];
|
|
8593
8593
|
filters?: InputMaybe<Array<RecordFilterInput> | RecordFilterInput>;
|
|
8594
8594
|
profile?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -8689,7 +8689,7 @@ export declare function useGetDirectoryDataQuery(baseOptions: Apollo.QueryHookOp
|
|
|
8689
8689
|
skip?: boolean;
|
|
8690
8690
|
} | {
|
|
8691
8691
|
skip: boolean;
|
|
8692
|
-
})): Apollo.
|
|
8692
|
+
})): Apollo.InteropQueryResult<GetDirectoryDataQuery, Exact<{
|
|
8693
8693
|
library: Scalars["ID"]["input"];
|
|
8694
8694
|
directoryId: Scalars["String"]["input"];
|
|
8695
8695
|
}>>;
|
|
@@ -8720,9 +8720,15 @@ export declare const UploadUpdateDocument: Apollo.DocumentNode;
|
|
|
8720
8720
|
* },
|
|
8721
8721
|
* });
|
|
8722
8722
|
*/
|
|
8723
|
-
export declare function useUploadUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions<UploadUpdateSubscription, UploadUpdateSubscriptionVariables>):
|
|
8724
|
-
|
|
8725
|
-
|
|
8723
|
+
export declare function useUploadUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions<UploadUpdateSubscription, UploadUpdateSubscriptionVariables>): {
|
|
8724
|
+
restart: () => void;
|
|
8725
|
+
loading: boolean;
|
|
8726
|
+
data?: UploadUpdateSubscription;
|
|
8727
|
+
error?: Apollo.ApolloError;
|
|
8728
|
+
variables?: Exact<{
|
|
8729
|
+
filters?: InputMaybe<UploadFiltersInput>;
|
|
8730
|
+
}>;
|
|
8731
|
+
};
|
|
8726
8732
|
export type UploadUpdateSubscriptionHookResult = ReturnType<typeof useUploadUpdateSubscription>;
|
|
8727
8733
|
export type UploadUpdateSubscriptionResult = Apollo.SubscriptionResult<UploadUpdateSubscription>;
|
|
8728
8734
|
export declare const UploadDocument: Apollo.DocumentNode;
|
|
@@ -8800,7 +8806,7 @@ export declare const CheckLibraryExistenceDocument: Apollo.DocumentNode;
|
|
|
8800
8806
|
* },
|
|
8801
8807
|
* });
|
|
8802
8808
|
*/
|
|
8803
|
-
export declare function useCheckLibraryExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckLibraryExistenceQuery, CheckLibraryExistenceQueryVariables>): Apollo.
|
|
8809
|
+
export declare function useCheckLibraryExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckLibraryExistenceQuery, CheckLibraryExistenceQueryVariables>): Apollo.InteropQueryResult<CheckLibraryExistenceQuery, Exact<{
|
|
8804
8810
|
id?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
8805
8811
|
}>>;
|
|
8806
8812
|
export declare function useCheckLibraryExistenceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CheckLibraryExistenceQuery, CheckLibraryExistenceQueryVariables>): Apollo.LazyQueryResultTuple<CheckLibraryExistenceQuery, Exact<{
|
|
@@ -8853,7 +8859,7 @@ export declare const GetLibrariesDocument: Apollo.DocumentNode;
|
|
|
8853
8859
|
* },
|
|
8854
8860
|
* });
|
|
8855
8861
|
*/
|
|
8856
|
-
export declare function useGetLibrariesQuery(baseOptions?: Apollo.QueryHookOptions<GetLibrariesQuery, GetLibrariesQueryVariables>): Apollo.
|
|
8862
|
+
export declare function useGetLibrariesQuery(baseOptions?: Apollo.QueryHookOptions<GetLibrariesQuery, GetLibrariesQueryVariables>): Apollo.InteropQueryResult<GetLibrariesQuery, Exact<{
|
|
8857
8863
|
[key: string]: never;
|
|
8858
8864
|
}>>;
|
|
8859
8865
|
export declare function useGetLibrariesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibrariesQuery, GetLibrariesQueryVariables>): Apollo.LazyQueryResultTuple<GetLibrariesQuery, Exact<{
|
|
@@ -8882,7 +8888,7 @@ export declare const GetLibraryByIdDocument: Apollo.DocumentNode;
|
|
|
8882
8888
|
* },
|
|
8883
8889
|
* });
|
|
8884
8890
|
*/
|
|
8885
|
-
export declare function useGetLibraryByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetLibraryByIdQuery, GetLibraryByIdQueryVariables>): Apollo.
|
|
8891
|
+
export declare function useGetLibraryByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetLibraryByIdQuery, GetLibraryByIdQueryVariables>): Apollo.InteropQueryResult<GetLibraryByIdQuery, Exact<{
|
|
8886
8892
|
id?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
8887
8893
|
}>>;
|
|
8888
8894
|
export declare function useGetLibraryByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibraryByIdQuery, GetLibraryByIdQueryVariables>): Apollo.LazyQueryResultTuple<GetLibraryByIdQuery, Exact<{
|
|
@@ -8911,7 +8917,7 @@ export declare const GetLibraryPermissionsDocument: Apollo.DocumentNode;
|
|
|
8911
8917
|
* },
|
|
8912
8918
|
* });
|
|
8913
8919
|
*/
|
|
8914
|
-
export declare function useGetLibraryPermissionsQuery(baseOptions?: Apollo.QueryHookOptions<GetLibraryPermissionsQuery, GetLibraryPermissionsQueryVariables>): Apollo.
|
|
8920
|
+
export declare function useGetLibraryPermissionsQuery(baseOptions?: Apollo.QueryHookOptions<GetLibraryPermissionsQuery, GetLibraryPermissionsQueryVariables>): Apollo.InteropQueryResult<GetLibraryPermissionsQuery, Exact<{
|
|
8915
8921
|
libraryId?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
8916
8922
|
}>>;
|
|
8917
8923
|
export declare function useGetLibraryPermissionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibraryPermissionsQuery, GetLibraryPermissionsQueryVariables>): Apollo.LazyQueryResultTuple<GetLibraryPermissionsQuery, Exact<{
|
|
@@ -8945,7 +8951,7 @@ export declare function useGetLibraryPreviewsSettingsQuery(baseOptions: Apollo.Q
|
|
|
8945
8951
|
skip?: boolean;
|
|
8946
8952
|
} | {
|
|
8947
8953
|
skip: boolean;
|
|
8948
|
-
})): Apollo.
|
|
8954
|
+
})): Apollo.InteropQueryResult<GetLibraryPreviewsSettingsQuery, Exact<{
|
|
8949
8955
|
id: Scalars["ID"]["input"];
|
|
8950
8956
|
}>>;
|
|
8951
8957
|
export declare function useGetLibraryPreviewsSettingsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibraryPreviewsSettingsQuery, GetLibraryPreviewsSettingsQueryVariables>): Apollo.LazyQueryResultTuple<GetLibraryPreviewsSettingsQuery, Exact<{
|
|
@@ -9007,7 +9013,7 @@ export declare function useIsAllowedQuery(baseOptions: Apollo.QueryHookOptions<I
|
|
|
9007
9013
|
skip?: boolean;
|
|
9008
9014
|
} | {
|
|
9009
9015
|
skip: boolean;
|
|
9010
|
-
})): Apollo.
|
|
9016
|
+
})): Apollo.InteropQueryResult<IsAllowedQuery, Exact<{
|
|
9011
9017
|
type: PermissionTypes;
|
|
9012
9018
|
actions: Array<PermissionsActions> | PermissionsActions;
|
|
9013
9019
|
applyTo?: InputMaybe<Scalars["ID"]["input"]>;
|
|
@@ -9188,7 +9194,7 @@ export declare function useDoesFileExistAsChildQuery(baseOptions: Apollo.QueryHo
|
|
|
9188
9194
|
skip?: boolean;
|
|
9189
9195
|
} | {
|
|
9190
9196
|
skip: boolean;
|
|
9191
|
-
})): Apollo.
|
|
9197
|
+
})): Apollo.InteropQueryResult<DoesFileExistAsChildQuery, Exact<{
|
|
9192
9198
|
parentNode?: InputMaybe<Scalars["ID"]["input"]>;
|
|
9193
9199
|
treeId: Scalars["ID"]["input"];
|
|
9194
9200
|
filename: Scalars["String"]["input"];
|
|
@@ -9228,7 +9234,7 @@ export declare function useGetFileDataQuery(baseOptions: Apollo.QueryHookOptions
|
|
|
9228
9234
|
skip?: boolean;
|
|
9229
9235
|
} | {
|
|
9230
9236
|
skip: boolean;
|
|
9231
|
-
})): Apollo.
|
|
9237
|
+
})): Apollo.InteropQueryResult<GetFileDataQuery, Exact<{
|
|
9232
9238
|
library: Scalars["ID"]["input"];
|
|
9233
9239
|
fileId: Scalars["String"]["input"];
|
|
9234
9240
|
previewsStatusAttribute: Scalars["ID"]["input"];
|
|
@@ -9269,7 +9275,7 @@ export declare function useRecordFormQuery(baseOptions: Apollo.QueryHookOptions<
|
|
|
9269
9275
|
skip?: boolean;
|
|
9270
9276
|
} | {
|
|
9271
9277
|
skip: boolean;
|
|
9272
|
-
})): Apollo.
|
|
9278
|
+
})): Apollo.InteropQueryResult<RecordFormQuery, Exact<{
|
|
9273
9279
|
libraryId: Scalars["String"]["input"];
|
|
9274
9280
|
formId: Scalars["String"]["input"];
|
|
9275
9281
|
recordId?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -9304,9 +9310,15 @@ export declare const RecordUpdateDocument: Apollo.DocumentNode;
|
|
|
9304
9310
|
* },
|
|
9305
9311
|
* });
|
|
9306
9312
|
*/
|
|
9307
|
-
export declare function useRecordUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions<RecordUpdateSubscription, RecordUpdateSubscriptionVariables>):
|
|
9308
|
-
|
|
9309
|
-
|
|
9313
|
+
export declare function useRecordUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions<RecordUpdateSubscription, RecordUpdateSubscriptionVariables>): {
|
|
9314
|
+
restart: () => void;
|
|
9315
|
+
loading: boolean;
|
|
9316
|
+
data?: RecordUpdateSubscription;
|
|
9317
|
+
error?: Apollo.ApolloError;
|
|
9318
|
+
variables?: Exact<{
|
|
9319
|
+
filters?: InputMaybe<RecordUpdateFilterInput>;
|
|
9320
|
+
}>;
|
|
9321
|
+
};
|
|
9310
9322
|
export type RecordUpdateSubscriptionHookResult = ReturnType<typeof useRecordUpdateSubscription>;
|
|
9311
9323
|
export type RecordUpdateSubscriptionResult = Apollo.SubscriptionResult<RecordUpdateSubscription>;
|
|
9312
9324
|
export declare const GetRecordsFromLibraryDocument: Apollo.DocumentNode;
|
|
@@ -9333,7 +9345,7 @@ export declare function useGetRecordsFromLibraryQuery(baseOptions: Apollo.QueryH
|
|
|
9333
9345
|
skip?: boolean;
|
|
9334
9346
|
} | {
|
|
9335
9347
|
skip: boolean;
|
|
9336
|
-
})): Apollo.
|
|
9348
|
+
})): Apollo.InteropQueryResult<GetRecordsFromLibraryQuery, Exact<{
|
|
9337
9349
|
libraryId: Scalars["ID"]["input"];
|
|
9338
9350
|
pagination?: InputMaybe<RecordsPagination>;
|
|
9339
9351
|
filters?: InputMaybe<Array<InputMaybe<RecordFilterInput>> | InputMaybe<RecordFilterInput>>;
|
|
@@ -9445,7 +9457,7 @@ export declare const CheckTreeExistenceDocument: Apollo.DocumentNode;
|
|
|
9445
9457
|
* },
|
|
9446
9458
|
* });
|
|
9447
9459
|
*/
|
|
9448
|
-
export declare function useCheckTreeExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckTreeExistenceQuery, CheckTreeExistenceQueryVariables>): Apollo.
|
|
9460
|
+
export declare function useCheckTreeExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckTreeExistenceQuery, CheckTreeExistenceQueryVariables>): Apollo.InteropQueryResult<CheckTreeExistenceQuery, Exact<{
|
|
9449
9461
|
id?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
9450
9462
|
}>>;
|
|
9451
9463
|
export declare function useCheckTreeExistenceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CheckTreeExistenceQuery, CheckTreeExistenceQueryVariables>): Apollo.LazyQueryResultTuple<CheckTreeExistenceQuery, Exact<{
|
|
@@ -9499,7 +9511,7 @@ export declare const GetTreeByIdDocument: Apollo.DocumentNode;
|
|
|
9499
9511
|
* },
|
|
9500
9512
|
* });
|
|
9501
9513
|
*/
|
|
9502
|
-
export declare function useGetTreeByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetTreeByIdQuery, GetTreeByIdQueryVariables>): Apollo.
|
|
9514
|
+
export declare function useGetTreeByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetTreeByIdQuery, GetTreeByIdQueryVariables>): Apollo.InteropQueryResult<GetTreeByIdQuery, Exact<{
|
|
9503
9515
|
id?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
9504
9516
|
}>>;
|
|
9505
9517
|
export declare function useGetTreeByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetTreeByIdQuery, GetTreeByIdQueryVariables>): Apollo.LazyQueryResultTuple<GetTreeByIdQuery, Exact<{
|
|
@@ -9529,7 +9541,7 @@ export declare const GetTreeLibrariesDocument: Apollo.DocumentNode;
|
|
|
9529
9541
|
* },
|
|
9530
9542
|
* });
|
|
9531
9543
|
*/
|
|
9532
|
-
export declare function useGetTreeLibrariesQuery(baseOptions?: Apollo.QueryHookOptions<GetTreeLibrariesQuery, GetTreeLibrariesQueryVariables>): Apollo.
|
|
9544
|
+
export declare function useGetTreeLibrariesQuery(baseOptions?: Apollo.QueryHookOptions<GetTreeLibrariesQuery, GetTreeLibrariesQueryVariables>): Apollo.InteropQueryResult<GetTreeLibrariesQuery, Exact<{
|
|
9533
9545
|
treeId?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
9534
9546
|
library?: InputMaybe<Scalars["String"]["input"]>;
|
|
9535
9547
|
}>>;
|
|
@@ -9559,7 +9571,7 @@ export declare const GetTreesDocument: Apollo.DocumentNode;
|
|
|
9559
9571
|
* },
|
|
9560
9572
|
* });
|
|
9561
9573
|
*/
|
|
9562
|
-
export declare function useGetTreesQuery(baseOptions?: Apollo.QueryHookOptions<GetTreesQuery, GetTreesQueryVariables>): Apollo.
|
|
9574
|
+
export declare function useGetTreesQuery(baseOptions?: Apollo.QueryHookOptions<GetTreesQuery, GetTreesQueryVariables>): Apollo.InteropQueryResult<GetTreesQuery, Exact<{
|
|
9563
9575
|
[key: string]: never;
|
|
9564
9576
|
}>>;
|
|
9565
9577
|
export declare function useGetTreesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetTreesQuery, GetTreesQueryVariables>): Apollo.LazyQueryResultTuple<GetTreesQuery, Exact<{
|
|
@@ -9622,7 +9634,7 @@ export declare function useTreeNodeChildrenQuery(baseOptions: Apollo.QueryHookOp
|
|
|
9622
9634
|
skip?: boolean;
|
|
9623
9635
|
} | {
|
|
9624
9636
|
skip: boolean;
|
|
9625
|
-
})): Apollo.
|
|
9637
|
+
})): Apollo.InteropQueryResult<TreeNodeChildrenQuery, Exact<{
|
|
9626
9638
|
treeId: Scalars["ID"]["input"];
|
|
9627
9639
|
node?: InputMaybe<Scalars["ID"]["input"]>;
|
|
9628
9640
|
pagination?: InputMaybe<Pagination>;
|
|
@@ -9669,7 +9681,7 @@ export declare function useGetTreeNodeChildrenWithAccessByDefaultPermissionQuery
|
|
|
9669
9681
|
skip?: boolean;
|
|
9670
9682
|
} | {
|
|
9671
9683
|
skip: boolean;
|
|
9672
|
-
})): Apollo.
|
|
9684
|
+
})): Apollo.InteropQueryResult<GetTreeNodeChildrenWithAccessByDefaultPermissionQueryQuery, Exact<{
|
|
9673
9685
|
treeId: Scalars["ID"]["input"];
|
|
9674
9686
|
node?: InputMaybe<Scalars["ID"]["input"]>;
|
|
9675
9687
|
pagination?: InputMaybe<Pagination>;
|
|
@@ -9714,7 +9726,7 @@ export declare function useGetUserDataQuery(baseOptions: Apollo.QueryHookOptions
|
|
|
9714
9726
|
skip?: boolean;
|
|
9715
9727
|
} | {
|
|
9716
9728
|
skip: boolean;
|
|
9717
|
-
})): Apollo.
|
|
9729
|
+
})): Apollo.InteropQueryResult<GetUserDataQuery, Exact<{
|
|
9718
9730
|
keys: Array<Scalars["String"]["input"]> | Scalars["String"]["input"];
|
|
9719
9731
|
global?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
9720
9732
|
}>>;
|
|
@@ -9899,7 +9911,7 @@ export declare function useGetViewQuery(baseOptions: Apollo.QueryHookOptions<Get
|
|
|
9899
9911
|
skip?: boolean;
|
|
9900
9912
|
} | {
|
|
9901
9913
|
skip: boolean;
|
|
9902
|
-
})): Apollo.
|
|
9914
|
+
})): Apollo.InteropQueryResult<GetViewQuery, Exact<{
|
|
9903
9915
|
viewId: Scalars["String"]["input"];
|
|
9904
9916
|
}>>;
|
|
9905
9917
|
export declare function useGetViewLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetViewQuery, GetViewQueryVariables>): Apollo.LazyQueryResultTuple<GetViewQuery, Exact<{
|
|
@@ -9933,7 +9945,7 @@ export declare function useGetViewsListQuery(baseOptions: Apollo.QueryHookOption
|
|
|
9933
9945
|
skip?: boolean;
|
|
9934
9946
|
} | {
|
|
9935
9947
|
skip: boolean;
|
|
9936
|
-
})): Apollo.
|
|
9948
|
+
})): Apollo.InteropQueryResult<GetViewsListQuery, Exact<{
|
|
9937
9949
|
libraryId: Scalars["String"]["input"];
|
|
9938
9950
|
}>>;
|
|
9939
9951
|
export declare function useGetViewsListLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetViewsListQuery, GetViewsListQueryVariables>): Apollo.LazyQueryResultTuple<GetViewsListQuery, Exact<{
|
|
@@ -9992,7 +10004,7 @@ export declare function useAttributeWithValuesForMassEditionQuery(baseOptions: A
|
|
|
9992
10004
|
skip?: boolean;
|
|
9993
10005
|
} | {
|
|
9994
10006
|
skip: boolean;
|
|
9995
|
-
})): Apollo.
|
|
10007
|
+
})): Apollo.InteropQueryResult<AttributeWithValuesForMassEditionQuery, Exact<{
|
|
9996
10008
|
attributeId: Scalars["ID"]["input"];
|
|
9997
10009
|
}>>;
|
|
9998
10010
|
export declare function useAttributeWithValuesForMassEditionLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AttributeWithValuesForMassEditionQuery, AttributeWithValuesForMassEditionQueryVariables>): Apollo.LazyQueryResultTuple<AttributeWithValuesForMassEditionQuery, Exact<{
|
|
@@ -10026,7 +10038,7 @@ export declare function useGetAttributesByLibWithPermissionsQuery(baseOptions: A
|
|
|
10026
10038
|
skip?: boolean;
|
|
10027
10039
|
} | {
|
|
10028
10040
|
skip: boolean;
|
|
10029
|
-
})): Apollo.
|
|
10041
|
+
})): Apollo.InteropQueryResult<GetAttributesByLibWithPermissionsQuery, Exact<{
|
|
10030
10042
|
library: Scalars["String"]["input"];
|
|
10031
10043
|
}>>;
|
|
10032
10044
|
export declare function useGetAttributesByLibWithPermissionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAttributesByLibWithPermissionsQuery, GetAttributesByLibWithPermissionsQueryVariables>): Apollo.LazyQueryResultTuple<GetAttributesByLibWithPermissionsQuery, Exact<{
|
|
@@ -10055,7 +10067,7 @@ export declare const ExplorerAttributesDocument: Apollo.DocumentNode;
|
|
|
10055
10067
|
* },
|
|
10056
10068
|
* });
|
|
10057
10069
|
*/
|
|
10058
|
-
export declare function useExplorerAttributesQuery(baseOptions?: Apollo.QueryHookOptions<ExplorerAttributesQuery, ExplorerAttributesQueryVariables>): Apollo.
|
|
10070
|
+
export declare function useExplorerAttributesQuery(baseOptions?: Apollo.QueryHookOptions<ExplorerAttributesQuery, ExplorerAttributesQueryVariables>): Apollo.InteropQueryResult<ExplorerAttributesQuery, Exact<{
|
|
10059
10071
|
ids?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
10060
10072
|
}>>;
|
|
10061
10073
|
export declare function useExplorerAttributesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExplorerAttributesQuery, ExplorerAttributesQueryVariables>): Apollo.LazyQueryResultTuple<ExplorerAttributesQuery, Exact<{
|
|
@@ -10089,7 +10101,7 @@ export declare function useExplorerLinkAttributeQuery(baseOptions: Apollo.QueryH
|
|
|
10089
10101
|
skip?: boolean;
|
|
10090
10102
|
} | {
|
|
10091
10103
|
skip: boolean;
|
|
10092
|
-
})): Apollo.
|
|
10104
|
+
})): Apollo.InteropQueryResult<ExplorerLinkAttributeQuery, Exact<{
|
|
10093
10105
|
id: Scalars["ID"]["input"];
|
|
10094
10106
|
}>>;
|
|
10095
10107
|
export declare function useExplorerLinkAttributeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExplorerLinkAttributeQuery, ExplorerLinkAttributeQueryVariables>): Apollo.LazyQueryResultTuple<ExplorerLinkAttributeQuery, Exact<{
|
|
@@ -10125,7 +10137,7 @@ export declare function useCountValuesOccurrencesQuery(baseOptions: Apollo.Query
|
|
|
10125
10137
|
skip?: boolean;
|
|
10126
10138
|
} | {
|
|
10127
10139
|
skip: boolean;
|
|
10128
|
-
})): Apollo.
|
|
10140
|
+
})): Apollo.InteropQueryResult<CountValuesOccurrencesQuery, Exact<{
|
|
10129
10141
|
library: Scalars["ID"]["input"];
|
|
10130
10142
|
attribute: Scalars["ID"]["input"];
|
|
10131
10143
|
recordFilters?: InputMaybe<Array<InputMaybe<RecordFilterInput>> | InputMaybe<RecordFilterInput>>;
|
|
@@ -10168,7 +10180,7 @@ export declare function useExplorerLibraryDataQuery(baseOptions: Apollo.QueryHoo
|
|
|
10168
10180
|
skip?: boolean;
|
|
10169
10181
|
} | {
|
|
10170
10182
|
skip: boolean;
|
|
10171
|
-
})): Apollo.
|
|
10183
|
+
})): Apollo.InteropQueryResult<ExplorerLibraryDataQuery, Exact<{
|
|
10172
10184
|
libraryId: Scalars["ID"]["input"];
|
|
10173
10185
|
attributeIds: Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"];
|
|
10174
10186
|
pagination?: InputMaybe<RecordsPagination>;
|
|
@@ -10215,7 +10227,7 @@ export declare function useExplorerLinkDataQuery(baseOptions: Apollo.QueryHookOp
|
|
|
10215
10227
|
skip?: boolean;
|
|
10216
10228
|
} | {
|
|
10217
10229
|
skip: boolean;
|
|
10218
|
-
})): Apollo.
|
|
10230
|
+
})): Apollo.InteropQueryResult<ExplorerLinkDataQuery, Exact<{
|
|
10219
10231
|
attributeIds: Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"];
|
|
10220
10232
|
parentLibraryId: Scalars["ID"]["input"];
|
|
10221
10233
|
parentRecordId?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -10255,7 +10267,7 @@ export declare function useGetLibraryAttributesQuery(baseOptions: Apollo.QueryHo
|
|
|
10255
10267
|
skip?: boolean;
|
|
10256
10268
|
} | {
|
|
10257
10269
|
skip: boolean;
|
|
10258
|
-
})): Apollo.
|
|
10270
|
+
})): Apollo.InteropQueryResult<GetLibraryAttributesQuery, Exact<{
|
|
10259
10271
|
libraryId: Scalars["ID"]["input"];
|
|
10260
10272
|
}>>;
|
|
10261
10273
|
export declare function useGetLibraryAttributesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibraryAttributesQuery, GetLibraryAttributesQueryVariables>): Apollo.LazyQueryResultTuple<GetLibraryAttributesQuery, Exact<{
|
|
@@ -10289,7 +10301,7 @@ export declare function useExplorerLibraryDetailsQuery(baseOptions: Apollo.Query
|
|
|
10289
10301
|
skip?: boolean;
|
|
10290
10302
|
} | {
|
|
10291
10303
|
skip: boolean;
|
|
10292
|
-
})): Apollo.
|
|
10304
|
+
})): Apollo.InteropQueryResult<ExplorerLibraryDetailsQuery, Exact<{
|
|
10293
10305
|
libraryId: Scalars["ID"]["input"];
|
|
10294
10306
|
}>>;
|
|
10295
10307
|
export declare function useExplorerLibraryDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExplorerLibraryDetailsQuery, ExplorerLibraryDetailsQueryVariables>): Apollo.LazyQueryResultTuple<ExplorerLibraryDetailsQuery, Exact<{
|
|
@@ -10318,7 +10330,7 @@ export declare const LibraryExportProfilesDocument: Apollo.DocumentNode;
|
|
|
10318
10330
|
* },
|
|
10319
10331
|
* });
|
|
10320
10332
|
*/
|
|
10321
|
-
export declare function useLibraryExportProfilesQuery(baseOptions?: Apollo.QueryHookOptions<LibraryExportProfilesQuery, LibraryExportProfilesQueryVariables>): Apollo.
|
|
10333
|
+
export declare function useLibraryExportProfilesQuery(baseOptions?: Apollo.QueryHookOptions<LibraryExportProfilesQuery, LibraryExportProfilesQueryVariables>): Apollo.InteropQueryResult<LibraryExportProfilesQuery, Exact<{
|
|
10322
10334
|
libraryId?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
10323
10335
|
}>>;
|
|
10324
10336
|
export declare function useLibraryExportProfilesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<LibraryExportProfilesQuery, LibraryExportProfilesQueryVariables>): Apollo.LazyQueryResultTuple<LibraryExportProfilesQuery, Exact<{
|
|
@@ -10353,7 +10365,7 @@ export declare function useExplorerSelectionIdsQuery(baseOptions: Apollo.QueryHo
|
|
|
10353
10365
|
skip?: boolean;
|
|
10354
10366
|
} | {
|
|
10355
10367
|
skip: boolean;
|
|
10356
|
-
})): Apollo.
|
|
10368
|
+
})): Apollo.InteropQueryResult<ExplorerSelectionIdsQuery, Exact<{
|
|
10357
10369
|
libraryId: Scalars["ID"]["input"];
|
|
10358
10370
|
filters?: InputMaybe<Array<InputMaybe<RecordFilterInput>> | InputMaybe<RecordFilterInput>>;
|
|
10359
10371
|
}>>;
|
|
@@ -10383,7 +10395,7 @@ export declare const MeDocument: Apollo.DocumentNode;
|
|
|
10383
10395
|
* },
|
|
10384
10396
|
* });
|
|
10385
10397
|
*/
|
|
10386
|
-
export declare function useMeQuery(baseOptions?: Apollo.QueryHookOptions<MeQuery, MeQueryVariables>): Apollo.
|
|
10398
|
+
export declare function useMeQuery(baseOptions?: Apollo.QueryHookOptions<MeQuery, MeQueryVariables>): Apollo.InteropQueryResult<MeQuery, Exact<{
|
|
10387
10399
|
[key: string]: never;
|
|
10388
10400
|
}>>;
|
|
10389
10401
|
export declare function useMeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MeQuery, MeQueryVariables>): Apollo.LazyQueryResultTuple<MeQuery, Exact<{
|
|
@@ -10444,7 +10456,7 @@ export declare function useSmartFilterListValuesQuery(baseOptions: Apollo.QueryH
|
|
|
10444
10456
|
skip?: boolean;
|
|
10445
10457
|
} | {
|
|
10446
10458
|
skip: boolean;
|
|
10447
|
-
})): Apollo.
|
|
10459
|
+
})): Apollo.InteropQueryResult<SmartFilterListValuesQuery, Exact<{
|
|
10448
10460
|
library: Scalars["ID"]["input"];
|
|
10449
10461
|
attribute: Scalars["ID"]["input"];
|
|
10450
10462
|
recordFilters?: InputMaybe<Array<InputMaybe<RecordFilterInput>> | InputMaybe<RecordFilterInput>>;
|
|
@@ -10476,9 +10488,15 @@ export declare const NotificationDocument: Apollo.DocumentNode;
|
|
|
10476
10488
|
* },
|
|
10477
10489
|
* });
|
|
10478
10490
|
*/
|
|
10479
|
-
export declare function useNotificationSubscription(baseOptions?: Apollo.SubscriptionHookOptions<NotificationSubscription, NotificationSubscriptionVariables>):
|
|
10480
|
-
|
|
10481
|
-
|
|
10491
|
+
export declare function useNotificationSubscription(baseOptions?: Apollo.SubscriptionHookOptions<NotificationSubscription, NotificationSubscriptionVariables>): {
|
|
10492
|
+
restart: () => void;
|
|
10493
|
+
loading: boolean;
|
|
10494
|
+
data?: NotificationSubscription;
|
|
10495
|
+
error?: Apollo.ApolloError;
|
|
10496
|
+
variables?: Exact<{
|
|
10497
|
+
[key: string]: never;
|
|
10498
|
+
}>;
|
|
10499
|
+
};
|
|
10482
10500
|
export type NotificationSubscriptionHookResult = ReturnType<typeof useNotificationSubscription>;
|
|
10483
10501
|
export type NotificationSubscriptionResult = Apollo.SubscriptionResult<NotificationSubscription>;
|
|
10484
10502
|
export declare const GetRecordHistoryDocument: Apollo.DocumentNode;
|
|
@@ -10506,7 +10524,7 @@ export declare function useGetRecordHistoryQuery(baseOptions: Apollo.QueryHookOp
|
|
|
10506
10524
|
skip?: boolean;
|
|
10507
10525
|
} | {
|
|
10508
10526
|
skip: boolean;
|
|
10509
|
-
})): Apollo.
|
|
10527
|
+
})): Apollo.InteropQueryResult<GetRecordHistoryQuery, Exact<{
|
|
10510
10528
|
record: LogTopicRecordFilterInput;
|
|
10511
10529
|
attributeId?: InputMaybe<Scalars["String"]["input"]>;
|
|
10512
10530
|
actions?: InputMaybe<Array<LogAction> | LogAction>;
|
|
@@ -10546,7 +10564,7 @@ export declare function useTreeDataQueryQuery(baseOptions: Apollo.QueryHookOptio
|
|
|
10546
10564
|
skip?: boolean;
|
|
10547
10565
|
} | {
|
|
10548
10566
|
skip: boolean;
|
|
10549
|
-
})): Apollo.
|
|
10567
|
+
})): Apollo.InteropQueryResult<TreeDataQueryQuery, Exact<{
|
|
10550
10568
|
treeId: Scalars["ID"]["input"];
|
|
10551
10569
|
}>>;
|
|
10552
10570
|
export declare function useTreeDataQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<TreeDataQueryQuery, TreeDataQueryQueryVariables>): Apollo.LazyQueryResultTuple<TreeDataQueryQuery, Exact<{
|
|
@@ -5,7 +5,7 @@ import { type IAttribute, type IField, type IFilter, type ISearchSelection, type
|
|
|
5
5
|
import { type IValueVersion } from '../../../../types/values';
|
|
6
6
|
import { type IView, type IViewDisplay } from '../../../../types/views';
|
|
7
7
|
import { type PermissionsActions, type SortOrder } from '../../../../_gqlTypes';
|
|
8
|
-
import { type
|
|
8
|
+
import { type GraphQLFormattedError, type GraphQLErrorExtensions } from 'graphql';
|
|
9
9
|
import { type ILibraryDetailExtended, type ILibraryDetailExtendedLinkedTree } from '../../../../_queries/libraries/getLibraryDetailExtendQuery';
|
|
10
10
|
export type IRecordPreview = {
|
|
11
11
|
small: string;
|
|
@@ -38,7 +38,7 @@ export interface ISidebarState {
|
|
|
38
38
|
visible: boolean;
|
|
39
39
|
type: SidebarContentType;
|
|
40
40
|
}
|
|
41
|
-
export type SearchStateError = Override<
|
|
41
|
+
export type SearchStateError = Override<GraphQLFormattedError, {
|
|
42
42
|
extensions: GraphQLErrorExtensions & {
|
|
43
43
|
record?: {
|
|
44
44
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../../src/components/LibraryItemsList/hooks/useSearchReducer/_types.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type Override} from '@leav/utils';\nimport {type ILang} from '_ui/types/misc';\nimport {type IRecordIdentityWhoAmI} from '_ui/types/records';\nimport {\n type IAttribute,\n type IField,\n type IFilter,\n type ISearchSelection,\n type SearchMode,\n type SidebarContentType,\n} from '_ui/types/search';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type IView, type IViewDisplay} from '_ui/types/views';\nimport {type PermissionsActions, type SortOrder} from '_ui/_gqlTypes';\nimport {type
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../../src/components/LibraryItemsList/hooks/useSearchReducer/_types.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type Override} from '@leav/utils';\nimport {type ILang} from '_ui/types/misc';\nimport {type IRecordIdentityWhoAmI} from '_ui/types/records';\nimport {\n type IAttribute,\n type IField,\n type IFilter,\n type ISearchSelection,\n type SearchMode,\n type SidebarContentType,\n} from '_ui/types/search';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type IView, type IViewDisplay} from '_ui/types/views';\nimport {type PermissionsActions, type SortOrder} from '_ui/_gqlTypes';\nimport {type GraphQLFormattedError, type GraphQLErrorExtensions} from 'graphql';\nimport {\n type ILibraryDetailExtended,\n type ILibraryDetailExtendedLinkedTree,\n} from '_ui/_queries/libraries/getLibraryDetailExtendQuery';\n\nexport type IRecordPreview = {\n small: string;\n medium: string;\n big: string;\n pages: string;\n} | null;\n\nexport interface IRecordWhoAmI {\n id: string;\n label?: string;\n preview?: IRecordPreview;\n color?: string;\n library?: {\n id: string;\n label: Record<string, string>;\n };\n}\n\nexport interface ISearchRecord {\n whoAmI: IRecordIdentityWhoAmI;\n index: number;\n fields: {[x: string]: any};\n}\n\nexport interface ISearchSort {\n field: string;\n order: SortOrder;\n}\n\nexport interface ISidebarState {\n visible: boolean;\n type: SidebarContentType;\n}\n\nexport type SearchStateError = Override<\n GraphQLFormattedError,\n {\n extensions: GraphQLErrorExtensions & {\n record?: {\n id: string;\n library: string;\n };\n fields?: {\n [key: string]: string;\n };\n action?: PermissionsActions;\n };\n }\n>;\n\nexport interface ISearchState {\n library: ILibraryDetailExtended;\n records: ISearchRecord[];\n totalCount: number;\n errors?: readonly SearchStateError[];\n loading: boolean;\n pagination: number;\n offset: number;\n sort?: ISearchSort[];\n attributes: IAttribute[];\n trees: ILibraryDetailExtendedLinkedTree[];\n fields: IField[];\n fullText: string;\n filters: IFilter[];\n display: IViewDisplay;\n view: IViewState;\n userViewsOrder: string[];\n sharedViewsOrder: string[];\n lang: ILang;\n valuesVersions: IValueVersion;\n sideBar: ISidebarState;\n selection: ISearchSelection;\n showTransparency: boolean;\n mode: SearchMode;\n}\n\nexport interface IViewState {\n current: IView | null;\n reload: boolean;\n sync: boolean;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type GraphQLFormattedError } from 'graphql';
|
|
2
2
|
import { type IAttribute, type IField, type IFilter, type ISelectedRecord, SidebarContentType } from '../../../../types/search';
|
|
3
3
|
import { type IValueVersion } from '../../../../types/values';
|
|
4
4
|
import { type IView, type IViewDisplay } from '../../../../types/views';
|
|
@@ -37,7 +37,7 @@ export declare enum SearchActionTypes {
|
|
|
37
37
|
interface ISearchResult {
|
|
38
38
|
type: SearchActionTypes.UPDATE_RESULT;
|
|
39
39
|
records: ISearchRecord[];
|
|
40
|
-
errors?:
|
|
40
|
+
errors?: readonly GraphQLFormattedError[];
|
|
41
41
|
totalCount: number;
|
|
42
42
|
}
|
|
43
43
|
export type SearchAction = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchReducer.js","sourceRoot":"","sources":["../../../../../src/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,MAAM,2DAA2D,CAAC;AAC1F,OAAO,EAKH,UAAU,EACV,kBAAkB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAN,IAAY,iBA8BX;AA9BD,WAAY,iBAAiB;IACzB,oDAA+B,CAAA;IAC/B,4CAAuB,CAAA;IACvB,sDAAiC,CAAA;IACjC,8CAAyB,CAAA;IACzB,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;IACrB,gDAA2B,CAAA;IAC3B,sDAAiC,CAAA;IACjC,8CAAyB,CAAA;IACzB,kDAA6B,CAAA;IAC7B,gDAA2B,CAAA;IAC3B,wDAAmC,CAAA;IACnC,oDAA+B,CAAA;IAC/B,gDAA2B,CAAA;IAC3B,kEAA6C,CAAA;IAC7C,sEAAiD,CAAA;IACjD,gDAA2B,CAAA;IAC3B,oDAA+B,CAAA;IAC/B,wDAAmC,CAAA;IACnC,sDAAiC,CAAA;IACjC,oDAA+B,CAAA;IAC/B,gEAA2C,CAAA;IAC3C,gEAA2C,CAAA;IAC3C,sDAAiC,CAAA;IACjC,gDAA2B,CAAA;IAC3B,oDAA+B,CAAA;IAC/B,wEAAmD,CAAA;IACnD,8CAAyB,CAAA;IACzB,wDAAmC,CAAA;AACvC,CAAC,EA9BW,iBAAiB,KAAjB,iBAAiB,QA8B5B;AAuCD,MAAM,CAAC,MAAM,kBAAkB,GAAiB;IAC5C,OAAO,EAAE,IAAI;I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AC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;wBACjE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;iBACrD;aACJ,CAAC;QACN,KAAK,iBAAiB,CAAC,UAAU;YAC7B,OAAO;gBACH,GAAG,KAAK;gBACR,SAAS,EAAE;oBACP,QAAQ,EAAE,EAAE;oBACZ,WAAW,EAAE,IAAI;iBACpB;aACJ,CAAC;QACN,KAAK,iBAAiB,CAAC,eAAe;YAClC,OAAO;gBACH,GAAG,KAAK;gBACR,SAAS,EAAE;oBACP,QAAQ,EAAE,EAAE;oBACZ,WAAW,EAAE,KAAK;iBACrB;aACJ,CAAC;QACN;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type GraphQLErrors} from '@apollo/client/errors';\nimport getFieldsFromView from '_ui/components/LibraryItemsList/helpers/getFieldsFromView';\nimport {\n type IAttribute,\n type IField,\n type IFilter,\n type ISelectedRecord,\n SearchMode,\n SidebarContentType,\n} from '_ui/types/search';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type IView, type IViewDisplay} from '_ui/types/views';\nimport {ViewSizes, ViewTypes} from '_ui/_gqlTypes';\nimport {defaultView} from '../../constants';\nimport {type ISearchRecord, type ISearchSort, type ISearchState} from './_types';\n\nexport enum SearchActionTypes {\n UPDATE_RESULT = 'UPDATE_RESULT',\n SET_ERROR = 'SET_ERROR',\n SET_PAGINATION = 'SET_PAGINATION',\n SET_OFFSET = 'SET_OFFSET',\n SET_LOADING = 'SET_LOADING',\n SET_SORT = 'SET_SORT',\n CANCEL_SORT = 'CANCEL_SORT',\n SET_ATTRIBUTES = 'SET_ATTRIBUTES',\n SET_FIELDS = 'SET_FIELDS',\n SET_FULLTEXT = 'SET_FULLTEXT',\n SET_FILTERS = 'SET_FILTERS',\n SET_VIEW_RELOAD = 'SET_VIEW_RELOAD',\n SET_VIEW_SYNC = 'SET_VIEW_SYNC',\n CHANGE_VIEW = 'CHANGE_VIEW',\n SET_USER_VIEWS_ORDER = 'SET_USER_VIEWS_ORDER',\n SET_SHARED_VIEWS_ORDER = 'SET_SHARED_VIEWS_ORDER',\n SET_DISPLAY = 'SET_DISPLAY',\n RESET_FILTERS = 'RESET_FILTERS',\n DISABLE_FILTERS = 'DISABLE_FILTERS',\n ENABLE_FILTERS = 'ENABLE_FILTERS',\n APPLY_FILTERS = 'APPLY_FILTERS',\n SET_VALUES_VERSIONS = 'SET_VALUES_VERSIONS',\n TOGGLE_TRANSPARENCY = 'TOGGLE_TRANSPARENCY',\n TOGGLE_SIDEBAR = 'TOGGLE_SIDEBAR',\n SET_SIDEBAR = 'SET_SIDEBAR',\n SET_SELECTION = 'SET_SELECTION',\n TOGGLE_RECORD_SELECTION = 'TOGGLE_RECORD_SELECTION',\n SELECT_ALL = 'SELECT_ALL',\n CLEAR_SELECTION = 'CLEAR_SELECTION',\n}\n\ninterface ISearchResult {\n type: SearchActionTypes.UPDATE_RESULT;\n records: ISearchRecord[];\n errors?: GraphQLErrors;\n totalCount: number;\n}\n\nexport type SearchAction =\n | ({type: SearchActionTypes.UPDATE_RESULT} & ISearchResult)\n | {type: SearchActionTypes.SET_PAGINATION; page: number}\n | {type: SearchActionTypes.SET_OFFSET; offset: number}\n | {type: SearchActionTypes.SET_LOADING; loading: boolean}\n | {type: SearchActionTypes.SET_SORT; sort: ISearchSort[]}\n | {type: SearchActionTypes.CANCEL_SORT}\n | {type: SearchActionTypes.SET_ATTRIBUTES; attributes: IAttribute[]}\n | {type: SearchActionTypes.SET_FIELDS; fields: IField[]}\n | {type: SearchActionTypes.SET_FULLTEXT; fullText: string}\n | {type: SearchActionTypes.SET_FILTERS; filters: IFilter[]}\n | {type: SearchActionTypes.SET_VIEW_RELOAD; reload: boolean}\n | {type: SearchActionTypes.SET_VIEW_SYNC; sync: boolean}\n | {type: SearchActionTypes.CHANGE_VIEW; view: IView}\n | {type: SearchActionTypes.SET_DISPLAY; display: IViewDisplay}\n | {type: SearchActionTypes.SET_USER_VIEWS_ORDER; userViewsOrder: string[]}\n | {type: SearchActionTypes.SET_SHARED_VIEWS_ORDER; sharedViewsOrder: string[]}\n | {type: SearchActionTypes.RESET_FILTERS}\n | {type: SearchActionTypes.DISABLE_FILTERS}\n | {type: SearchActionTypes.ENABLE_FILTERS}\n | {type: SearchActionTypes.APPLY_FILTERS}\n | {type: SearchActionTypes.SET_VALUES_VERSIONS; valuesVersions: IValueVersion}\n | {type: SearchActionTypes.TOGGLE_TRANSPARENCY}\n | {type: SearchActionTypes.TOGGLE_SIDEBAR}\n | {type: SearchActionTypes.SET_SIDEBAR; sidebarType: SidebarContentType; visible: boolean}\n | {type: SearchActionTypes.SET_SELECTION; selected: ISelectedRecord[]}\n | {type: SearchActionTypes.TOGGLE_RECORD_SELECTION; record: ISelectedRecord}\n | {type: SearchActionTypes.SELECT_ALL}\n | {type: SearchActionTypes.CLEAR_SELECTION};\n\nexport const initialSearchState: ISearchState = {\n library: null,\n errors: [],\n records: [],\n totalCount: 0,\n loading: false,\n pagination: 20,\n offset: 0,\n attributes: [],\n trees: [],\n fields: [],\n fullText: '',\n filters: [],\n display: {type: ViewTypes.list, size: ViewSizes.MEDIUM},\n view: {current: defaultView, reload: false, sync: true},\n userViewsOrder: [],\n sharedViewsOrder: [],\n valuesVersions: {},\n lang: null,\n sideBar: {\n visible: false,\n type: SidebarContentType.FILTERS,\n },\n selection: {\n selected: [],\n allSelected: false,\n },\n showTransparency: false,\n mode: SearchMode.SEARCH,\n};\n\nconst checkSync = (\n state: ISearchState,\n toCheck: {sort: boolean; filters: boolean; display: boolean; fields: boolean; valuesVersions: boolean},\n): boolean => {\n let isSync = true;\n\n if (toCheck.sort) {\n isSync = JSON.stringify(state.sort) === JSON.stringify(state.view.current?.sort);\n }\n\n if (toCheck.filters) {\n isSync = isSync && JSON.stringify(state.view.current?.filters) === JSON.stringify(state.filters);\n }\n\n if (toCheck.display) {\n isSync =\n isSync &&\n state.display.type === state.view.current?.display?.type &&\n state.display.size === state.view.current?.display?.size;\n }\n\n if (toCheck.fields) {\n const viewFieldsKeys = state.view.current.attributes ?? [];\n\n isSync = isSync && state.fields.map(f => f.id).join('.') === viewFieldsKeys.join('.');\n }\n\n return isSync;\n};\n\nconst searchReducer = (state: ISearchState, action: SearchAction): ISearchState => {\n let isSync = checkSync(state, {\n sort: action.type !== SearchActionTypes.SET_SORT,\n filters: action.type !== SearchActionTypes.SET_FILTERS,\n display: action.type !== SearchActionTypes.SET_DISPLAY,\n fields: action.type !== SearchActionTypes.SET_FIELDS,\n valuesVersions: action.type !== SearchActionTypes.SET_VALUES_VERSIONS,\n });\n\n switch (action.type) {\n case SearchActionTypes.UPDATE_RESULT: {\n return {\n ...state,\n records: action.records ?? state.records,\n totalCount: action.totalCount ?? state.totalCount,\n errors: action.errors ?? [],\n loading: false,\n };\n }\n case SearchActionTypes.SET_PAGINATION:\n return {...state, pagination: action.page, loading: true};\n case SearchActionTypes.SET_OFFSET:\n return {...state, offset: action.offset, loading: true};\n case SearchActionTypes.SET_LOADING:\n return {...state, loading: action.loading};\n case SearchActionTypes.SET_SORT:\n isSync = isSync && JSON.stringify(state.view.current.sort) === JSON.stringify(action.sort);\n\n return {...state, sort: action.sort, view: {...state.view, sync: isSync}};\n case SearchActionTypes.CANCEL_SORT:\n const {sort, ...newState} = state;\n\n isSync = isSync && typeof state.view.current.sort === 'undefined';\n\n return {...newState, view: {...state.view, sync: isSync}, loading: true};\n case SearchActionTypes.SET_ATTRIBUTES:\n return {...state, attributes: action.attributes};\n case SearchActionTypes.SET_FIELDS:\n const viewFieldsKeys = state.view.current.attributes ?? [];\n\n isSync = isSync && action.fields.map(f => f.id).join('.') === viewFieldsKeys.join('.');\n\n return {...state, fields: action.fields, view: {...state.view, sync: isSync}, loading: true};\n case SearchActionTypes.SET_FULLTEXT:\n return {...state, fullText: action.fullText};\n case SearchActionTypes.SET_FILTERS:\n isSync = isSync && JSON.stringify(state.view.current.filters) === JSON.stringify(action.filters);\n return {...state, filters: action.filters, view: {...state.view, sync: isSync}};\n case SearchActionTypes.CHANGE_VIEW:\n return {\n ...state,\n view: {\n current: action.view,\n reload: true,\n sync: true,\n },\n fields: getFieldsFromView(action.view, state.library, state.lang),\n filters: action.view.filters,\n sort: action.view.sort,\n display: action.view.display,\n valuesVersions: action.view.valuesVersions,\n };\n case SearchActionTypes.SET_VIEW_RELOAD:\n return {...state, view: {...state.view, reload: action.reload}};\n case SearchActionTypes.SET_VIEW_SYNC:\n return {...state, view: {...state.view, sync: action.sync}};\n case SearchActionTypes.SET_DISPLAY:\n isSync =\n isSync &&\n action.display.type === state.view.current.display.type &&\n action.display.size === state.view.current.display.size;\n return {...state, display: action.display, view: {...state.view, sync: isSync}};\n case SearchActionTypes.SET_USER_VIEWS_ORDER:\n return {...state, userViewsOrder: action.userViewsOrder};\n case SearchActionTypes.SET_SHARED_VIEWS_ORDER:\n return {...state, sharedViewsOrder: action.sharedViewsOrder};\n case SearchActionTypes.RESET_FILTERS:\n return {...state, filters: [], loading: true};\n case SearchActionTypes.DISABLE_FILTERS:\n return {\n ...state,\n filters: state.filters.map(f => ({...f, active: false})),\n loading: true,\n };\n case SearchActionTypes.ENABLE_FILTERS:\n return {\n ...state,\n filters: state.filters.map(f => ({...f, active: true})),\n loading: true,\n };\n case SearchActionTypes.APPLY_FILTERS:\n // Reset pagination when applying filters as this may lead to unexpected behavior\n // if new filters return less results\n return {\n ...state,\n offset: 0,\n loading: true,\n };\n case SearchActionTypes.SET_VALUES_VERSIONS: {\n isSync =\n isSync && JSON.stringify(state.view.current.valuesVersions) === JSON.stringify(action.valuesVersions);\n return {\n ...state,\n view: {...state.view, sync: isSync},\n valuesVersions: {...state.valuesVersions, ...action.valuesVersions},\n };\n }\n case SearchActionTypes.TOGGLE_TRANSPARENCY:\n return {...state, showTransparency: !state.showTransparency};\n case SearchActionTypes.TOGGLE_SIDEBAR:\n return {...state, sideBar: {...state.sideBar, visible: !state.sideBar.visible}};\n case SearchActionTypes.SET_SIDEBAR:\n return {...state, sideBar: {...state.sideBar, type: action.sidebarType, visible: action.visible}};\n case SearchActionTypes.SET_SELECTION:\n return {...state, selection: {...state.selection, selected: action.selected, allSelected: false}};\n case SearchActionTypes.TOGGLE_RECORD_SELECTION:\n const currentlySelected = state.selection.selected.findIndex(s => s.id === action.record.id) > -1;\n\n return {\n ...state,\n selection: {\n ...state.selection,\n selected: currentlySelected\n ? state.selection.selected.filter(s => s.id !== action.record.id)\n : [...state.selection.selected, action.record],\n },\n };\n case SearchActionTypes.SELECT_ALL:\n return {\n ...state,\n selection: {\n selected: [],\n allSelected: true,\n },\n };\n case SearchActionTypes.CLEAR_SELECTION:\n return {\n ...state,\n selection: {\n selected: [],\n allSelected: false,\n },\n };\n default:\n return state;\n }\n};\n\nexport default searchReducer;\n"]}
|
|
1
|
+
{"version":3,"file":"searchReducer.js","sourceRoot":"","sources":["../../../../../src/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,MAAM,2DAA2D,CAAC;AAC1F,OAAO,EAKH,UAAU,EACV,kBAAkB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAN,IAAY,iBA8BX;AA9BD,WAAY,iBAAiB;IACzB,oDAA+B,CAAA;IAC/B,4CAAuB,CAAA;IACvB,sDAAiC,CAAA;IACjC,8CAAyB,CAAA;IACzB,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;I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11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type GraphQLFormattedError} from 'graphql';\nimport getFieldsFromView from '_ui/components/LibraryItemsList/helpers/getFieldsFromView';\nimport {\n type IAttribute,\n type IField,\n type IFilter,\n type ISelectedRecord,\n SearchMode,\n SidebarContentType,\n} from '_ui/types/search';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type IView, type IViewDisplay} from '_ui/types/views';\nimport {ViewSizes, ViewTypes} from '_ui/_gqlTypes';\nimport {defaultView} from '../../constants';\nimport {type SearchStateError, type ISearchRecord, type ISearchSort, type ISearchState} from './_types';\n\nexport enum SearchActionTypes {\n UPDATE_RESULT = 'UPDATE_RESULT',\n SET_ERROR = 'SET_ERROR',\n SET_PAGINATION = 'SET_PAGINATION',\n SET_OFFSET = 'SET_OFFSET',\n SET_LOADING = 'SET_LOADING',\n SET_SORT = 'SET_SORT',\n CANCEL_SORT = 'CANCEL_SORT',\n SET_ATTRIBUTES = 'SET_ATTRIBUTES',\n SET_FIELDS = 'SET_FIELDS',\n SET_FULLTEXT = 'SET_FULLTEXT',\n SET_FILTERS = 'SET_FILTERS',\n SET_VIEW_RELOAD = 'SET_VIEW_RELOAD',\n SET_VIEW_SYNC = 'SET_VIEW_SYNC',\n CHANGE_VIEW = 'CHANGE_VIEW',\n SET_USER_VIEWS_ORDER = 'SET_USER_VIEWS_ORDER',\n SET_SHARED_VIEWS_ORDER = 'SET_SHARED_VIEWS_ORDER',\n SET_DISPLAY = 'SET_DISPLAY',\n RESET_FILTERS = 'RESET_FILTERS',\n DISABLE_FILTERS = 'DISABLE_FILTERS',\n ENABLE_FILTERS = 'ENABLE_FILTERS',\n APPLY_FILTERS = 'APPLY_FILTERS',\n SET_VALUES_VERSIONS = 'SET_VALUES_VERSIONS',\n TOGGLE_TRANSPARENCY = 'TOGGLE_TRANSPARENCY',\n TOGGLE_SIDEBAR = 'TOGGLE_SIDEBAR',\n SET_SIDEBAR = 'SET_SIDEBAR',\n SET_SELECTION = 'SET_SELECTION',\n TOGGLE_RECORD_SELECTION = 'TOGGLE_RECORD_SELECTION',\n SELECT_ALL = 'SELECT_ALL',\n CLEAR_SELECTION = 'CLEAR_SELECTION',\n}\n\ninterface ISearchResult {\n type: SearchActionTypes.UPDATE_RESULT;\n records: ISearchRecord[];\n errors?: readonly GraphQLFormattedError[];\n totalCount: number;\n}\n\nexport type SearchAction =\n | ({type: SearchActionTypes.UPDATE_RESULT} & ISearchResult)\n | {type: SearchActionTypes.SET_PAGINATION; page: number}\n | {type: SearchActionTypes.SET_OFFSET; offset: number}\n | {type: SearchActionTypes.SET_LOADING; loading: boolean}\n | {type: SearchActionTypes.SET_SORT; sort: ISearchSort[]}\n | {type: SearchActionTypes.CANCEL_SORT}\n | {type: SearchActionTypes.SET_ATTRIBUTES; attributes: IAttribute[]}\n | {type: SearchActionTypes.SET_FIELDS; fields: IField[]}\n | {type: SearchActionTypes.SET_FULLTEXT; fullText: string}\n | {type: SearchActionTypes.SET_FILTERS; filters: IFilter[]}\n | {type: SearchActionTypes.SET_VIEW_RELOAD; reload: boolean}\n | {type: SearchActionTypes.SET_VIEW_SYNC; sync: boolean}\n | {type: SearchActionTypes.CHANGE_VIEW; view: IView}\n | {type: SearchActionTypes.SET_DISPLAY; display: IViewDisplay}\n | {type: SearchActionTypes.SET_USER_VIEWS_ORDER; userViewsOrder: string[]}\n | {type: SearchActionTypes.SET_SHARED_VIEWS_ORDER; sharedViewsOrder: string[]}\n | {type: SearchActionTypes.RESET_FILTERS}\n | {type: SearchActionTypes.DISABLE_FILTERS}\n | {type: SearchActionTypes.ENABLE_FILTERS}\n | {type: SearchActionTypes.APPLY_FILTERS}\n | {type: SearchActionTypes.SET_VALUES_VERSIONS; valuesVersions: IValueVersion}\n | {type: SearchActionTypes.TOGGLE_TRANSPARENCY}\n | {type: SearchActionTypes.TOGGLE_SIDEBAR}\n | {type: SearchActionTypes.SET_SIDEBAR; sidebarType: SidebarContentType; visible: boolean}\n | {type: SearchActionTypes.SET_SELECTION; selected: ISelectedRecord[]}\n | {type: SearchActionTypes.TOGGLE_RECORD_SELECTION; record: ISelectedRecord}\n | {type: SearchActionTypes.SELECT_ALL}\n | {type: SearchActionTypes.CLEAR_SELECTION};\n\nexport const initialSearchState: ISearchState = {\n library: null,\n errors: [],\n records: [],\n totalCount: 0,\n loading: false,\n pagination: 20,\n offset: 0,\n attributes: [],\n trees: [],\n fields: [],\n fullText: '',\n filters: [],\n display: {type: ViewTypes.list, size: ViewSizes.MEDIUM},\n view: {current: defaultView, reload: false, sync: true},\n userViewsOrder: [],\n sharedViewsOrder: [],\n valuesVersions: {},\n lang: null,\n sideBar: {\n visible: false,\n type: SidebarContentType.FILTERS,\n },\n selection: {\n selected: [],\n allSelected: false,\n },\n showTransparency: false,\n mode: SearchMode.SEARCH,\n};\n\nconst checkSync = (\n state: ISearchState,\n toCheck: {sort: boolean; filters: boolean; display: boolean; fields: boolean; valuesVersions: boolean},\n): boolean => {\n let isSync = true;\n\n if (toCheck.sort) {\n isSync = JSON.stringify(state.sort) === JSON.stringify(state.view.current?.sort);\n }\n\n if (toCheck.filters) {\n isSync = isSync && JSON.stringify(state.view.current?.filters) === JSON.stringify(state.filters);\n }\n\n if (toCheck.display) {\n isSync =\n isSync &&\n state.display.type === state.view.current?.display?.type &&\n state.display.size === state.view.current?.display?.size;\n }\n\n if (toCheck.fields) {\n const viewFieldsKeys = state.view.current.attributes ?? [];\n\n isSync = isSync && state.fields.map(f => f.id).join('.') === viewFieldsKeys.join('.');\n }\n\n return isSync;\n};\n\nconst searchReducer = (state: ISearchState, action: SearchAction): ISearchState => {\n let isSync = checkSync(state, {\n sort: action.type !== SearchActionTypes.SET_SORT,\n filters: action.type !== SearchActionTypes.SET_FILTERS,\n display: action.type !== SearchActionTypes.SET_DISPLAY,\n fields: action.type !== SearchActionTypes.SET_FIELDS,\n valuesVersions: action.type !== SearchActionTypes.SET_VALUES_VERSIONS,\n });\n\n switch (action.type) {\n case SearchActionTypes.UPDATE_RESULT: {\n return {\n ...state,\n records: action.records ?? state.records,\n totalCount: action.totalCount ?? state.totalCount,\n errors: (action.errors as SearchStateError[]) ?? [],\n loading: false,\n };\n }\n case SearchActionTypes.SET_PAGINATION:\n return {...state, pagination: action.page, loading: true};\n case SearchActionTypes.SET_OFFSET:\n return {...state, offset: action.offset, loading: true};\n case SearchActionTypes.SET_LOADING:\n return {...state, loading: action.loading};\n case SearchActionTypes.SET_SORT:\n isSync = isSync && JSON.stringify(state.view.current.sort) === JSON.stringify(action.sort);\n\n return {...state, sort: action.sort, view: {...state.view, sync: isSync}};\n case SearchActionTypes.CANCEL_SORT:\n const {sort, ...newState} = state;\n\n isSync = isSync && typeof state.view.current.sort === 'undefined';\n\n return {...newState, view: {...state.view, sync: isSync}, loading: true};\n case SearchActionTypes.SET_ATTRIBUTES:\n return {...state, attributes: action.attributes};\n case SearchActionTypes.SET_FIELDS:\n const viewFieldsKeys = state.view.current.attributes ?? [];\n\n isSync = isSync && action.fields.map(f => f.id).join('.') === viewFieldsKeys.join('.');\n\n return {...state, fields: action.fields, view: {...state.view, sync: isSync}, loading: true};\n case SearchActionTypes.SET_FULLTEXT:\n return {...state, fullText: action.fullText};\n case SearchActionTypes.SET_FILTERS:\n isSync = isSync && JSON.stringify(state.view.current.filters) === JSON.stringify(action.filters);\n return {...state, filters: action.filters, view: {...state.view, sync: isSync}};\n case SearchActionTypes.CHANGE_VIEW:\n return {\n ...state,\n view: {\n current: action.view,\n reload: true,\n sync: true,\n },\n fields: getFieldsFromView(action.view, state.library, state.lang),\n filters: action.view.filters,\n sort: action.view.sort,\n display: action.view.display,\n valuesVersions: action.view.valuesVersions,\n };\n case SearchActionTypes.SET_VIEW_RELOAD:\n return {...state, view: {...state.view, reload: action.reload}};\n case SearchActionTypes.SET_VIEW_SYNC:\n return {...state, view: {...state.view, sync: action.sync}};\n case SearchActionTypes.SET_DISPLAY:\n isSync =\n isSync &&\n action.display.type === state.view.current.display.type &&\n action.display.size === state.view.current.display.size;\n return {...state, display: action.display, view: {...state.view, sync: isSync}};\n case SearchActionTypes.SET_USER_VIEWS_ORDER:\n return {...state, userViewsOrder: action.userViewsOrder};\n case SearchActionTypes.SET_SHARED_VIEWS_ORDER:\n return {...state, sharedViewsOrder: action.sharedViewsOrder};\n case SearchActionTypes.RESET_FILTERS:\n return {...state, filters: [], loading: true};\n case SearchActionTypes.DISABLE_FILTERS:\n return {\n ...state,\n filters: state.filters.map(f => ({...f, active: false})),\n loading: true,\n };\n case SearchActionTypes.ENABLE_FILTERS:\n return {\n ...state,\n filters: state.filters.map(f => ({...f, active: true})),\n loading: true,\n };\n case SearchActionTypes.APPLY_FILTERS:\n // Reset pagination when applying filters as this may lead to unexpected behavior\n // if new filters return less results\n return {\n ...state,\n offset: 0,\n loading: true,\n };\n case SearchActionTypes.SET_VALUES_VERSIONS: {\n isSync =\n isSync && JSON.stringify(state.view.current.valuesVersions) === JSON.stringify(action.valuesVersions);\n return {\n ...state,\n view: {...state.view, sync: isSync},\n valuesVersions: {...state.valuesVersions, ...action.valuesVersions},\n };\n }\n case SearchActionTypes.TOGGLE_TRANSPARENCY:\n return {...state, showTransparency: !state.showTransparency};\n case SearchActionTypes.TOGGLE_SIDEBAR:\n return {...state, sideBar: {...state.sideBar, visible: !state.sideBar.visible}};\n case SearchActionTypes.SET_SIDEBAR:\n return {...state, sideBar: {...state.sideBar, type: action.sidebarType, visible: action.visible}};\n case SearchActionTypes.SET_SELECTION:\n return {...state, selection: {...state.selection, selected: action.selected, allSelected: false}};\n case SearchActionTypes.TOGGLE_RECORD_SELECTION:\n const currentlySelected = state.selection.selected.findIndex(s => s.id === action.record.id) > -1;\n\n return {\n ...state,\n selection: {\n ...state.selection,\n selected: currentlySelected\n ? state.selection.selected.filter(s => s.id !== action.record.id)\n : [...state.selection.selected, action.record],\n },\n };\n case SearchActionTypes.SELECT_ALL:\n return {\n ...state,\n selection: {\n selected: [],\n allSelected: true,\n },\n };\n case SearchActionTypes.CLEAR_SELECTION:\n return {\n ...state,\n selection: {\n selected: [],\n allSelected: false,\n },\n };\n default:\n return state;\n }\n};\n\nexport default searchReducer;\n"]}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export declare const useNotificationsSubscription: () =>
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare const useNotificationsSubscription: () => {
|
|
2
|
+
restart: () => void;
|
|
3
|
+
loading: boolean;
|
|
4
|
+
data?: import("../../../_gqlTypes").NotificationSubscription;
|
|
5
|
+
error?: import("@apollo/client").ApolloError;
|
|
6
|
+
variables?: import("../../../_gqlTypes").Exact<{
|
|
7
|
+
[key: string]: never;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
4
10
|
export default useNotificationsSubscription;
|
|
@@ -162,6 +162,6 @@ export const EditRecord = ({ antdForm, formId, isFormCreationMode, formElementId
|
|
|
162
162
|
return saveValues(record, valuesToSave, version, true);
|
|
163
163
|
};
|
|
164
164
|
const shouldUseLayoutWithSidebar = state.enableSidebar && state.isOpenSidebar && sidebarContainer === undefined;
|
|
165
|
-
return (_jsx(ErrorBoundary, { children: _jsx(EditRecordReducerContext.Provider, { value: { state, dispatch }, children: _jsxs(Container, { "$shouldUseLayoutWithSidebar": shouldUseLayoutWithSidebar, style: containerStyle, children: [_jsx(EditRecordButtons, {}), _jsx(Content, { "$shouldUseLayoutWithSidebar": shouldUseLayoutWithSidebar, "$removePadding": removePadding, children: permissionsLoading ? (_jsx(EditRecordSkeleton, { rows: 5 })) : canEdit ? (_jsx(EditRecordContent, { antdForm: antdForm, formId: formId, isFormCreationMode: isFormCreationMode, formElementId: formElementId, record: record, library: libraryId, onRecordSubmit: _handleRecordSubmit, onValueSubmit: _handleValueSubmit, onValueDelete: deleteValue, onDeleteMultipleValues: _handleDeleteAllValues, readonly: isReadOnly })) : (_jsx(ErrorDisplay, { type: ErrorDisplayTypes.PERMISSION_ERROR, showActionButton: false })) }), _jsx(EditRecordSidebar, { onMetadataSubmit: _handleMetadataSubmit, sidebarContainer: sidebarContainer })] }) }) }));
|
|
165
|
+
return (_jsx(ErrorBoundary, { children: _jsx(EditRecordReducerContext.Provider, { value: { state, dispatch }, children: _jsxs(Container, { "$shouldUseLayoutWithSidebar": shouldUseLayoutWithSidebar, style: containerStyle, children: [_jsx(EditRecordButtons, {}), _jsx(Content, { className: "edit-record-content-container", "$shouldUseLayoutWithSidebar": shouldUseLayoutWithSidebar, "$removePadding": removePadding, children: permissionsLoading ? (_jsx(EditRecordSkeleton, { rows: 5 })) : canEdit ? (_jsx(EditRecordContent, { antdForm: antdForm, formId: formId, isFormCreationMode: isFormCreationMode, formElementId: formElementId, record: record, library: libraryId, onRecordSubmit: _handleRecordSubmit, onValueSubmit: _handleValueSubmit, onValueDelete: deleteValue, onDeleteMultipleValues: _handleDeleteAllValues, readonly: isReadOnly })) : (_jsx(ErrorDisplay, { type: ErrorDisplayTypes.PERMISSION_ERROR, showActionButton: false })) }), _jsx(EditRecordSidebar, { onMetadataSubmit: _handleMetadataSubmit, sidebarContainer: sidebarContainer })] }) }) }));
|
|
166
166
|
};
|
|
167
167
|
//# sourceMappingURL=EditRecord.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecord.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecord/EditRecord.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAyB,SAAS,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AACpE,OAAO,MAAwB,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EACH,aAAa,EAGb,4BAA4B,GAC/B,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAC,aAAa,E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BAA0B,GAAG,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,aAAa,IAAI,gBAAgB,KAAK,SAAS,CAAC;IAEhH,OAAO,CACH,KAAC,aAAa,cACV,KAAC,wBAAwB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAC,YACvD,MAAC,SAAS,mCAA8B,0BAA0B,EAAE,KAAK,EAAE,cAAc,aACrF,KAAC,iBAAiB,KAAG,EACrB,KAAC,OAAO,mCAA8B,0BAA0B,oBAAkB,aAAa,YAC1F,kBAAkB,CAAC,CAAC,CAAC,CAClB,KAAC,kBAAkB,IAAC,IAAI,EAAE,CAAC,GAAI,CAClC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACV,KAAC,iBAAiB,IACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,SAAS,EAClB,cAAc,EAAE,mBAAmB,EACnC,aAAa,EAAE,kBAAkB,EACjC,aAAa,EAAE,WAAW,EAC1B,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,EAAE,UAAU,GACtB,CACL,CAAC,CAAC,CAAC,CACA,KAAC,YAAY,IAAC,IAAI,EAAE,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,GAAI,CACtF,GACK,EACV,KAAC,iBAAiB,IAAC,gBAAgB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,gBAAgB,GAAI,IAC1F,GACoB,GACxB,CACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport isEqual from 'lodash/isEqual';\nimport {type FunctionComponent, useEffect, useReducer} from 'react';\nimport styled, {type CSSObject} from 'styled-components';\nimport {ErrorDisplayTypes} from '../../../constants';\nimport {useCanEditRecord} from '../../../hooks/useCanEditRecord';\nimport {type IValueVersion} from '../../../types/values';\nimport {\n AttributeType,\n type RecordFormAttributeStandardAttributeFragment,\n type RecordIdentityFragment,\n useActivateNewRecordMutation,\n} from '../../../_gqlTypes';\nimport {\n type IRecordPropertyLink,\n type IRecordPropertyStandard,\n type IRecordPropertyTree,\n} from '../../../_queries/records/getRecordPropertiesQuery';\nimport {ErrorBoundary} from '../../ErrorBoundary';\nimport {ErrorDisplay} from '../../ErrorDisplay';\nimport EditRecordContent from '../EditRecordContent';\nimport useExecuteDeleteValueMutation from '../EditRecordContent/hooks/useExecuteDeleteValueMutation';\nimport useSaveValueBatchMutation from '../EditRecordContent/hooks/useExecuteSaveValueBatchMutation';\nimport {\n type DeleteMultipleValuesFunc,\n type ISubmittedValueLink,\n type ISubmittedValueStandard,\n type ISubmittedValueTree,\n type IValueToSubmit,\n type MetadataSubmitValueFunc,\n type SubmitValueFunc,\n} from '../EditRecordContent/_types';\nimport editRecordReducer, {EditRecordReducerActionsTypes, initialState} from '../editRecordReducer/editRecordReducer';\nimport {EditRecordReducerContext} from '../editRecordReducer/editRecordReducerContext';\nimport {type FormInstance} from 'antd/lib/form/Form';\nimport EditRecordSidebar from '../EditRecordSidebar';\nimport EditRecordSkeleton from '../EditRecordSkeleton';\nimport {useQuery} from '@apollo/client';\nimport {getLibraryByIdQuery} from '_ui/_queries/libraries/getLibraryByIdQuery';\nimport EditRecordButtons from '../EditRecordButtons';\n\ninterface IEditRecordProps {\n antdForm: FormInstance;\n formId: string;\n isFormCreationMode: boolean;\n formElementId?: string;\n record: RecordIdentityFragment['whoAmI'] | null;\n library: string;\n onCreate?: (newRecord: RecordIdentityFragment['whoAmI']) => void;\n valuesVersion?: IValueVersion;\n showSidebar?: boolean;\n enableSidebar?: boolean;\n sidebarContainer?: HTMLElement;\n containerStyle?: CSSObject;\n withInfoButton: boolean;\n removePadding?: boolean; // TODO: This prop should be remove when EditRecord will be moved to app-studio or data-studio deleted\n}\n\nconst sidebarWidth = '352px';\n\nconst Container = styled.div<{$shouldUseLayoutWithSidebar: boolean; style: CSSObject}>`\n display: grid;\n grid-template-columns: ${props => (props.$shouldUseLayoutWithSidebar ? `minmax(0, auto) ${sidebarWidth}` : '1fr')};\n grid-template-areas: ${props => (props.$shouldUseLayoutWithSidebar ? '\"content sidebar\"' : '\"content\"')};\n overflow: hidden;\n`;\n\nconst Content = styled.div<{$shouldUseLayoutWithSidebar: boolean; $removePadding: boolean}>`\n grid-area: content;\n padding: ${props => (props.$removePadding ? 'unset' : '24px')};\n overflow-x: hidden;\n overflow-y: scroll;\n border-right: ${props =>\n props.$shouldUseLayoutWithSidebar ? '1px solid var(--general-utilities-border)' : 'none'};\n`;\n\nexport const EditRecord: FunctionComponent<IEditRecordProps> = ({\n antdForm,\n formId,\n isFormCreationMode,\n formElementId,\n record,\n library: libraryId,\n onCreate,\n valuesVersion,\n enableSidebar = false,\n showSidebar = false,\n sidebarContainer,\n containerStyle,\n withInfoButton,\n removePadding = false,\n}) => {\n const [state, dispatch] = useReducer(editRecordReducer, {\n ...initialState,\n record,\n libraryId,\n libraryLabel: null,\n valuesVersion,\n originValuesVersion: valuesVersion,\n withInfoButton,\n });\n\n const {\n loading: permissionsLoading,\n canEdit,\n isReadOnly,\n } = useCanEditRecord({...record?.library, id: libraryId}, record?.id);\n\n const {data: libraryData} = useQuery(getLibraryByIdQuery, {\n variables: {id: [libraryId]},\n });\n\n const {saveValues} = useSaveValueBatchMutation();\n const {deleteValue} = useExecuteDeleteValueMutation(record);\n const [activateNewRecordMutation] = useActivateNewRecordMutation();\n\n // Update record in reducer when it changes. Might happen on record identity change (after value save)\n useEffect(() => {\n if (libraryData) {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_LIBRARY_LABEL,\n label: libraryData.libraries.list[0].label,\n });\n }\n }, [libraryData]);\n\n useEffect(() => {\n if (record && !isEqual(record, state.record)) {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_RECORD,\n record,\n });\n }\n }, [record]);\n\n useEffect(() => {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_ENABLE_SIDEBAR,\n enabled: enableSidebar,\n });\n }, [enableSidebar]);\n\n useEffect(() => {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_SIDEBAR_IS_OPEN,\n isOpen: showSidebar,\n });\n }, [showSidebar]);\n\n const _handleValueSubmit: SubmitValueFunc = async (values, version) =>\n saveValues(\n record,\n values.map(val => {\n const savableValue = {...val, attribute: val.attribute.id, metadata: val.metadata};\n\n if (val.value) {\n switch (val.attribute.type) {\n case AttributeType.advanced_link:\n case AttributeType.simple_link:\n savableValue.value = (val as ISubmittedValueLink).value.id;\n break;\n case AttributeType.tree:\n savableValue.value = (val as ISubmittedValueTree).value.id;\n break;\n default:\n savableValue.value = (val as ISubmittedValueStandard).value;\n break;\n }\n }\n\n return savableValue as IValueToSubmit;\n }),\n version,\n true, // deleteEmpty\n );\n\n const _handleMetadataSubmit: MetadataSubmitValueFunc = (value, attribute, metadata) => {\n let valueContent;\n switch (attribute.type) {\n case AttributeType.simple:\n case AttributeType.advanced:\n valueContent = (value as IRecordPropertyStandard).raw_payload;\n break;\n case AttributeType.advanced_link:\n case AttributeType.simple_link:\n valueContent = (value as IRecordPropertyLink).linkValue;\n break;\n case AttributeType.tree:\n valueContent = (value as IRecordPropertyTree).treeValue;\n break;\n }\n\n return _handleValueSubmit(\n [\n {\n idValue: value.id_value,\n attribute,\n value: valueContent,\n metadata,\n },\n ],\n null,\n );\n };\n\n /**\n * Submit the whole record: create record and batch save all stored values\n */\n const _handleRecordSubmit = async (attributes: RecordFormAttributeStandardAttributeFragment[]) => {\n const activateNewRecordResult = await activateNewRecordMutation({\n fetchPolicy: 'network-only',\n variables: {\n libraryId,\n recordId: record.id,\n formId,\n },\n });\n const errors = activateNewRecordResult?.data?.activateNewRecord.valuesErrors;\n if (errors == null || errors?.length === 0) {\n if (onCreate) {\n onCreate(activateNewRecordResult?.data?.activateNewRecord?.record?.whoAmI);\n }\n return;\n }\n antdForm.setFields(\n errors.map(error => {\n const attributeInError = attributes.find(attribute => attribute.id === error.attribute);\n\n const doesAttributeHaveMultipleFields =\n attributeInError?.multiple_values &&\n ![AttributeType.simple_link, AttributeType.advanced_link].includes(attributeInError.type);\n\n return {\n name:\n doesAttributeHaveMultipleFields && error.type === 'REQUIRED_ATTRIBUTE'\n ? [error.attribute, 0]\n : error.attribute,\n errors: [error.message],\n };\n }),\n );\n };\n\n const _handleDeleteAllValues: DeleteMultipleValuesFunc = async (attribute, values, version) => {\n const valuesToSave = values.map(value => ({\n idValue: value.id_value,\n attribute,\n value: null,\n }));\n\n return saveValues(record, valuesToSave, version, true);\n };\n\n const shouldUseLayoutWithSidebar = state.enableSidebar && state.isOpenSidebar && sidebarContainer === undefined;\n\n return (\n <ErrorBoundary>\n <EditRecordReducerContext.Provider value={{state, dispatch}}>\n <Container $shouldUseLayoutWithSidebar={shouldUseLayoutWithSidebar} style={containerStyle}>\n <EditRecordButtons />\n <Content $shouldUseLayoutWithSidebar={shouldUseLayoutWithSidebar} $removePadding={removePadding}>\n {permissionsLoading ? (\n <EditRecordSkeleton rows={5} />\n ) : canEdit ? (\n <EditRecordContent\n antdForm={antdForm}\n formId={formId}\n isFormCreationMode={isFormCreationMode}\n formElementId={formElementId}\n record={record}\n library={libraryId}\n onRecordSubmit={_handleRecordSubmit}\n onValueSubmit={_handleValueSubmit}\n onValueDelete={deleteValue}\n onDeleteMultipleValues={_handleDeleteAllValues}\n readonly={isReadOnly}\n />\n ) : (\n <ErrorDisplay type={ErrorDisplayTypes.PERMISSION_ERROR} showActionButton={false} />\n )}\n </Content>\n <EditRecordSidebar onMetadataSubmit={_handleMetadataSubmit} sidebarContainer={sidebarContainer} />\n </Container>\n </EditRecordReducerContext.Provider>\n </ErrorBoundary>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"EditRecord.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition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CAAC,CACA,KAAC,YAAY,IAAC,IAAI,EAAE,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,GAAI,CACtF,GACK,EACV,KAAC,iBAAiB,IAAC,gBAAgB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,gBAAgB,GAAI,IAC1F,GACoB,GACxB,CACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport isEqual from 'lodash/isEqual';\nimport {type FunctionComponent, useEffect, useReducer} from 'react';\nimport styled, {type CSSObject} from 'styled-components';\nimport {ErrorDisplayTypes} from '../../../constants';\nimport {useCanEditRecord} from '../../../hooks/useCanEditRecord';\nimport {type IValueVersion} from '../../../types/values';\nimport {\n AttributeType,\n type RecordFormAttributeStandardAttributeFragment,\n type RecordIdentityFragment,\n useActivateNewRecordMutation,\n} from '../../../_gqlTypes';\nimport {\n type IRecordPropertyLink,\n type IRecordPropertyStandard,\n type IRecordPropertyTree,\n} from '../../../_queries/records/getRecordPropertiesQuery';\nimport {ErrorBoundary} from '../../ErrorBoundary';\nimport {ErrorDisplay} from '../../ErrorDisplay';\nimport EditRecordContent from '../EditRecordContent';\nimport useExecuteDeleteValueMutation from '../EditRecordContent/hooks/useExecuteDeleteValueMutation';\nimport useSaveValueBatchMutation from '../EditRecordContent/hooks/useExecuteSaveValueBatchMutation';\nimport {\n type DeleteMultipleValuesFunc,\n type ISubmittedValueLink,\n type ISubmittedValueStandard,\n type ISubmittedValueTree,\n type IValueToSubmit,\n type MetadataSubmitValueFunc,\n type SubmitValueFunc,\n} from '../EditRecordContent/_types';\nimport editRecordReducer, {EditRecordReducerActionsTypes, initialState} from '../editRecordReducer/editRecordReducer';\nimport {EditRecordReducerContext} from '../editRecordReducer/editRecordReducerContext';\nimport {type FormInstance} from 'antd/lib/form/Form';\nimport EditRecordSidebar from '../EditRecordSidebar';\nimport EditRecordSkeleton from '../EditRecordSkeleton';\nimport {useQuery} from '@apollo/client';\nimport {getLibraryByIdQuery} from '_ui/_queries/libraries/getLibraryByIdQuery';\nimport EditRecordButtons from '../EditRecordButtons';\n\ninterface IEditRecordProps {\n antdForm: FormInstance;\n formId: string;\n isFormCreationMode: boolean;\n formElementId?: string;\n record: RecordIdentityFragment['whoAmI'] | null;\n library: string;\n onCreate?: (newRecord: RecordIdentityFragment['whoAmI']) => void;\n valuesVersion?: IValueVersion;\n showSidebar?: boolean;\n enableSidebar?: boolean;\n sidebarContainer?: HTMLElement;\n containerStyle?: CSSObject;\n withInfoButton: boolean;\n removePadding?: boolean; // TODO: This prop should be remove when EditRecord will be moved to app-studio or data-studio deleted\n}\n\nconst sidebarWidth = '352px';\n\nconst Container = styled.div<{$shouldUseLayoutWithSidebar: boolean; style: CSSObject}>`\n display: grid;\n grid-template-columns: ${props => (props.$shouldUseLayoutWithSidebar ? `minmax(0, auto) ${sidebarWidth}` : '1fr')};\n grid-template-areas: ${props => (props.$shouldUseLayoutWithSidebar ? '\"content sidebar\"' : '\"content\"')};\n overflow: hidden;\n`;\n\nconst Content = styled.div<{$shouldUseLayoutWithSidebar: boolean; $removePadding: boolean}>`\n grid-area: content;\n padding: ${props => (props.$removePadding ? 'unset' : '24px')};\n overflow-x: hidden;\n overflow-y: scroll;\n border-right: ${props =>\n props.$shouldUseLayoutWithSidebar ? '1px solid var(--general-utilities-border)' : 'none'};\n`;\n\nexport const EditRecord: FunctionComponent<IEditRecordProps> = ({\n antdForm,\n formId,\n isFormCreationMode,\n formElementId,\n record,\n library: libraryId,\n onCreate,\n valuesVersion,\n enableSidebar = false,\n showSidebar = false,\n sidebarContainer,\n containerStyle,\n withInfoButton,\n removePadding = false,\n}) => {\n const [state, dispatch] = useReducer(editRecordReducer, {\n ...initialState,\n record,\n libraryId,\n libraryLabel: null,\n valuesVersion,\n originValuesVersion: valuesVersion,\n withInfoButton,\n });\n\n const {\n loading: permissionsLoading,\n canEdit,\n isReadOnly,\n } = useCanEditRecord({...record?.library, id: libraryId}, record?.id);\n\n const {data: libraryData} = useQuery(getLibraryByIdQuery, {\n variables: {id: [libraryId]},\n });\n\n const {saveValues} = useSaveValueBatchMutation();\n const {deleteValue} = useExecuteDeleteValueMutation(record);\n const [activateNewRecordMutation] = useActivateNewRecordMutation();\n\n // Update record in reducer when it changes. Might happen on record identity change (after value save)\n useEffect(() => {\n if (libraryData) {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_LIBRARY_LABEL,\n label: libraryData.libraries.list[0].label,\n });\n }\n }, [libraryData]);\n\n useEffect(() => {\n if (record && !isEqual(record, state.record)) {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_RECORD,\n record,\n });\n }\n }, [record]);\n\n useEffect(() => {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_ENABLE_SIDEBAR,\n enabled: enableSidebar,\n });\n }, [enableSidebar]);\n\n useEffect(() => {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_SIDEBAR_IS_OPEN,\n isOpen: showSidebar,\n });\n }, [showSidebar]);\n\n const _handleValueSubmit: SubmitValueFunc = async (values, version) =>\n saveValues(\n record,\n values.map(val => {\n const savableValue = {...val, attribute: val.attribute.id, metadata: val.metadata};\n\n if (val.value) {\n switch (val.attribute.type) {\n case AttributeType.advanced_link:\n case AttributeType.simple_link:\n savableValue.value = (val as ISubmittedValueLink).value.id;\n break;\n case AttributeType.tree:\n savableValue.value = (val as ISubmittedValueTree).value.id;\n break;\n default:\n savableValue.value = (val as ISubmittedValueStandard).value;\n break;\n }\n }\n\n return savableValue as IValueToSubmit;\n }),\n version,\n true, // deleteEmpty\n );\n\n const _handleMetadataSubmit: MetadataSubmitValueFunc = (value, attribute, metadata) => {\n let valueContent;\n switch (attribute.type) {\n case AttributeType.simple:\n case AttributeType.advanced:\n valueContent = (value as IRecordPropertyStandard).raw_payload;\n break;\n case AttributeType.advanced_link:\n case AttributeType.simple_link:\n valueContent = (value as IRecordPropertyLink).linkValue;\n break;\n case AttributeType.tree:\n valueContent = (value as IRecordPropertyTree).treeValue;\n break;\n }\n\n return _handleValueSubmit(\n [\n {\n idValue: value.id_value,\n attribute,\n value: valueContent,\n metadata,\n },\n ],\n null,\n );\n };\n\n /**\n * Submit the whole record: create record and batch save all stored values\n */\n const _handleRecordSubmit = async (attributes: RecordFormAttributeStandardAttributeFragment[]) => {\n const activateNewRecordResult = await activateNewRecordMutation({\n fetchPolicy: 'network-only',\n variables: {\n libraryId,\n recordId: record.id,\n formId,\n },\n });\n const errors = activateNewRecordResult?.data?.activateNewRecord.valuesErrors;\n if (errors == null || errors?.length === 0) {\n if (onCreate) {\n onCreate(activateNewRecordResult?.data?.activateNewRecord?.record?.whoAmI);\n }\n return;\n }\n antdForm.setFields(\n errors.map(error => {\n const attributeInError = attributes.find(attribute => attribute.id === error.attribute);\n\n const doesAttributeHaveMultipleFields =\n attributeInError?.multiple_values &&\n ![AttributeType.simple_link, AttributeType.advanced_link].includes(attributeInError.type);\n\n return {\n name:\n doesAttributeHaveMultipleFields && error.type === 'REQUIRED_ATTRIBUTE'\n ? [error.attribute, 0]\n : error.attribute,\n errors: [error.message],\n };\n }),\n );\n };\n\n const _handleDeleteAllValues: DeleteMultipleValuesFunc = async (attribute, values, version) => {\n const valuesToSave = values.map(value => ({\n idValue: value.id_value,\n attribute,\n value: null,\n }));\n\n return saveValues(record, valuesToSave, version, true);\n };\n\n const shouldUseLayoutWithSidebar = state.enableSidebar && state.isOpenSidebar && sidebarContainer === undefined;\n\n return (\n <ErrorBoundary>\n <EditRecordReducerContext.Provider value={{state, dispatch}}>\n <Container $shouldUseLayoutWithSidebar={shouldUseLayoutWithSidebar} style={containerStyle}>\n <EditRecordButtons />\n <Content\n className=\"edit-record-content-container\"\n $shouldUseLayoutWithSidebar={shouldUseLayoutWithSidebar}\n $removePadding={removePadding}\n >\n {permissionsLoading ? (\n <EditRecordSkeleton rows={5} />\n ) : canEdit ? (\n <EditRecordContent\n antdForm={antdForm}\n formId={formId}\n isFormCreationMode={isFormCreationMode}\n formElementId={formElementId}\n record={record}\n library={libraryId}\n onRecordSubmit={_handleRecordSubmit}\n onValueSubmit={_handleValueSubmit}\n onValueDelete={deleteValue}\n onDeleteMultipleValues={_handleDeleteAllValues}\n readonly={isReadOnly}\n />\n ) : (\n <ErrorDisplay type={ErrorDisplayTypes.PERMISSION_ERROR} showActionButton={false} />\n )}\n </Content>\n <EditRecordSidebar onMetadataSubmit={_handleMetadataSubmit} sidebarContainer={sidebarContainer} />\n </Container>\n </EditRecordReducerContext.Provider>\n </ErrorBoundary>\n );\n};\n"]}
|
|
@@ -2,4 +2,4 @@ import { type IGetLibraryDetailExtendedQuery, type IGetLibraryDetailExtendedVari
|
|
|
2
2
|
export interface IUseGetLibraryDetailExtendedQueryHookParams {
|
|
3
3
|
library: string;
|
|
4
4
|
}
|
|
5
|
-
export default function useGetLibraryDetailExtendedQuery({ library }: IUseGetLibraryDetailExtendedQueryHookParams): import("@apollo/client").
|
|
5
|
+
export default function useGetLibraryDetailExtendedQuery({ library }: IUseGetLibraryDetailExtendedQueryHookParams): import("@apollo/client").InteropQueryResult<IGetLibraryDetailExtendedQuery, IGetLibraryDetailExtendedVariables>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type RecordUpdateFilterInput } from '../../_gqlTypes';
|
|
2
|
-
export declare const useGetRecordUpdatesSubscription: (filters: RecordUpdateFilterInput, skip?: boolean) =>
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export declare const useGetRecordUpdatesSubscription: (filters: RecordUpdateFilterInput, skip?: boolean) => {
|
|
3
|
+
restart: () => void;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
data?: import("../../_gqlTypes").RecordUpdateSubscription;
|
|
6
|
+
error?: import("@apollo/client").ApolloError;
|
|
7
|
+
variables?: import("../../_gqlTypes").Exact<{
|
|
8
|
+
filters?: import("../../_gqlTypes").InputMaybe<RecordUpdateFilterInput>;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetRecordValuesQuery.js","sourceRoot":"","sources":["../../../src/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"useGetRecordValuesQuery.js","sourceRoot":"","sources":["../../../src/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AAEtE,OAAO,EAA2C,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAElF,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,qBAAqB,EAA0B,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAClG,OAAO,EACH,sBAAsB,GAIzB,MAAM,+CAA+C,CAAC;AAWvD,MAAM,wBAAwB,GAAG,CAAC,SAAmB,EAAuB,EAAE,CAC1E,SAAS,CAAC,MAAM,CAAC,CAAC,UAA+B,EAAE,QAAgB,EAAE,CAAS,EAAE,EAAE;IAC9E,IAAI,CAAC,EAAE,CAAC;QACJ,UAAU,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,oBAAoB,CAAC,EAAE,EAAC,CAAC,CAAC;IACzD,CAAC;IAED,UAAU,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAC,CAAC,CAAC;IAExF,OAAO,UAAU,CAAC;AACtB,CAAC,EAAE,EAAE,CAAC,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACnC,SAAiB,EACjB,OAAiB,EACjB,SAAmB,EACnB,IAAc,EACqB,EAAE;IACrC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,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AI,OAAO,SAAS,KAAK,SAAS;QACxD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,aAE+C;KAC3D,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\n\nimport {type ApolloQueryResult, type QueryResult, useQuery} from '@apollo/client';\nimport {type Override} from '@leav/utils';\nimport {useState} from 'react';\nimport {RecordFilterCondition, type RecordFilterInput, RecordFilterOperator} from '_ui/_gqlTypes';\nimport {\n getRecordColumnsValues,\n type GetRecordColumnsValuesRecord,\n type IGetRecordColumnsValues,\n type IGetRecordColumnsValuesVariables,\n} from '../../_queries/records/getRecordColumnsValues';\n\nexport interface IColumnsValuesByRecord {\n [recordId: string]: GetRecordColumnsValuesRecord;\n}\n\nexport type IUseGetRecordColumnsValuesQueryHook = Override<\n QueryResult<IGetRecordColumnsValues>,\n {data: IColumnsValuesByRecord}\n>;\n\nconst _recordIdsToQueryFilters = (recordIds: string[]): RecordFilterInput[] =>\n recordIds.reduce((allFilters: RecordFilterInput[], recordId: string, i: number) => {\n if (i) {\n allFilters.push({operator: RecordFilterOperator.OR});\n }\n\n allFilters.push({field: 'id', condition: RecordFilterCondition.EQUAL, value: recordId});\n\n return allFilters;\n }, []);\n\nexport const useGetRecordValuesQuery = (\n libraryId: string,\n columns: string[],\n recordIds: string[],\n skip?: boolean,\n): IUseGetRecordColumnsValuesQueryHook => {\n const [queryData, setQueryData] = useState<IColumnsValuesByRecord>();\n\n const _convertQueryResult = (queryResult: IGetRecordColumnsValues): IColumnsValuesByRecord =>\n (queryResult.records.list ?? []).reduce((valuesByRecord, recordValues) => {\n valuesByRecord[recordValues._id] = recordValues;\n return valuesByRecord;\n }, {});\n\n const query = useQuery<IGetRecordColumnsValues, IGetRecordColumnsValuesVariables>(getRecordColumnsValues(columns), {\n variables: {\n library: libraryId,\n // Turn records ids into filters with OR operators\n filters: _recordIdsToQueryFilters(recordIds),\n },\n skip: skip || !libraryId || !columns.length || !recordIds.length,\n onCompleted: data => {\n const cleanData: IColumnsValuesByRecord = _convertQueryResult(data);\n setQueryData(cleanData);\n },\n });\n\n const customRefetch = async (refetchRecordIds: string[]) => {\n const customVariables = {\n filters: _recordIdsToQueryFilters(refetchRecordIds ?? []),\n };\n\n const refetchData = await query.refetch(customVariables);\n\n const cleanData: IColumnsValuesByRecord = _convertQueryResult(refetchData.data);\n setQueryData({...queryData, ...cleanData});\n\n return refetchData;\n };\n\n // @ts-ignore\n return {\n ...query,\n loading: query.loading || typeof queryData === undefined,\n data: queryData,\n refetch: customRefetch as (\n variables?: Partial<IGetRecordColumnsValuesVariables>,\n ) => Promise<ApolloQueryResult<IGetRecordColumnsValues>>,\n };\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leav/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0-1",
|
|
4
4
|
"description": "Shared React components and hooks",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepublishOnly": "yarn build",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"license": "LGPL3",
|
|
25
25
|
"repository": "https://github.com/leav-solutions/leav-engine",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@apollo/client": "3.
|
|
27
|
+
"@apollo/client": "3.14.0",
|
|
28
28
|
"@babel/preset-env": "7.29.0",
|
|
29
29
|
"@babel/preset-react": "7.28.5",
|
|
30
30
|
"@graphql-codegen/add": "5.0.3",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@types/react": "18.2.14",
|
|
45
45
|
"@types/react-dom": "18.2.6",
|
|
46
46
|
"@types/react-table": "7.7.20",
|
|
47
|
-
"aristid-ds": "
|
|
47
|
+
"aristid-ds": "15.0.0-06322cf",
|
|
48
48
|
"babel-jest": "29.7.0",
|
|
49
49
|
"graphql": "16.12.0",
|
|
50
50
|
"i18next": "22.5.1",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@apollo/client": ">=3.8.1",
|
|
65
|
-
"aristid-ds": "
|
|
65
|
+
"aristid-ds": "15.0.0-06322cf",
|
|
66
66
|
"i18next": ">=22.5.1",
|
|
67
67
|
"react": "^18.2.0",
|
|
68
68
|
"react-dom": "^18.2.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@ant-design/icons": "5.6.1",
|
|
74
74
|
"@ckeditor/ckeditor5-build-inline": "39.0.2",
|
|
75
|
-
"@ckeditor/ckeditor5-react": "6.
|
|
75
|
+
"@ckeditor/ckeditor5-react": "6.3.0",
|
|
76
76
|
"@dnd-kit/core": "6.1.0",
|
|
77
77
|
"@dnd-kit/sortable": "8.0.0",
|
|
78
78
|
"@dnd-kit/utilities": "3.2.2",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@fortawesome/free-regular-svg-icons": "7.0.1",
|
|
81
81
|
"@fortawesome/free-solid-svg-icons": "7.0.1",
|
|
82
82
|
"@fortawesome/react-fontawesome": "3.0.2",
|
|
83
|
-
"@leav/utils": "1.
|
|
83
|
+
"@leav/utils": "1.9.0-1",
|
|
84
84
|
"@uidotdev/usehooks": "2.4.1",
|
|
85
85
|
"dayjs": "^1.11.13",
|
|
86
86
|
"dompurify": "3.2.4",
|