@datagouv/components-next 1.0.2-dev.17 → 1.0.2-dev.171
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/README.md +7 -6
- package/assets/main.css +4 -0
- package/dist/{Control-DuZJdKV_.js → Control-B9WQxlpJ.js} +1 -1
- package/dist/{Datafair.client-Ds3VQrRi.js → Datafair.client-B-OG5WtK.js} +4 -4
- package/dist/{Event--kp8kMdJ.js → Event-iXDrp-fy.js} +31 -31
- package/dist/{Image-34hvypZI.js → Image-mNMBOofs.js} +9 -9
- package/dist/ImagePreview.client-D0c-ifUi.js +36 -0
- package/dist/JsonPreview.client-Dwh9sW9M.js +40 -0
- package/dist/{Map-BjUnLyj8.js → Map-BfqKMw0S.js} +1739 -1599
- package/dist/{MapContainer.client-B2BijMx5.js → MapContainer.client-C2AZ7sOB.js} +38 -39
- package/dist/{OSM-s40W6sQ2.js → OSM-CcrUhItr.js} +15 -23
- package/dist/{PdfPreview.client-DJBMzrlC.js → PdfPreview.client-8NzNfW8b.js} +823 -855
- package/dist/Pmtiles.client-BFH4rTB7.js +26324 -0
- package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-BOgE441d.js +58 -0
- package/dist/{ScaleLine-KW-nXqp3.js → ScaleLine-VGQ7nkMS.js} +2 -2
- package/dist/{Tile-DbNFNPfU.js → Tile-CSpn0Ca8.js} +160 -163
- package/dist/{TileImage-BsXBxMtq.js → TileImage-CpbaEFwd.js} +143 -131
- package/dist/{View-BR92hTWP.js → View-BYBpt-AU.js} +483 -422
- package/dist/XmlPreview.client-DMOUO508.js +34 -0
- package/dist/{common-PJfpC179.js → common-BoeTUnDZ.js} +52 -52
- package/dist/components-next.css +1 -52
- package/dist/components-next.js +183 -146
- package/dist/components.css +2 -2
- package/dist/{index-BFQX7Ccz.js → index-C9obT9DJ.js} +21834 -15810
- package/dist/{leaflet-src-7m1mB8LI.js → leaflet-src-B4AZU0vr.js} +185 -187
- package/dist/{main-vqhkVhVS.js → main-DNoYWfit.js} +40723 -73240
- package/dist/{proj-DsetBcW7.js → proj-DxGbobp7.js} +662 -626
- package/dist/{text-clamp.esm-B5kW_XMt.js → text-clamp.esm-DVseBqZZ.js} +4 -4
- package/dist/{tilecoord-Db24Px13.js → tilecoord-DvX7WWiA.js} +273 -264
- package/dist/{vue3-json-viewer-BXwup7nO.js → vue3-json-viewer-CJLQFzXZ.js} +10 -16
- package/dist/{vue3-xml-viewer.common-BcNJo35o.js → vue3-xml-viewer.common-Cp7Cu5ME.js} +16 -16
- package/package.json +47 -38
- package/src/chart.ts +5 -0
- package/src/components/ActivityList/ActivityList.vue +3 -2
- package/src/components/Chart/ChartViewer.vue +320 -0
- package/src/components/Chart/ChartViewerWrapper.vue +182 -0
- package/src/components/DataserviceCard.vue +9 -0
- package/src/components/DataserviceQuality.vue +82 -0
- package/src/components/DataserviceQualityInline.vue +31 -0
- package/src/components/DataserviceQualityTooltipContent.vue +79 -0
- package/src/components/DatasetCard.vue +9 -4
- package/src/components/DatasetQuality.vue +11 -11
- package/src/components/DatasetQualityInline.vue +2 -2
- package/src/components/DatasetQualityTooltipContent.vue +1 -1
- package/src/components/Form/Listbox.vue +101 -0
- package/src/components/InfiniteLoader.vue +53 -0
- package/src/components/ObjectCardHeader.vue +11 -4
- package/src/components/OpenApiViewer/ContentTypeSelect.vue +48 -0
- package/src/components/OpenApiViewer/EndpointRequest.vue +164 -0
- package/src/components/OpenApiViewer/EndpointResponses.vue +149 -0
- package/src/components/OpenApiViewer/OpenApiViewer.vue +308 -0
- package/src/components/OpenApiViewer/SchemaPanel.vue +53 -0
- package/src/components/OpenApiViewer/SchemaTree.vue +77 -0
- package/src/components/OpenApiViewer/openapi.ts +150 -0
- package/src/components/OrganizationNameWithCertificate.vue +3 -2
- package/src/components/Pagination.vue +8 -5
- package/src/components/RadioInput.vue +7 -2
- package/src/components/ResourceAccordion/DataStructure.vue +11 -33
- package/src/components/ResourceAccordion/Downloads.vue +160 -0
- package/src/components/ResourceAccordion/ImagePreview.client.vue +48 -0
- package/src/components/ResourceAccordion/JsonPreview.client.vue +23 -104
- package/src/components/ResourceAccordion/MapContainer.client.vue +1 -3
- package/src/components/ResourceAccordion/Metadata.vue +1 -2
- package/src/components/ResourceAccordion/PdfPreview.client.vue +24 -87
- package/src/components/ResourceAccordion/Pmtiles.client.vue +3 -1
- package/src/components/ResourceAccordion/Preview.vue +11 -11
- package/src/components/ResourceAccordion/PreviewWrapper.vue +82 -0
- package/src/components/ResourceAccordion/ResourceAccordion.vue +19 -113
- package/src/components/ResourceAccordion/XmlPreview.client.vue +16 -98
- package/src/components/ResourceExplorer/ResourceExplorer.vue +22 -19
- package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +2 -2
- package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +64 -148
- package/src/components/ResourceExplorer/ResourceSelector.vue +113 -0
- package/src/components/ReuseCard.vue +14 -6
- package/src/components/ReuseDetails.vue +2 -2
- package/src/components/ReuseHorizontalCard.vue +2 -2
- package/src/components/Search/GlobalSearch.vue +219 -117
- package/src/components/Search/SearchInput.vue +5 -4
- package/src/components/TabularExplorer/TabularCell.vue +52 -0
- package/src/components/TabularExplorer/TabularCellPopover.vue +170 -0
- package/src/components/TabularExplorer/TabularExplorer.vue +1226 -0
- package/src/components/TabularExplorer/TabularFilterContent.vue +370 -0
- package/src/components/TabularExplorer/TabularFilterPopover.vue +107 -0
- package/src/components/TabularExplorer/types.ts +86 -0
- package/src/composables/useHasTabularData.ts +15 -1
- package/src/composables/useMetrics.ts +1 -1
- package/src/composables/useResourceCapabilities.ts +28 -15
- package/src/composables/useSearchFilter.ts +120 -0
- package/src/composables/useStableQueryParams.ts +38 -6
- package/src/composables/useTabularProfile.ts +70 -0
- package/src/config.ts +21 -3
- package/src/functions/activities.ts +3 -3
- package/src/functions/api.ts +20 -42
- package/src/functions/api.types.ts +1 -0
- package/src/functions/charts.ts +99 -0
- package/src/functions/datasets.ts +0 -17
- package/src/functions/dates.ts +3 -2
- package/src/functions/metrics.ts +6 -4
- package/src/functions/resources.ts +117 -1
- package/src/functions/tabular.ts +214 -0
- package/src/functions/tabularApi.ts +96 -11
- package/src/main.ts +109 -14
- package/src/types/dataservices.ts +17 -0
- package/src/types/organizations.ts +10 -0
- package/src/types/pages.ts +0 -5
- package/src/types/posts.ts +2 -2
- package/src/types/reports.ts +5 -1
- package/src/types/resources.ts +0 -1
- package/src/types/reuses.ts +12 -1
- package/src/types/search.ts +63 -1
- package/src/types/site.ts +5 -3
- package/src/types/ui.ts +2 -0
- package/src/types/users.ts +2 -1
- package/src/types/visualizations.ts +93 -0
- package/assets/swagger-themes/newspaper.css +0 -1670
- package/dist/JsonPreview.client-CYxmz0yV.js +0 -72
- package/dist/Pmtiles.client-C_hvRDuy.js +0 -25185
- package/dist/Swagger.client-B4y0hXME.js +0 -4
- package/dist/XmlPreview.client-LETEfNBH.js +0 -64
- package/src/components/ResourceAccordion/Swagger.client.vue +0 -48
- package/src/functions/pagination.ts +0 -9
- /package/src/components/{DatasetQualityItem.vue → QualityItem.vue} +0 -0
- /package/src/components/{DatasetQualityItemWarning.vue → QualityItemWarning.vue} +0 -0
- /package/src/components/{DatasetQualityScore.vue → QualityScore.vue} +0 -0
package/src/main.ts
CHANGED
|
@@ -13,9 +13,9 @@ import type { License } from './types/licenses'
|
|
|
13
13
|
import type { Member, MemberRole, NewOrganization, Organization, OrganizationOrSuggest, OrganizationReference, OrganizationSuggest } from './types/organizations'
|
|
14
14
|
import type { Owned, OwnedWithFullObject, OwnedWithId } from './types/owned'
|
|
15
15
|
import type { Comment, Thread } from './types/discussions'
|
|
16
|
-
import type {
|
|
16
|
+
import type { PageBloc, ContentBloc, BlocWithTitle, DatasetsListBloc, DataservicesListBloc, ReusesListBloc, LinkInBloc, LinksListBloc, MarkdownBloc, AccordionItemBloc, AccordionListBloc, HeroBloc } from './types/pages'
|
|
17
17
|
import type { Post } from './types/posts'
|
|
18
|
-
import type { ReuseReference, NewReuse, Reuse, ReuseTopic, ReuseType } from './types/reuses'
|
|
18
|
+
import type { ReuseReference, NewReuse, Reuse, ReuseV2, ReuseTopic, ReuseType } from './types/reuses'
|
|
19
19
|
import type { RegisteredSchema, Schema, SchemaDetails, SchemaField, SchemaPath, SchemaPublicationMode, SchemaResponseData, SchemaVersion, ValidataError } from './types/schemas'
|
|
20
20
|
import type { TopicV2, TopicElement, TopicElementClass, TopicElementRel } from './types/topics'
|
|
21
21
|
import type { CommunityResource, FileResourceFileType, RemoteResourceFileType, ResourceFileType, ResourceGroup, ResourceType, Resource } from './types/resources'
|
|
@@ -23,8 +23,12 @@ import type { Site } from './types/site'
|
|
|
23
23
|
import type { Weight, WellType } from './types/ui'
|
|
24
24
|
import type { User, UserReference } from './types/users'
|
|
25
25
|
import type { Report, ReportSubject, ReportReason } from './types/reports'
|
|
26
|
-
import type {
|
|
27
|
-
import {
|
|
26
|
+
import type { Chart, ChartForm, ChartForApi, FilterCondition, Filter, AndFilters, GenericFilter, XAxisType, XAxisSortBy, SortDirection, XAxis, XAxisForm, UnitPosition, YAxis, DataSeriesType, DataSeries, DataSeriesForm, CombinedSort, ColumnDefinition, ColumnsDefinition } from './types/visualizations'
|
|
27
|
+
import type { ColumnFilters, ColumnType, TabularRow } from './components/TabularExplorer/types'
|
|
28
|
+
import type { GlobalSearchConfig, SearchType, SearchTypeConfig, SortOption, HiddenFilter, BuiltInFilterKey, DatasetSearchConfig, DatasetSearchFilters, DataserviceSearchConfig, DataserviceSearchFilters, ReuseSearchConfig, ReuseSearchFilters, OrganizationSearchConfig, OrganizationSearchFilters, TopicSearchConfig, TopicSearchFilters } from './types/search'
|
|
29
|
+
import { getDefaultDatasetConfig, getDefaultDataserviceConfig, getDefaultReuseConfig, getDefaultOrganizationConfig, getDefaultTopicConfig, getDefaultGlobalSearchConfig, defaultDatasetSortOptions, defaultDataserviceSortOptions, defaultReuseSortOptions, defaultOrganizationSortOptions } from './types/search'
|
|
30
|
+
import { useSearchFilter } from './composables/useSearchFilter'
|
|
31
|
+
import type { UseSearchFilterOptions } from './composables/useSearchFilter'
|
|
28
32
|
|
|
29
33
|
import ActivityList from './components/ActivityList/ActivityList.vue'
|
|
30
34
|
import UserActivityList from './components/ActivityList/UserActivityList.vue'
|
|
@@ -36,7 +40,13 @@ import BannerAction from './components/BannerAction.vue'
|
|
|
36
40
|
import BrandedButton from './components/BrandedButton.vue'
|
|
37
41
|
import CopyButton from './components/CopyButton.vue'
|
|
38
42
|
import DataserviceCard from './components/DataserviceCard.vue'
|
|
43
|
+
import DataserviceQuality from './components/DataserviceQuality.vue'
|
|
44
|
+
import DataserviceQualityInline from './components/DataserviceQualityInline.vue'
|
|
45
|
+
import DataserviceQualityTooltipContent from './components/DataserviceQualityTooltipContent.vue'
|
|
39
46
|
import DatasetCard from './components/DatasetCard.vue'
|
|
47
|
+
import DataStructure from './components/ResourceAccordion/DataStructure.vue'
|
|
48
|
+
import Downloads from './components/ResourceAccordion/Downloads.vue'
|
|
49
|
+
import Metadata from './components/ResourceAccordion/Metadata.vue'
|
|
40
50
|
import DescriptionListTerm from './components/DescriptionListTerm.vue'
|
|
41
51
|
import DescriptionListDetails from './components/DescriptionListDetails.vue'
|
|
42
52
|
import DiscussionMessageCard from './components/DiscussionMessageCard.vue'
|
|
@@ -47,8 +57,8 @@ import LicenseBadge from './components/LicenseBadge.vue'
|
|
|
47
57
|
import Tag from './components/Tag.vue'
|
|
48
58
|
import DatasetQuality from './components/DatasetQuality.vue'
|
|
49
59
|
import DatasetQualityInline from './components/DatasetQualityInline.vue'
|
|
50
|
-
import
|
|
51
|
-
import
|
|
60
|
+
import QualityItem from './components/QualityItem.vue'
|
|
61
|
+
import QualityScore from './components/QualityScore.vue'
|
|
52
62
|
import ProgressBar from './components/ProgressBar.vue'
|
|
53
63
|
import DatasetQualityTooltipContent from './components/DatasetQualityTooltipContent.vue'
|
|
54
64
|
import ExtraAccordion from './components/ExtraAccordion.vue'
|
|
@@ -57,6 +67,7 @@ import LoadingBlock from './components/LoadingBlock.vue'
|
|
|
57
67
|
import MarkdownViewer from './components/MarkdownViewer.vue'
|
|
58
68
|
import OrganizationCard from './components/OrganizationCard.vue'
|
|
59
69
|
import OrganizationHorizontalCard from './components/OrganizationHorizontalCard.vue'
|
|
70
|
+
import ObjectCardOwner from './components/ObjectCardOwner.vue'
|
|
60
71
|
import OrganizationLogo from './components/OrganizationLogo.vue'
|
|
61
72
|
import OrganizationNameWithCertificate from './components/OrganizationNameWithCertificate.vue'
|
|
62
73
|
import OwnerType from './components/OwnerType.vue'
|
|
@@ -70,16 +81,16 @@ import PostCard from './components/PostCard.vue'
|
|
|
70
81
|
import ReadMore from './components/ReadMore.vue'
|
|
71
82
|
import ResourceAccordion from './components/ResourceAccordion/ResourceAccordion.vue'
|
|
72
83
|
import ResourceIcon from './components/ResourceAccordion/ResourceIcon.vue'
|
|
84
|
+
import ResourceSelector from './components/ResourceExplorer/ResourceSelector.vue'
|
|
73
85
|
import ResourceExplorer from './components/ResourceExplorer/ResourceExplorer.vue'
|
|
74
86
|
import ResourceExplorerSidebar from './components/ResourceExplorer/ResourceExplorerSidebar.vue'
|
|
75
87
|
import ResourceExplorerViewer from './components/ResourceExplorer/ResourceExplorerViewer.vue'
|
|
76
|
-
import
|
|
88
|
+
import OpenApiViewer from './components/OpenApiViewer/OpenApiViewer.vue'
|
|
77
89
|
import ReuseCard from './components/ReuseCard.vue'
|
|
78
90
|
import ReuseHorizontalCard from './components/ReuseHorizontalCard.vue'
|
|
79
91
|
import ReuseDetails from './components/ReuseDetails.vue'
|
|
80
92
|
import SchemaCard from './components/SchemaCard.vue'
|
|
81
93
|
import SimpleBanner from './components/SimpleBanner.vue'
|
|
82
|
-
import SmallChart from './components/SmallChart.vue'
|
|
83
94
|
import StatBox from './components/StatBox.vue'
|
|
84
95
|
import Tab from './components/Tabs/Tab.vue'
|
|
85
96
|
import TabGroup from './components/Tabs/TabGroup.vue'
|
|
@@ -94,16 +105,24 @@ import GlobalSearch from './components/Search/GlobalSearch.vue'
|
|
|
94
105
|
import SearchInput from './components/Search/SearchInput.vue'
|
|
95
106
|
import SearchableSelect from './components/Form/SearchableSelect.vue'
|
|
96
107
|
import SelectGroup from './components/Form/SelectGroup.vue'
|
|
108
|
+
import Listbox from './components/Form/Listbox.vue'
|
|
109
|
+
import InfiniteLoader from './components/InfiniteLoader.vue'
|
|
110
|
+
import TabularExplorer from './components/TabularExplorer/TabularExplorer.vue'
|
|
97
111
|
import type { UseFetchFunction } from './functions/api.types'
|
|
98
112
|
import { configKey, useComponentsConfig, type PluginConfig } from './config.js'
|
|
113
|
+
import { ofetch } from 'ofetch'
|
|
114
|
+
import { useTranslation } from './composables/useTranslation'
|
|
99
115
|
|
|
100
116
|
export { Toaster, toast } from 'vue-sonner'
|
|
101
117
|
|
|
102
118
|
export * from './composables/useActiveDescendant'
|
|
119
|
+
export * from './composables/useDebouncedRef'
|
|
103
120
|
export * from './composables/useMetrics'
|
|
104
121
|
export * from './composables/useReuseType'
|
|
105
122
|
export * from './composables/useTranslation'
|
|
106
123
|
export * from './composables/useHasTabularData'
|
|
124
|
+
export * from './composables/useResourceCapabilities'
|
|
125
|
+
export * from './composables/useTabularProfile'
|
|
107
126
|
|
|
108
127
|
export * from './functions/activities'
|
|
109
128
|
export * from './functions/datasets'
|
|
@@ -116,17 +135,33 @@ export * from './functions/metrics'
|
|
|
116
135
|
export * from './functions/never'
|
|
117
136
|
export * from './functions/organizations'
|
|
118
137
|
export * from './functions/owned'
|
|
119
|
-
export * from './functions/pagination'
|
|
120
138
|
export * from './functions/resources'
|
|
121
139
|
export * from './functions/reuses'
|
|
122
140
|
export * from './functions/schemas'
|
|
141
|
+
export * from './functions/tabular'
|
|
123
142
|
export * from './functions/users'
|
|
143
|
+
export * from './functions/tabularApi'
|
|
144
|
+
export * from './functions/charts'
|
|
124
145
|
export * from './types/access_types'
|
|
125
146
|
|
|
126
147
|
export type {
|
|
127
148
|
GlobalSearchConfig,
|
|
128
149
|
SearchType,
|
|
150
|
+
SearchTypeConfig,
|
|
129
151
|
SortOption,
|
|
152
|
+
HiddenFilter,
|
|
153
|
+
BuiltInFilterKey,
|
|
154
|
+
DatasetSearchConfig,
|
|
155
|
+
DatasetSearchFilters,
|
|
156
|
+
DataserviceSearchConfig,
|
|
157
|
+
DataserviceSearchFilters,
|
|
158
|
+
ReuseSearchConfig,
|
|
159
|
+
ReuseSearchFilters,
|
|
160
|
+
OrganizationSearchConfig,
|
|
161
|
+
OrganizationSearchFilters,
|
|
162
|
+
TopicSearchConfig,
|
|
163
|
+
TopicSearchFilters,
|
|
164
|
+
UseSearchFilterOptions,
|
|
130
165
|
UseFetchFunction,
|
|
131
166
|
AccessType,
|
|
132
167
|
AccessAudience,
|
|
@@ -168,7 +203,6 @@ export type {
|
|
|
168
203
|
Owned,
|
|
169
204
|
OwnedWithFullObject,
|
|
170
205
|
OwnedWithId,
|
|
171
|
-
Page,
|
|
172
206
|
PageBloc,
|
|
173
207
|
ContentBloc,
|
|
174
208
|
BlocWithTitle,
|
|
@@ -197,6 +231,7 @@ export type {
|
|
|
197
231
|
ResourceType,
|
|
198
232
|
ReuseReference,
|
|
199
233
|
Reuse,
|
|
234
|
+
ReuseV2,
|
|
200
235
|
ReuseTopic,
|
|
201
236
|
ReuseType,
|
|
202
237
|
Schema,
|
|
@@ -218,6 +253,29 @@ export type {
|
|
|
218
253
|
ValidataError,
|
|
219
254
|
Weight,
|
|
220
255
|
WellType,
|
|
256
|
+
Chart,
|
|
257
|
+
ChartForm,
|
|
258
|
+
ChartForApi,
|
|
259
|
+
CombinedSort,
|
|
260
|
+
ColumnDefinition,
|
|
261
|
+
ColumnFilters,
|
|
262
|
+
ColumnType,
|
|
263
|
+
ColumnsDefinition,
|
|
264
|
+
TabularRow,
|
|
265
|
+
FilterCondition,
|
|
266
|
+
Filter,
|
|
267
|
+
AndFilters,
|
|
268
|
+
GenericFilter,
|
|
269
|
+
XAxisType,
|
|
270
|
+
XAxisSortBy,
|
|
271
|
+
SortDirection,
|
|
272
|
+
XAxis,
|
|
273
|
+
XAxisForm,
|
|
274
|
+
UnitPosition,
|
|
275
|
+
YAxis,
|
|
276
|
+
DataSeriesType,
|
|
277
|
+
DataSeries,
|
|
278
|
+
DataSeriesForm,
|
|
221
279
|
}
|
|
222
280
|
|
|
223
281
|
export {
|
|
@@ -225,16 +283,43 @@ export {
|
|
|
225
283
|
getDefaultDataserviceConfig,
|
|
226
284
|
getDefaultReuseConfig,
|
|
227
285
|
getDefaultOrganizationConfig,
|
|
286
|
+
getDefaultTopicConfig,
|
|
228
287
|
getDefaultGlobalSearchConfig,
|
|
229
288
|
defaultDatasetSortOptions,
|
|
230
289
|
defaultDataserviceSortOptions,
|
|
231
290
|
defaultReuseSortOptions,
|
|
232
291
|
defaultOrganizationSortOptions,
|
|
292
|
+
useSearchFilter,
|
|
233
293
|
}
|
|
234
294
|
|
|
235
295
|
// Vue Plugin
|
|
236
296
|
const datagouv: Plugin<PluginConfig> = {
|
|
237
297
|
async install(app: App, options) {
|
|
298
|
+
// Default `$fetch` to an ofetch instance carrying the datagouv API specifics + the consumer's
|
|
299
|
+
// auth hooks, so everything downstream (the default `useFetch`, imperative helpers) can rely on
|
|
300
|
+
// a single configured fetch. A consumer that provides its own `$fetch` keeps full control.
|
|
301
|
+
if (!options.$fetch) {
|
|
302
|
+
options.$fetch = ofetch.create({
|
|
303
|
+
baseURL: options.apiBase,
|
|
304
|
+
onRequest(context) {
|
|
305
|
+
if (options.onRequest) {
|
|
306
|
+
if (Array.isArray(options.onRequest)) options.onRequest.forEach(hook => hook(context))
|
|
307
|
+
else options.onRequest(context)
|
|
308
|
+
}
|
|
309
|
+
context.options.headers.set('Content-Type', 'application/json')
|
|
310
|
+
context.options.headers.set('Accept', 'application/json')
|
|
311
|
+
if (options.devApiKey) context.options.headers.set('X-API-KEY', options.devApiKey)
|
|
312
|
+
const { locale } = useTranslation()
|
|
313
|
+
if (locale) {
|
|
314
|
+
context.options.params ??= {}
|
|
315
|
+
context.options.params['lang'] = locale
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
onRequestError: options.onRequestError,
|
|
319
|
+
onResponse: options.onResponse,
|
|
320
|
+
onResponseError: options.onResponseError,
|
|
321
|
+
})
|
|
322
|
+
}
|
|
238
323
|
app.provide(configKey, options)
|
|
239
324
|
if (!options.textClamp) {
|
|
240
325
|
const textClamp = await import('vue3-text-clamp')
|
|
@@ -255,7 +340,13 @@ export {
|
|
|
255
340
|
BrandedButton,
|
|
256
341
|
CopyButton,
|
|
257
342
|
DataserviceCard,
|
|
343
|
+
DataserviceQuality,
|
|
344
|
+
DataserviceQualityInline,
|
|
345
|
+
DataserviceQualityTooltipContent,
|
|
258
346
|
DatasetCard,
|
|
347
|
+
DataStructure,
|
|
348
|
+
Downloads,
|
|
349
|
+
Metadata,
|
|
259
350
|
DatasetInformationSection,
|
|
260
351
|
DatasetTemporalitySection,
|
|
261
352
|
DatasetSpatialSection,
|
|
@@ -266,8 +357,8 @@ export {
|
|
|
266
357
|
DiscussionMessageCard,
|
|
267
358
|
DatasetQuality,
|
|
268
359
|
DatasetQualityInline,
|
|
269
|
-
|
|
270
|
-
|
|
360
|
+
QualityItem,
|
|
361
|
+
QualityScore,
|
|
271
362
|
DatasetQualityTooltipContent,
|
|
272
363
|
DateRangeDetails,
|
|
273
364
|
ExtraAccordion,
|
|
@@ -295,15 +386,16 @@ export {
|
|
|
295
386
|
ResourceExplorer,
|
|
296
387
|
ResourceExplorerSidebar,
|
|
297
388
|
ResourceExplorerViewer,
|
|
389
|
+
ObjectCardOwner,
|
|
298
390
|
ResourceIcon,
|
|
391
|
+
ResourceSelector,
|
|
299
392
|
ReuseCard,
|
|
300
393
|
ReuseDetails,
|
|
301
394
|
ReuseHorizontalCard,
|
|
302
395
|
SchemaCard,
|
|
303
396
|
SimpleBanner,
|
|
304
|
-
SmallChart,
|
|
305
397
|
StatBox,
|
|
306
|
-
|
|
398
|
+
OpenApiViewer,
|
|
307
399
|
Tab,
|
|
308
400
|
TabGroup,
|
|
309
401
|
TabList,
|
|
@@ -318,4 +410,7 @@ export {
|
|
|
318
410
|
SearchInput,
|
|
319
411
|
SearchableSelect,
|
|
320
412
|
SelectGroup,
|
|
413
|
+
Listbox,
|
|
414
|
+
InfiniteLoader,
|
|
415
|
+
TabularExplorer,
|
|
321
416
|
}
|
|
@@ -24,12 +24,27 @@ export type BaseDataservice = Owned & WithAccessType & {
|
|
|
24
24
|
license: string | null
|
|
25
25
|
private: boolean
|
|
26
26
|
rate_limiting: string
|
|
27
|
+
rate_limiting_url: string | null
|
|
27
28
|
title: DataserviceReference['title']
|
|
28
29
|
contact_points: Array<ContactPoint>
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
export type NewDataservice = Omit<BaseDataservice, keyof OwnedWithId> & OwnedWithId
|
|
32
33
|
|
|
34
|
+
export type DataserviceQuality = {
|
|
35
|
+
has_description: boolean
|
|
36
|
+
has_machine_documentation: boolean
|
|
37
|
+
has_technical_documentation: boolean
|
|
38
|
+
has_business_documentation: boolean
|
|
39
|
+
license: boolean
|
|
40
|
+
has_contact_point: boolean
|
|
41
|
+
has_base_api_url: boolean
|
|
42
|
+
availability_documented: boolean
|
|
43
|
+
rate_limiting_documented: boolean
|
|
44
|
+
access_conditions_clear: boolean
|
|
45
|
+
score: number
|
|
46
|
+
}
|
|
47
|
+
|
|
33
48
|
export type Dataservice = Owned & WithAccessType & {
|
|
34
49
|
acronym: string
|
|
35
50
|
archived_at: string | null
|
|
@@ -65,9 +80,11 @@ export type Dataservice = Owned & WithAccessType & {
|
|
|
65
80
|
permissions: { edit: boolean, delete: boolean }
|
|
66
81
|
private: boolean
|
|
67
82
|
rate_limiting: string
|
|
83
|
+
rate_limiting_url: string | null
|
|
68
84
|
self_api_url: DataserviceReference['self_api_url']
|
|
69
85
|
self_web_url: DataserviceReference['self_web_url']
|
|
70
86
|
slug: string
|
|
71
87
|
tags: Array<string>
|
|
72
88
|
title: string
|
|
89
|
+
quality?: DataserviceQuality
|
|
73
90
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { User } from './users'
|
|
2
2
|
import type { Badges } from './badges'
|
|
3
|
+
import type { PageBloc } from './pages'
|
|
3
4
|
|
|
4
5
|
export type MemberRole = 'admin' | 'editor' | 'partial_editor'
|
|
5
6
|
|
|
@@ -68,4 +69,13 @@ export type Organization = {
|
|
|
68
69
|
reuses_by_months: Record<string, number>
|
|
69
70
|
views: number
|
|
70
71
|
}
|
|
72
|
+
// Editorial blocs powering the organization "Présentation" tab. Excluded from
|
|
73
|
+
// the default API read mask, so only present when requested with X-Fields.
|
|
74
|
+
// Read through the API's `public_presentation_blocs`: hidden from the public until
|
|
75
|
+
// published, but always returned to organization administrators.
|
|
76
|
+
presentation_blocs?: Array<PageBloc>
|
|
77
|
+
// Publication date of the blocs. `null` means draft (never public); a set date
|
|
78
|
+
// means published. Like `presentation_blocs`, only present when requested with
|
|
79
|
+
// X-Fields.
|
|
80
|
+
presentation_blocs_published_at?: string | null
|
|
71
81
|
}
|
package/src/types/pages.ts
CHANGED
|
@@ -2,11 +2,6 @@ import type { DatasetV2 } from './datasets'
|
|
|
2
2
|
import type { Dataservice } from './dataservices'
|
|
3
3
|
import type { Reuse } from './reuses'
|
|
4
4
|
|
|
5
|
-
export type Page = {
|
|
6
|
-
id: string
|
|
7
|
-
blocs: Array<PageBloc>
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
export type BlocWithTitle = {
|
|
11
6
|
title: string
|
|
12
7
|
subtitle: string | null
|
package/src/types/posts.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Dataset } from './datasets'
|
|
2
|
-
import type {
|
|
2
|
+
import type { PageBloc } from './pages'
|
|
3
3
|
import type { Reuse } from './reuses'
|
|
4
4
|
import type { User } from './users'
|
|
5
5
|
|
|
6
6
|
export type Post = {
|
|
7
7
|
body_type: 'markdown' | 'html' | 'blocs'
|
|
8
|
+
blocs: Array<PageBloc>
|
|
8
9
|
content: string
|
|
9
|
-
content_as_page: Page | null
|
|
10
10
|
created_at: string
|
|
11
11
|
credit_to: string
|
|
12
12
|
credit_url: string
|
package/src/types/reports.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { User } from './users'
|
|
2
2
|
|
|
3
3
|
export type ReportSubject = {
|
|
4
|
-
class: 'Discussion' | 'Dataservice' | 'Dataset' | 'Organization' | 'Reuse'
|
|
4
|
+
class: 'Discussion' | 'Dataservice' | 'Dataset' | 'Organization' | 'Reuse' | 'User'
|
|
5
5
|
id: string
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -16,11 +16,15 @@ export type Report = {
|
|
|
16
16
|
id: string
|
|
17
17
|
by: User | null
|
|
18
18
|
subject: ReportSubject | null
|
|
19
|
+
subject_embed_id: string | null
|
|
19
20
|
reason: ReportReasonValue
|
|
20
21
|
message: string
|
|
21
22
|
reported_at: string
|
|
22
23
|
self_api_url: string
|
|
23
24
|
subject_deleted_at: string | null
|
|
25
|
+
subject_deleted_by: User | null
|
|
26
|
+
subject_label: string | null
|
|
24
27
|
dismissed_at: string | null
|
|
25
28
|
dismissed_by: User | null
|
|
29
|
+
callbacks_count: number
|
|
26
30
|
}
|
package/src/types/resources.ts
CHANGED
package/src/types/reuses.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Owned, OwnedWithId } from './owned'
|
|
2
|
-
import type { Dataset } from './datasets'
|
|
2
|
+
import type { Dataset, Rel } from './datasets'
|
|
3
3
|
import type { Badges } from './badges'
|
|
4
4
|
import type { Dataservice } from './dataservices'
|
|
5
5
|
|
|
@@ -51,6 +51,17 @@ export type Reuse = BaseReuse & {
|
|
|
51
51
|
permissions: { edit: boolean, delete: boolean }
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Lightweight reuse returned by the listing endpoints (`/api/2/reuses/` and
|
|
56
|
+
* `/api/2/reuses/search/`): the `datasets` and `dataservices` reference lists
|
|
57
|
+
* are replaced by links to their respective listing endpoints filtered on this
|
|
58
|
+
* reuse, so that listing reuses does not dereference every linked dataset.
|
|
59
|
+
*/
|
|
60
|
+
export type ReuseV2 = Owned & Omit<Reuse, 'datasets' | 'dataservices'> & {
|
|
61
|
+
datasets: Rel
|
|
62
|
+
dataservices: Rel
|
|
63
|
+
}
|
|
64
|
+
|
|
54
65
|
export type ReuseType = {
|
|
55
66
|
id: string
|
|
56
67
|
label: string
|
package/src/types/search.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import type { Component } from 'vue'
|
|
1
2
|
import type { PaginatedArray } from './api'
|
|
2
3
|
import type { AccessType } from './access_types'
|
|
4
|
+
import type { Dataset } from './datasets'
|
|
5
|
+
import type { Dataservice } from './dataservices'
|
|
6
|
+
import type { Organization } from './organizations'
|
|
7
|
+
import type { ReuseV2 } from './reuses'
|
|
8
|
+
import type { TopicV2 } from './topics'
|
|
3
9
|
import type {
|
|
4
10
|
CERTIFIED,
|
|
5
11
|
PUBLIC_SERVICE,
|
|
@@ -291,46 +297,86 @@ export type SortOption<Sort extends string> = {
|
|
|
291
297
|
|
|
292
298
|
export type DatasetSearchConfig = {
|
|
293
299
|
class: 'datasets'
|
|
300
|
+
key?: string
|
|
294
301
|
name?: string
|
|
302
|
+
icon?: Component | string
|
|
303
|
+
placeholder?: string | null
|
|
295
304
|
hiddenFilters?: HiddenFilter<DatasetSearchFilters>[]
|
|
296
305
|
basicFilters?: (keyof DatasetSearchFilters)[]
|
|
297
306
|
advancedFilters?: (keyof DatasetSearchFilters)[]
|
|
298
307
|
sortOptions?: SortOption<DatasetSearchSort>[]
|
|
308
|
+
defaultSort?: DatasetSearchSort
|
|
299
309
|
}
|
|
300
310
|
|
|
301
311
|
export type DataserviceSearchConfig = {
|
|
302
312
|
class: 'dataservices'
|
|
313
|
+
key?: string
|
|
303
314
|
name?: string
|
|
315
|
+
icon?: Component | string
|
|
316
|
+
placeholder?: string | null
|
|
304
317
|
hiddenFilters?: HiddenFilter<DataserviceSearchFilters>[]
|
|
305
318
|
basicFilters?: (keyof DataserviceSearchFilters)[]
|
|
306
319
|
advancedFilters?: (keyof DataserviceSearchFilters)[]
|
|
307
320
|
sortOptions?: SortOption<DataserviceSearchSort>[]
|
|
321
|
+
defaultSort?: DataserviceSearchSort
|
|
308
322
|
}
|
|
309
323
|
|
|
310
324
|
export type ReuseSearchConfig = {
|
|
311
325
|
class: 'reuses'
|
|
326
|
+
key?: string
|
|
312
327
|
name?: string
|
|
328
|
+
icon?: Component | string
|
|
329
|
+
placeholder?: string | null
|
|
313
330
|
hiddenFilters?: HiddenFilter<ReuseSearchFilters>[]
|
|
314
331
|
basicFilters?: (keyof ReuseSearchFilters)[]
|
|
315
332
|
advancedFilters?: (keyof ReuseSearchFilters)[]
|
|
316
333
|
sortOptions?: SortOption<ReuseSearchSort>[]
|
|
334
|
+
defaultSort?: ReuseSearchSort
|
|
317
335
|
}
|
|
318
336
|
|
|
319
337
|
export type OrganizationSearchConfig = {
|
|
320
338
|
class: 'organizations'
|
|
339
|
+
key?: string
|
|
321
340
|
name?: string
|
|
341
|
+
icon?: Component | string
|
|
342
|
+
placeholder?: string | null
|
|
322
343
|
hiddenFilters?: HiddenFilter<OrganizationSearchFilters>[]
|
|
323
344
|
basicFilters?: (keyof OrganizationSearchFilters)[]
|
|
324
345
|
advancedFilters?: (keyof OrganizationSearchFilters)[]
|
|
325
346
|
sortOptions?: SortOption<OrganizationSearchSort>[]
|
|
347
|
+
defaultSort?: OrganizationSearchSort
|
|
326
348
|
}
|
|
327
349
|
|
|
328
|
-
export type
|
|
350
|
+
export type TopicSearchConfig = {
|
|
351
|
+
class: 'topics'
|
|
352
|
+
key?: string
|
|
353
|
+
name?: string
|
|
354
|
+
icon?: Component | string
|
|
355
|
+
placeholder?: string | null
|
|
356
|
+
hiddenFilters?: HiddenFilter<TopicSearchFilters>[]
|
|
357
|
+
basicFilters?: (keyof TopicSearchFilters)[]
|
|
358
|
+
advancedFilters?: (keyof TopicSearchFilters)[]
|
|
359
|
+
sortOptions?: SortOption<TopicSearchSort>[]
|
|
360
|
+
defaultSort?: TopicSearchSort
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export type SearchTypeConfig = DatasetSearchConfig | DataserviceSearchConfig | ReuseSearchConfig | OrganizationSearchConfig | TopicSearchConfig
|
|
364
|
+
|
|
365
|
+
export type BuiltInFilterKey = keyof DatasetSearchFilters | keyof DataserviceSearchFilters | keyof ReuseSearchFilters | keyof OrganizationSearchFilters | keyof TopicSearchFilters
|
|
329
366
|
|
|
330
367
|
export type SearchType = SearchTypeConfig['class']
|
|
331
368
|
|
|
332
369
|
export type GlobalSearchConfig = SearchTypeConfig[]
|
|
333
370
|
|
|
371
|
+
// Maps each search class to its concrete response shape.
|
|
372
|
+
export type SearchResponseByClass = {
|
|
373
|
+
datasets: DatasetSearchResponse<Dataset>
|
|
374
|
+
dataservices: DataserviceSearchResponse<Dataservice>
|
|
375
|
+
reuses: ReuseSearchResponse<ReuseV2>
|
|
376
|
+
organizations: OrganizationSearchResponse<Organization>
|
|
377
|
+
topics: TopicSearchResponse<TopicV2>
|
|
378
|
+
}
|
|
379
|
+
|
|
334
380
|
// Helper functions for default configs
|
|
335
381
|
|
|
336
382
|
export const defaultDatasetSortOptions: SortOption<DatasetSearchSort>[] = [
|
|
@@ -397,11 +443,27 @@ export function getDefaultOrganizationConfig(overrides?: Partial<Omit<Organizati
|
|
|
397
443
|
}
|
|
398
444
|
}
|
|
399
445
|
|
|
446
|
+
export const defaultTopicSortOptions: SortOption<TopicSearchSort>[] = [
|
|
447
|
+
{ value: '-created', label: 'Date de création' },
|
|
448
|
+
{ value: '-last_modified', label: 'Dernière mise à jour' },
|
|
449
|
+
]
|
|
450
|
+
|
|
451
|
+
export function getDefaultTopicConfig(overrides?: Partial<Omit<TopicSearchConfig, 'class'>>): TopicSearchConfig {
|
|
452
|
+
return {
|
|
453
|
+
class: 'topics',
|
|
454
|
+
basicFilters: ['last_update_range', 'producer_type'],
|
|
455
|
+
advancedFilters: ['organization', 'tag'],
|
|
456
|
+
sortOptions: defaultTopicSortOptions,
|
|
457
|
+
...overrides,
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
400
461
|
export function getDefaultGlobalSearchConfig(): GlobalSearchConfig {
|
|
401
462
|
return [
|
|
402
463
|
getDefaultDatasetConfig(),
|
|
403
464
|
getDefaultDataserviceConfig(),
|
|
404
465
|
getDefaultReuseConfig(),
|
|
405
466
|
getDefaultOrganizationConfig(),
|
|
467
|
+
getDefaultTopicConfig(),
|
|
406
468
|
]
|
|
407
469
|
}
|
package/src/types/site.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { PageBloc } from './pages'
|
|
2
|
+
|
|
1
3
|
export type Site = {
|
|
2
4
|
id: string
|
|
3
5
|
title: string
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
datasets_blocs: Array<PageBloc>
|
|
7
|
+
reuses_blocs: Array<PageBloc>
|
|
8
|
+
dataservices_blocs: Array<PageBloc>
|
|
7
9
|
version: string
|
|
8
10
|
metrics: {
|
|
9
11
|
'dataservices': number
|
package/src/types/ui.ts
CHANGED
package/src/types/users.ts
CHANGED
|
@@ -21,13 +21,14 @@ export type User = {
|
|
|
21
21
|
page: UserReference['page']
|
|
22
22
|
avatar: UserReference['avatar']
|
|
23
23
|
avatar_thumbnail: UserReference['avatar_thumbnail']
|
|
24
|
-
apikey?: string
|
|
25
24
|
email?: string
|
|
26
25
|
about: string
|
|
27
26
|
website?: string
|
|
28
27
|
roles?: Array<string>
|
|
29
28
|
organizations: Array<OrganizationReference>
|
|
30
29
|
last_login_at: string | null
|
|
30
|
+
password_rotation_demanded: string | null
|
|
31
|
+
password_rotation_performed: string | null
|
|
31
32
|
since: string | null
|
|
32
33
|
metrics: {
|
|
33
34
|
datasets: number
|