@galadrim/galadmin 0.1.209 → 0.1.211
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/api.js +29 -0
- package/dist/api.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +11 -0
- package/package.json +1 -1
- package/src/api.ts +33 -3
- package/src/front/build/asset-manifest.json +3 -3
- package/src/front/build/index.html +1 -1
- package/src/front/build/static/js/{main.509108ea.js → main.8164246f.js} +3 -3
- package/src/front/build/static/js/{main.509108ea.js.map → main.8164246f.js.map} +1 -1
- package/src/front/src/components/Input.js +9 -0
- package/src/front/src/components/inputs/CompanyInput.js +187 -0
- package/src/front/src/components/inputs/DatetimeInput.js +1 -1
- package/src/front/src/pages/EditRecord.js +0 -7
- package/src/front/src/utils/getFormattedValue.js +2 -0
- package/src/types/config.ts +14 -0
- /package/src/front/build/static/js/{main.509108ea.js.LICENSE.txt → main.8164246f.js.LICENSE.txt} +0 -0
package/dist/types/config.d.ts
CHANGED
|
@@ -47,6 +47,16 @@ export type AddressColumn = {
|
|
|
47
47
|
countryField?: string;
|
|
48
48
|
postalCodeField?: string;
|
|
49
49
|
};
|
|
50
|
+
export type CompanyColumn = {
|
|
51
|
+
dataType: "company";
|
|
52
|
+
sirenField?: string;
|
|
53
|
+
siretField?: string;
|
|
54
|
+
companyNameField?: string;
|
|
55
|
+
addressField?: string;
|
|
56
|
+
zipCodeField?: string;
|
|
57
|
+
cityField?: string;
|
|
58
|
+
activityNumberField?: string;
|
|
59
|
+
};
|
|
50
60
|
export type DateColumn = {
|
|
51
61
|
dataType: "date";
|
|
52
62
|
name: string;
|
|
@@ -366,6 +376,7 @@ export type Config = {
|
|
|
366
376
|
ssl?: any;
|
|
367
377
|
};
|
|
368
378
|
googleMapsKey?: string;
|
|
379
|
+
inseeKey?: string;
|
|
369
380
|
hideMultiselect?: boolean;
|
|
370
381
|
hideBranding?: boolean;
|
|
371
382
|
sidebar?: {
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -200,7 +200,7 @@ export default (db, config, user) => {
|
|
|
200
200
|
|
|
201
201
|
app.post('/records', async function (req, res, next) {
|
|
202
202
|
const view = config.views[req.body.viewIndex];
|
|
203
|
-
const isDesc =
|
|
203
|
+
const isDesc = req.body.isDesc === null ? view.isDesc : req.body.isDesc
|
|
204
204
|
const orderBy = req.body.orderBy || (view.subviews && req.body.subviewIndex !== undefined ? view.subviews[req.body.subviewIndex]?.orderBy : null) || view.orderBy
|
|
205
205
|
const { rows: records, queryString, input, error } = await getRecords({
|
|
206
206
|
table: view.tableName,
|
|
@@ -835,7 +835,7 @@ export default (db, config, user) => {
|
|
|
835
835
|
})
|
|
836
836
|
.then(() => {
|
|
837
837
|
res.status(200).send({
|
|
838
|
-
path
|
|
838
|
+
path: s3Config.pathTransform ? s3Config.pathTransform(path) : path,
|
|
839
839
|
aspectRatio,
|
|
840
840
|
originalFilename,
|
|
841
841
|
});
|
|
@@ -854,7 +854,7 @@ export default (db, config, user) => {
|
|
|
854
854
|
if (err) return res.status(500).send(err);
|
|
855
855
|
res.send({
|
|
856
856
|
url: `https://${s3Config.host}/${s3Config.bucket}/${path}`,
|
|
857
|
-
path
|
|
857
|
+
path: s3Config.pathTransform ? s3Config.pathTransform(path) : path,
|
|
858
858
|
aspectRatio,
|
|
859
859
|
originalFilename
|
|
860
860
|
})
|
|
@@ -919,6 +919,36 @@ export default (db, config, user) => {
|
|
|
919
919
|
uploadFile(column, "file", req, res);
|
|
920
920
|
})
|
|
921
921
|
|
|
922
|
+
app.get('/searchCompanies', async (req, res) => {
|
|
923
|
+
if (!config.inseeKey) {
|
|
924
|
+
return res.status(403).send("inseeKey is not set in the config")
|
|
925
|
+
}
|
|
926
|
+
const response = await axios.get(`https://api.insee.fr/entreprises/sirene/siret`, {
|
|
927
|
+
headers: {
|
|
928
|
+
"Authorization": `Bearer ${config.inseeKey}`,
|
|
929
|
+
"Accept": "application/json"
|
|
930
|
+
},
|
|
931
|
+
params: {
|
|
932
|
+
q: `denominationUniteLegale:${encodeURIComponent(req.query.query as any)}* OR siren:${encodeURIComponent(req.query.query as any)}*`,
|
|
933
|
+
nombre: 100
|
|
934
|
+
}
|
|
935
|
+
});
|
|
936
|
+
const results = response.data.etablissements
|
|
937
|
+
.filter((etablissement) => etablissement.uniteLegale.etatAdministratifUniteLegale === "A")
|
|
938
|
+
.map((etablissement) => ({
|
|
939
|
+
id: Math.random().toString().slice(2),
|
|
940
|
+
companyName: etablissement.uniteLegale.denominationUniteLegale,
|
|
941
|
+
siret: etablissement.siret,
|
|
942
|
+
siren: etablissement.siren,
|
|
943
|
+
address: `${etablissement.adresseEtablissement.numeroVoieEtablissement || ""} ${etablissement.adresseEtablissement.typeVoieEtablissement || ""} ${etablissement.adresseEtablissement.libelleVoieEtablissement || ""}`,
|
|
944
|
+
city: etablissement.adresseEtablissement.libelleCommuneEtablissement,
|
|
945
|
+
zipCode: etablissement.adresseEtablissement.codePostalEtablissement,
|
|
946
|
+
activityNumber: etablissement.uniteLegale.activitePrincipaleUniteLegale,
|
|
947
|
+
}))
|
|
948
|
+
.slice(0, 10)
|
|
949
|
+
res.send(results)
|
|
950
|
+
})
|
|
951
|
+
|
|
922
952
|
return app
|
|
923
953
|
}
|
|
924
954
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"main.css": "/_HOMEPAGE_/static/css/main.eacc50f1.css",
|
|
4
|
-
"main.js": "/_HOMEPAGE_/static/js/main.
|
|
4
|
+
"main.js": "/_HOMEPAGE_/static/js/main.8164246f.js",
|
|
5
5
|
"static/media/gt-eesti-medium.woff": "/_HOMEPAGE_/static/media/gt-eesti-medium.a48c02fa57e83ab6ddcd.woff",
|
|
6
6
|
"static/media/gt-eesti-regular.woff": "/_HOMEPAGE_/static/media/gt-eesti-regular.304a7ae06ee4a4d5d04a.woff",
|
|
7
7
|
"static/media/logo.png": "/_HOMEPAGE_/static/media/logo.e407b9ca7e302466a07d.png",
|
|
8
8
|
"static/media/cubano.woff": "/_HOMEPAGE_/static/media/cubano.4eaa47ef94222121a371.woff",
|
|
9
9
|
"index.html": "/_HOMEPAGE_/index.html",
|
|
10
10
|
"main.eacc50f1.css.map": "/_HOMEPAGE_/static/css/main.eacc50f1.css.map",
|
|
11
|
-
"main.
|
|
11
|
+
"main.8164246f.js.map": "/_HOMEPAGE_/static/js/main.8164246f.js.map"
|
|
12
12
|
},
|
|
13
13
|
"entrypoints": [
|
|
14
14
|
"static/css/main.eacc50f1.css",
|
|
15
|
-
"static/js/main.
|
|
15
|
+
"static/js/main.8164246f.js"
|
|
16
16
|
]
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="fr"><head><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script><script src="https://momentjs.com/downloads/moment-timezone-with-data-10-year-range.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/locale/fr.js"></script><script async="async" defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/js/datepicker.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/js/i18n/datepicker.fr.min.js"></script><script async="async" defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/downloadjs/1.4.8/download.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script><script async="async" defer="defer" src="https://cdn.jsdelivr.net/npm/sweetalert"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/quill/1.3.6/quill.min.js"></script><script src="https://sdk.amazonaws.com/js/aws-sdk-2.606.0.min.js"></script><script src="https://kit.fontawesome.com/75b28933ed.js" crossorigin="anonymous" async="async" defer="defer"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/css/datepicker.min.css"/><link rel="stylesheet" href="/_HOMEPAGE_/spectrum.css"/><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/quill/1.3.6/quill.snow.min.css"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta charset="utf-8"/><link rel="icon" href="/_HOMEPAGE_/favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/_HOMEPAGE_/manifest.json"/><title>Back-office</title><script defer="defer" src="/_HOMEPAGE_/static/js/main.
|
|
1
|
+
<!doctype html><html lang="fr"><head><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script><script src="https://momentjs.com/downloads/moment-timezone-with-data-10-year-range.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/locale/fr.js"></script><script async="async" defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/js/datepicker.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/js/i18n/datepicker.fr.min.js"></script><script async="async" defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/downloadjs/1.4.8/download.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script><script async="async" defer="defer" src="https://cdn.jsdelivr.net/npm/sweetalert"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/quill/1.3.6/quill.min.js"></script><script src="https://sdk.amazonaws.com/js/aws-sdk-2.606.0.min.js"></script><script src="https://kit.fontawesome.com/75b28933ed.js" crossorigin="anonymous" async="async" defer="defer"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/air-datepicker/2.2.3/css/datepicker.min.css"/><link rel="stylesheet" href="/_HOMEPAGE_/spectrum.css"/><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/quill/1.3.6/quill.snow.min.css"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta charset="utf-8"/><link rel="icon" href="/_HOMEPAGE_/favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/_HOMEPAGE_/manifest.json"/><title>Back-office</title><script defer="defer" src="/_HOMEPAGE_/static/js/main.8164246f.js"></script><link href="/_HOMEPAGE_/static/css/main.eacc50f1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|