@treely/strapi-slices 5.15.1 → 5.16.0
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 +6 -0
- package/dist/components/CreditsAvailableBadge/CreditsAvailableBadge.d.ts +2 -2
- package/dist/models/PortfolioProject.d.ts +0 -2
- package/dist/models/fpm/FPMProject.d.ts +7 -0
- package/dist/models/strapi/StrapiProject.d.ts +0 -2
- package/dist/rootMessages.de.d.ts +0 -4
- package/dist/rootMessages.en.d.ts +0 -4
- package/dist/slices/ProjectGridCard/ProjectGridCard.d.ts +6 -0
- package/dist/slices/ProjectGridCard/index.d.ts +2 -0
- package/dist/slices/ProjectsGrid/ProjectsGrid.d.ts +3 -1
- package/dist/slices/ProjectsMap/MapMarker.d.ts +3 -3
- package/dist/strapi-slices.cjs.development.js +124 -129
- package/dist/strapi-slices.cjs.development.js.map +1 -1
- package/dist/strapi-slices.cjs.production.min.js +1 -1
- package/dist/strapi-slices.cjs.production.min.js.map +1 -1
- package/dist/strapi-slices.esm.js +127 -132
- package/dist/strapi-slices.esm.js.map +1 -1
- package/dist/test/integrationMocks/fpmPortoflioProjectMock.d.ts +3 -0
- package/dist/utils/getMessages.d.ts +0 -8
- package/package.json +1 -1
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.test.tsx +8 -6
- package/src/components/CreditsAvailableBadge/CreditsAvailableBadge.tsx +34 -22
- package/src/components/CreditsAvailableBadge/messages.de.ts +1 -1
- package/src/components/portfolio/ProjectInfo/ProjectInfo.tsx +3 -7
- package/src/integrations/strapi/getPortfolioProjects.test.ts +2 -2
- package/src/integrations/strapi/getPortfolioProjects.ts +0 -3
- package/src/models/PortfolioProject.ts +0 -2
- package/src/models/fpm/FPMProject.ts +8 -0
- package/src/models/strapi/StrapiProject.ts +0 -2
- package/src/rootMessages.de.ts +0 -2
- package/src/rootMessages.en.ts +0 -2
- package/src/slices/ProjectFacts/ProjectFacts.stories.tsx +1 -2
- package/src/slices/ProjectGridCard/ProjectGridCard.test.tsx +54 -0
- package/src/slices/ProjectGridCard/ProjectGridCard.tsx +57 -0
- package/src/slices/ProjectGridCard/index.ts +3 -0
- package/src/slices/ProjectsGrid/ProjectsGrid.stories.tsx +1 -1
- package/src/slices/ProjectsGrid/ProjectsGrid.test.tsx +0 -2
- package/src/slices/ProjectsGrid/ProjectsGrid.tsx +5 -3
- package/src/slices/ProjectsMap/MapMarker.test.tsx +3 -2
- package/src/slices/ProjectsMap/MapMarker.tsx +9 -12
- package/src/slices/ProjectsMap/ProjectsMap.stories.tsx +0 -2
- package/src/slices/ProjectsMap/ProjectsMap.tsx +1 -1
- package/src/slices/TextWithCard/TextWithCard.stories.tsx +2 -3
- package/src/slices/TextWithCard/TextWithCard.tsx +2 -2
- package/src/test/integrationMocks/fpmPortoflioProjectMock.ts +16 -0
- package/src/test/integrationMocks/fpmProjectMock.ts +2 -1
- package/src/test/integrationMocks/portfolioProjectMock.ts +1 -3
- package/src/test/mocks/portfolioProjectMock.ts +0 -2
- package/src/test/strapiMocks/strapiProject.ts +0 -2
- package/dist/components/portfolio/PortfolioProjectCard/PortfolioProjectCard.d.ts +0 -6
- package/dist/components/portfolio/PortfolioProjectCard/index.d.ts +0 -2
- package/dist/components/portfolio/PortfolioProjectCard/messages.de.d.ts +0 -7
- package/dist/components/portfolio/PortfolioProjectCard/messages.en.d.ts +0 -7
- package/dist/models/CreditsAvailableState.d.ts +0 -7
- package/src/components/portfolio/PortfolioProjectCard/PortfolioProjectCard.test.tsx +0 -53
- package/src/components/portfolio/PortfolioProjectCard/PortfolioProjectCard.tsx +0 -69
- package/src/components/portfolio/PortfolioProjectCard/index.ts +0 -3
- package/src/components/portfolio/PortfolioProjectCard/messages.de.ts +0 -8
- package/src/components/portfolio/PortfolioProjectCard/messages.en.ts +0 -8
- package/src/models/CreditsAvailableState.ts +0 -8
package/README.md
CHANGED
|
@@ -37,11 +37,17 @@ For local testing, you can link the package to your project:
|
|
|
37
37
|
```bash
|
|
38
38
|
npm run build
|
|
39
39
|
npm pack
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Go to the project which uses the strapi-slices package and install the package there:
|
|
40
43
|
|
|
44
|
+
```bash
|
|
41
45
|
cd ../path/to/your/project
|
|
42
46
|
npm install ../path/to/strapi-slices-package.tgz
|
|
43
47
|
```
|
|
44
48
|
|
|
49
|
+
Note: The Strapi CMS uses the data from the `fpm-api` for staging.
|
|
50
|
+
|
|
45
51
|
Commit message guideline
|
|
46
52
|
|
|
47
53
|
The project uses the Angular commit message guideline. Find the documentation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { CreditAvailability } from '../../models/fpm/FPMProject';
|
|
3
3
|
export interface CreditsAvailableBadgeProps {
|
|
4
|
-
status:
|
|
4
|
+
status: CreditAvailability;
|
|
5
5
|
href?: string;
|
|
6
6
|
}
|
|
7
7
|
declare const CreditsAvailableBadge: ({ status, href, }: CreditsAvailableBadgeProps) => React.JSX.Element;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { StrapiImage } from '..';
|
|
2
|
-
import CreditsAvailableState from './CreditsAvailableState';
|
|
3
2
|
import FPMProject from './fpm/FPMProject';
|
|
4
3
|
interface PortfolioProject extends FPMProject {
|
|
5
4
|
/** Remember to prefix the slug with portfolioHost */
|
|
6
5
|
slug?: string;
|
|
7
6
|
portfolioHost?: string;
|
|
8
7
|
thumbnail?: StrapiImage | null;
|
|
9
|
-
creditsAvailable?: CreditsAvailableState;
|
|
10
8
|
footerSubTitle?: string;
|
|
11
9
|
}
|
|
12
10
|
export default PortfolioProject;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import Issuer from './Issuer';
|
|
2
|
+
export declare enum CreditAvailability {
|
|
3
|
+
CREDITS_AVAILABLE = "credits_available",
|
|
4
|
+
NO_CREDITS_AVAILABLE = "no_credits_available",
|
|
5
|
+
SOME_CREDITS_AVAILABLE = "some_credits_available",
|
|
6
|
+
SOON_CREDITS_AVAILABLE = "soon_credits_available"
|
|
7
|
+
}
|
|
2
8
|
interface FPMProject {
|
|
3
9
|
id: string;
|
|
4
10
|
title: string;
|
|
@@ -31,6 +37,7 @@ interface FPMProject {
|
|
|
31
37
|
forecastedAmountYearly?: number;
|
|
32
38
|
riskBuffer?: number;
|
|
33
39
|
defaultIssuer?: Issuer;
|
|
40
|
+
creditAvailability: CreditAvailability;
|
|
34
41
|
createdAt: Date;
|
|
35
42
|
updatedAt: Date;
|
|
36
43
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import CreditsAvailableState from '../CreditsAvailableState';
|
|
2
1
|
import Locale from '../Locale';
|
|
3
2
|
import IStrapi from './IStrapi';
|
|
4
3
|
import IStrapiData from './IStrapiData';
|
|
@@ -11,7 +10,6 @@ interface StrapiProject {
|
|
|
11
10
|
slug: string;
|
|
12
11
|
locale: Locale;
|
|
13
12
|
fpmProjectId?: string;
|
|
14
|
-
creditsAvailable?: CreditsAvailableState;
|
|
15
13
|
footerSubTitle?: string;
|
|
16
14
|
createdAt: string;
|
|
17
15
|
updatedAt: string;
|
|
@@ -59,10 +59,6 @@ declare const rootMessagesDe: {
|
|
|
59
59
|
'features.projectInfo.properties.forecastedAmountYear.label': string;
|
|
60
60
|
'features.projectInfo.properties.riskBuffer': string;
|
|
61
61
|
'features.projectInfo.properties.year': string;
|
|
62
|
-
'components.portfolioProjectCard.text.yes': string;
|
|
63
|
-
'components.portfolioProjectCard.text.some': string;
|
|
64
|
-
'components.portfolioProjectCard.text.no': string;
|
|
65
|
-
'components.portfolioProjectCard.text.notYet': string;
|
|
66
62
|
'features.portfolio.documentsDownloadList.projectDocuments': string;
|
|
67
63
|
'features.portfolio.documentsDownloadList.downloadDocument': string;
|
|
68
64
|
'components.creditsAvailableBadge.text.yes': string;
|
|
@@ -59,10 +59,6 @@ declare const rootMessagesEn: {
|
|
|
59
59
|
'features.projectInfo.properties.forecastedAmountYear.toolTip': string;
|
|
60
60
|
'features.projectInfo.properties.riskBuffer': string;
|
|
61
61
|
'features.projectInfo.properties.year': string;
|
|
62
|
-
'components.portfolioProjectCard.text.yes': string;
|
|
63
|
-
'components.portfolioProjectCard.text.some': string;
|
|
64
|
-
'components.portfolioProjectCard.text.no': string;
|
|
65
|
-
'components.portfolioProjectCard.text.notYet': string;
|
|
66
62
|
'features.portfolio.documentsDownloadList.projectDocuments': string;
|
|
67
63
|
'features.portfolio.documentsDownloadList.downloadDocument': string;
|
|
68
64
|
'components.creditsAvailableBadge.text.yes': string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PortfolioProject from '../../models/PortfolioProject';
|
|
3
|
-
import
|
|
3
|
+
import IStrapi from '../../models/strapi/IStrapi';
|
|
4
|
+
import IStrapiData from '../../models/strapi/IStrapiData';
|
|
5
|
+
import StrapiProject from '../../models/strapi/StrapiProject';
|
|
4
6
|
export interface ProjectsGridProps {
|
|
5
7
|
slice: {
|
|
6
8
|
projects: IStrapi<IStrapiData<StrapiProject>[]>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { CreditAvailability } from '../../models/fpm/FPMProject';
|
|
3
3
|
export interface MapMarkerProps {
|
|
4
4
|
title: string;
|
|
5
5
|
isPublic?: boolean;
|
|
6
6
|
projectDeveloper?: string;
|
|
7
7
|
slug?: string;
|
|
8
8
|
portfolioHost?: string;
|
|
9
|
-
|
|
9
|
+
creditAvailability: CreditAvailability;
|
|
10
10
|
}
|
|
11
|
-
declare const MapMarker: ({ title, projectDeveloper, slug,
|
|
11
|
+
declare const MapMarker: ({ title, projectDeveloper, slug, creditAvailability, portfolioHost, isPublic, }: MapMarkerProps) => React.JSX.Element;
|
|
12
12
|
export default MapMarker;
|
|
@@ -534,9 +534,6 @@ var getPortfolioProjects = /*#__PURE__*/function () {
|
|
|
534
534
|
if (strapiProject != null && strapiProject.attributes.slug) {
|
|
535
535
|
toReturn.slug = strapiProject.attributes.slug;
|
|
536
536
|
}
|
|
537
|
-
if (strapiProject != null && strapiProject.attributes.creditsAvailable) {
|
|
538
|
-
toReturn.creditsAvailable = strapiProject == null ? void 0 : strapiProject.attributes.creditsAvailable;
|
|
539
|
-
}
|
|
540
537
|
if (strapiProject != null && strapiProject.attributes.thumbnail) {
|
|
541
538
|
toReturn.thumbnail = strapiProject == null ? void 0 : strapiProject.attributes.thumbnail;
|
|
542
539
|
}
|
|
@@ -2356,51 +2353,51 @@ var CardContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateOb
|
|
|
2356
2353
|
var _templateObject$4;
|
|
2357
2354
|
var GLOBAL_STYLE = /*#__PURE__*/react$1.css(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n :root {\n --default-hero-height: calc(100vh - var(--boemly-space-24));\n }\n\n a {\n text-decoration: none;\n }\n"])));
|
|
2358
2355
|
|
|
2359
|
-
var messagesDe$
|
|
2356
|
+
var messagesDe$e = {
|
|
2360
2357
|
'sections.comparison.backgroundShapes': 'Hintergrundformen'
|
|
2361
2358
|
};
|
|
2362
2359
|
|
|
2363
|
-
var messagesDe$
|
|
2360
|
+
var messagesDe$d = {
|
|
2364
2361
|
'components.creditsAvailableBadge.text.yes': 'Credits verfügbar',
|
|
2365
2362
|
'components.creditsAvailableBadge.text.some': 'Einige verbleibende Credits',
|
|
2366
2363
|
'components.creditsAvailableBadge.text.no': 'Keine verbleibenden Credits',
|
|
2367
|
-
'components.creditsAvailableBadge.text.notYet': '
|
|
2364
|
+
'components.creditsAvailableBadge.text.notYet': 'Credits bald verfügbar'
|
|
2368
2365
|
};
|
|
2369
2366
|
|
|
2370
|
-
var messagesDe$
|
|
2367
|
+
var messagesDe$c = {
|
|
2371
2368
|
'sections.cta.backgroundShapes': 'Dunkle Hintergrundformen',
|
|
2372
2369
|
'sections.cta.backgroundShapesLight': 'Helle Hintergrundformen'
|
|
2373
2370
|
};
|
|
2374
2371
|
|
|
2375
|
-
var messagesDe$
|
|
2372
|
+
var messagesDe$b = {
|
|
2376
2373
|
'sections.customerCard.more': 'Weiterlesen'
|
|
2377
2374
|
};
|
|
2378
2375
|
|
|
2379
|
-
var messagesDe$
|
|
2376
|
+
var messagesDe$a = {
|
|
2380
2377
|
'sections.customerQuoteCard.more': 'Weiterlesen'
|
|
2381
2378
|
};
|
|
2382
2379
|
|
|
2383
|
-
var messagesDe$
|
|
2380
|
+
var messagesDe$9 = {
|
|
2384
2381
|
'sections.glossary.copyButtonLabel': 'Kopiere den Link zu diesem Abschnitt in die Zwischenablage',
|
|
2385
2382
|
'sections.glossary.copySuccessMessage': 'Link in die Zwischenablage kopiert',
|
|
2386
2383
|
'sections.glossary.copyFailureMessage': 'Link konnte nicht in die Zwischenablage kopiert werden'
|
|
2387
2384
|
};
|
|
2388
2385
|
|
|
2389
|
-
var messagesDe$
|
|
2386
|
+
var messagesDe$8 = {
|
|
2390
2387
|
'features.portfolio.documentsDownloadList.projectDocuments': 'Projektdokumente',
|
|
2391
2388
|
'features.portfolio.documentsDownloadList.downloadDocument': 'Dokument herunterladen'
|
|
2392
2389
|
};
|
|
2393
2390
|
|
|
2394
|
-
var messagesDe$
|
|
2391
|
+
var messagesDe$7 = {
|
|
2395
2392
|
'sections.projectFacts.projectInfo.value': 'Projekt Infos',
|
|
2396
2393
|
'projects.projectFacts.properties.area': 'Fläche'
|
|
2397
2394
|
};
|
|
2398
2395
|
|
|
2399
|
-
var messagesDe$
|
|
2396
|
+
var messagesDe$6 = {
|
|
2400
2397
|
'sections.projectsMap.link.text': 'Mehr Infos'
|
|
2401
2398
|
};
|
|
2402
2399
|
|
|
2403
|
-
var messagesDe$
|
|
2400
|
+
var messagesDe$5 = {
|
|
2404
2401
|
'features.projectInfo.projectInfo.value': 'Projekt Infos',
|
|
2405
2402
|
'features.projectInfo.properties.area': 'Projekt Fläche',
|
|
2406
2403
|
'features.projectInfo.properties.location': 'Standort',
|
|
@@ -2417,13 +2414,6 @@ var messagesDe$6 = {
|
|
|
2417
2414
|
'features.projectInfo.properties.year': '{years} {years, plural, one {Jahr} other {Jahre} }'
|
|
2418
2415
|
};
|
|
2419
2416
|
|
|
2420
|
-
var messagesDe$5 = {
|
|
2421
|
-
'components.portfolioProjectCard.text.yes': 'Credits verfügbar',
|
|
2422
|
-
'components.portfolioProjectCard.text.some': 'Einige verbleibende Credits',
|
|
2423
|
-
'components.portfolioProjectCard.text.no': 'Keine verbleibenden Credits',
|
|
2424
|
-
'components.portfolioProjectCard.text.notYet': 'Gutschriften bald verfügbar'
|
|
2425
|
-
};
|
|
2426
|
-
|
|
2427
2417
|
var messagesDe$4 = {
|
|
2428
2418
|
'portfolio.smallCheckout.price.taxNotIncluded': 'ohne Steuern',
|
|
2429
2419
|
'portfolio.smallCheckout.price.taxIncluded': 'Preis inklusive Steuern: {number}',
|
|
@@ -2474,53 +2464,53 @@ var unitMessagesDe = {
|
|
|
2474
2464
|
'unit.formatter.tonsCo2PerYear': '{number} tCO₂/Jahr'
|
|
2475
2465
|
};
|
|
2476
2466
|
|
|
2477
|
-
var rootMessagesDe = /*#__PURE__*/_extends({}, messagesDe$
|
|
2467
|
+
var rootMessagesDe = /*#__PURE__*/_extends({}, messagesDe$d, messagesDe$8, messagesDe$5, messagesDe$4, messagesDe$e, messagesDe$c, messagesDe$b, messagesDe$a, messagesDe$9, messagesDe$7, messagesDe$6, messagesDe$3, messagesDe$2, messagesDe$1, unitMessagesDe);
|
|
2478
2468
|
|
|
2479
|
-
var messagesEn$
|
|
2469
|
+
var messagesEn$c = {
|
|
2480
2470
|
'sections.comparison.backgroundShapes': 'Background shapes'
|
|
2481
2471
|
};
|
|
2482
2472
|
|
|
2483
|
-
var messagesEn$
|
|
2473
|
+
var messagesEn$b = {
|
|
2484
2474
|
'components.creditsAvailableBadge.text.yes': 'Credits available',
|
|
2485
2475
|
'components.creditsAvailableBadge.text.some': 'Some remaining credits',
|
|
2486
2476
|
'components.creditsAvailableBadge.text.no': 'No remaining credits',
|
|
2487
2477
|
'components.creditsAvailableBadge.text.notYet': 'Credits available soon'
|
|
2488
2478
|
};
|
|
2489
2479
|
|
|
2490
|
-
var messagesEn$
|
|
2480
|
+
var messagesEn$a = {
|
|
2491
2481
|
'sections.cta.backgroundShapesDark': 'Dark background shapes',
|
|
2492
2482
|
'sections.cta.backgroundShapesLight': 'Light background shapes'
|
|
2493
2483
|
};
|
|
2494
2484
|
|
|
2495
|
-
var messagesEn$
|
|
2485
|
+
var messagesEn$9 = {
|
|
2496
2486
|
'sections.customerCard.more': 'Read more'
|
|
2497
2487
|
};
|
|
2498
2488
|
|
|
2499
|
-
var messagesEn$
|
|
2489
|
+
var messagesEn$8 = {
|
|
2500
2490
|
'sections.customerQuoteCard.more': 'Read more'
|
|
2501
2491
|
};
|
|
2502
2492
|
|
|
2503
|
-
var messagesEn$
|
|
2493
|
+
var messagesEn$7 = {
|
|
2504
2494
|
'sections.glossary.copyButtonLabel': 'Copy a link to this section to your clipboard',
|
|
2505
2495
|
'sections.glossary.copySuccessMessage': 'Copied the link to your clipboard',
|
|
2506
2496
|
'sections.glossary.copyFailureMessage': 'Could not copy link to clipboard'
|
|
2507
2497
|
};
|
|
2508
2498
|
|
|
2509
|
-
var messagesEn$
|
|
2499
|
+
var messagesEn$6 = {
|
|
2510
2500
|
'features.portfolio.documentsDownloadList.projectDocuments': 'Project documents',
|
|
2511
2501
|
'features.portfolio.documentsDownloadList.downloadDocument': 'Download document'
|
|
2512
2502
|
};
|
|
2513
2503
|
|
|
2514
|
-
var messagesEn$
|
|
2504
|
+
var messagesEn$5 = {
|
|
2515
2505
|
'sections.projectFacts.projectInfo.value': 'Project Infos',
|
|
2516
2506
|
'projects.projectFacts.properties.area': 'Area'
|
|
2517
2507
|
};
|
|
2518
2508
|
|
|
2519
|
-
var messagesEn$
|
|
2509
|
+
var messagesEn$4 = {
|
|
2520
2510
|
'sections.projectsMap.link.text': 'Show more info'
|
|
2521
2511
|
};
|
|
2522
2512
|
|
|
2523
|
-
var messagesEn$
|
|
2513
|
+
var messagesEn$3 = {
|
|
2524
2514
|
'features.projectInfo.projectInfo.value': 'Project Infos',
|
|
2525
2515
|
'features.projectInfo.properties.area': 'Project Area',
|
|
2526
2516
|
'features.projectInfo.properties.location': 'Location',
|
|
@@ -2537,13 +2527,6 @@ var messagesEn$4 = {
|
|
|
2537
2527
|
'features.projectInfo.properties.year': '{years} {years, plural, one {year} other {years} }'
|
|
2538
2528
|
};
|
|
2539
2529
|
|
|
2540
|
-
var messagesEn$3 = {
|
|
2541
|
-
'components.portfolioProjectCard.text.yes': 'Credits available',
|
|
2542
|
-
'components.portfolioProjectCard.text.some': 'Some remaining credits',
|
|
2543
|
-
'components.portfolioProjectCard.text.no': 'No remaining credits',
|
|
2544
|
-
'components.portfolioProjectCard.text.notYet': 'Credits available soon'
|
|
2545
|
-
};
|
|
2546
|
-
|
|
2547
2530
|
var messagesEn$2 = {
|
|
2548
2531
|
'portfolio.smallCheckout.price.taxNotIncluded': 'not including tax',
|
|
2549
2532
|
'portfolio.smallCheckout.price.taxIncluded': 'Price including tax: {number}',
|
|
@@ -2594,7 +2577,7 @@ var unitMessagesEn = {
|
|
|
2594
2577
|
'unit.formatter.tonsCo2PerYear': '{number} tCO₂/year'
|
|
2595
2578
|
};
|
|
2596
2579
|
|
|
2597
|
-
var rootMessagesEn = /*#__PURE__*/_extends({}, messagesEn$
|
|
2580
|
+
var rootMessagesEn = /*#__PURE__*/_extends({}, messagesEn$b, messagesEn$6, messagesEn$3, messagesEn$2, messagesEn$c, messagesEn$a, messagesEn$9, messagesEn$8, messagesEn$7, messagesEn$5, messagesEn$4, messagesEn$1, messagesDe, messagesEn, unitMessagesEn);
|
|
2598
2581
|
|
|
2599
2582
|
var messages = {
|
|
2600
2583
|
en: rootMessagesEn,
|
|
@@ -2890,15 +2873,6 @@ var TextWithTextCards = function TextWithTextCards(_ref) {
|
|
|
2890
2873
|
}))));
|
|
2891
2874
|
};
|
|
2892
2875
|
|
|
2893
|
-
var CreditsAvailableState;
|
|
2894
|
-
(function (CreditsAvailableState) {
|
|
2895
|
-
CreditsAvailableState["YES"] = "yes";
|
|
2896
|
-
CreditsAvailableState["SOME"] = "some";
|
|
2897
|
-
CreditsAvailableState["NO"] = "no";
|
|
2898
|
-
CreditsAvailableState["NOT_YET"] = "notYet";
|
|
2899
|
-
})(CreditsAvailableState || (CreditsAvailableState = {}));
|
|
2900
|
-
var CreditsAvailableState$1 = CreditsAvailableState;
|
|
2901
|
-
|
|
2902
2876
|
var FORMAT_AS_HECTARE_CONFIG = {
|
|
2903
2877
|
unit: 'hectare',
|
|
2904
2878
|
unitDisplay: 'short',
|
|
@@ -2910,41 +2884,98 @@ var FORMAT_AS_PERCENT_CONFIG = {
|
|
|
2910
2884
|
maximumFractionDigits: 2
|
|
2911
2885
|
};
|
|
2912
2886
|
|
|
2913
|
-
var
|
|
2914
|
-
|
|
2915
|
-
|
|
2887
|
+
var CreditAvailability;
|
|
2888
|
+
(function (CreditAvailability) {
|
|
2889
|
+
CreditAvailability["CREDITS_AVAILABLE"] = "credits_available";
|
|
2890
|
+
CreditAvailability["NO_CREDITS_AVAILABLE"] = "no_credits_available";
|
|
2891
|
+
CreditAvailability["SOME_CREDITS_AVAILABLE"] = "some_credits_available";
|
|
2892
|
+
CreditAvailability["SOON_CREDITS_AVAILABLE"] = "soon_credits_available";
|
|
2893
|
+
})(CreditAvailability || (CreditAvailability = {}));
|
|
2894
|
+
|
|
2895
|
+
var CreditsAvailableBadge = function CreditsAvailableBadge(_ref) {
|
|
2896
|
+
var _variants;
|
|
2897
|
+
var status = _ref.status,
|
|
2898
|
+
href = _ref.href;
|
|
2916
2899
|
var _useContext = React.useContext(IntlContext),
|
|
2917
|
-
formatMessage = _useContext.formatMessage
|
|
2900
|
+
formatMessage = _useContext.formatMessage;
|
|
2901
|
+
var variants = (_variants = {}, _variants[CreditAvailability.CREDITS_AVAILABLE] = {
|
|
2902
|
+
message: formatMessage({
|
|
2903
|
+
id: 'components.creditsAvailableBadge.text.yes'
|
|
2904
|
+
}),
|
|
2905
|
+
color: 'var(--boemly-colors-primary-800)'
|
|
2906
|
+
}, _variants[CreditAvailability.NO_CREDITS_AVAILABLE] = {
|
|
2907
|
+
message: formatMessage({
|
|
2908
|
+
id: 'components.creditsAvailableBadge.text.no'
|
|
2909
|
+
}),
|
|
2910
|
+
color: 'var(--boemly-colors-red-600)'
|
|
2911
|
+
}, _variants[CreditAvailability.SOME_CREDITS_AVAILABLE] = {
|
|
2912
|
+
message: formatMessage({
|
|
2913
|
+
id: 'components.creditsAvailableBadge.text.some'
|
|
2914
|
+
}),
|
|
2915
|
+
color: 'var(--boemly-colors-orange-500)'
|
|
2916
|
+
}, _variants[CreditAvailability.SOON_CREDITS_AVAILABLE] = {
|
|
2917
|
+
message: formatMessage({
|
|
2918
|
+
id: 'components.creditsAvailableBadge.text.notYet'
|
|
2919
|
+
}),
|
|
2920
|
+
color: 'var(--boemly-colors-blue-500)'
|
|
2921
|
+
}, _variants);
|
|
2922
|
+
var variant = variants[status];
|
|
2923
|
+
return React__default.default.createElement(boemly.Flex, {
|
|
2924
|
+
justifyContent: "flex-start",
|
|
2925
|
+
as: href ? Link__default.default : undefined,
|
|
2926
|
+
href: href
|
|
2927
|
+
}, React__default.default.createElement(boemly.Tag, {
|
|
2928
|
+
backgroundColor: variant.color,
|
|
2929
|
+
mt: "2",
|
|
2930
|
+
mb: "1"
|
|
2931
|
+
}, React__default.default.createElement(react.Info, {
|
|
2932
|
+
size: 12,
|
|
2933
|
+
color: "white",
|
|
2934
|
+
weight: "fill"
|
|
2935
|
+
}), React__default.default.createElement(boemly.Spacer, {
|
|
2936
|
+
width: "1"
|
|
2937
|
+
}), React__default.default.createElement(boemly.Text, {
|
|
2938
|
+
color: "white",
|
|
2939
|
+
size: "xsLowBold"
|
|
2940
|
+
}, variant.message)));
|
|
2941
|
+
};
|
|
2942
|
+
|
|
2943
|
+
var ProjectGridCard = function ProjectGridCard(_ref) {
|
|
2944
|
+
var _project$thumbnail, _project$thumbnail2, _project$thumbnail3;
|
|
2945
|
+
var project = _ref.project;
|
|
2946
|
+
var _useContext = React.useContext(reactIntl.IntlContext),
|
|
2918
2947
|
formatNumber = _useContext.formatNumber;
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
}
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
})
|
|
2948
|
+
return React__default.default.createElement(boemly.Container, null, React__default.default.createElement(boemly.Flex, {
|
|
2949
|
+
flexDir: "column",
|
|
2950
|
+
height: "full"
|
|
2951
|
+
}, project.thumbnail && React__default.default.createElement(boemly.Box, {
|
|
2952
|
+
borderRadius: "xl",
|
|
2953
|
+
position: "relative",
|
|
2954
|
+
height: "36",
|
|
2955
|
+
mb: "2"
|
|
2956
|
+
}, React__default.default.createElement(Image__default.default, {
|
|
2957
|
+
src: strapiMediaUrl((_project$thumbnail = project.thumbnail) == null ? void 0 : _project$thumbnail.img, 'medium'),
|
|
2958
|
+
alt: (_project$thumbnail2 = project.thumbnail) == null ? void 0 : _project$thumbnail2.alt,
|
|
2959
|
+
fill: true,
|
|
2960
|
+
style: {
|
|
2961
|
+
objectFit: ((_project$thumbnail3 = project.thumbnail) == null ? void 0 : _project$thumbnail3.objectFit) || 'cover',
|
|
2962
|
+
borderRadius: 'var(--boemly-radii-xl)'
|
|
2963
|
+
}
|
|
2964
|
+
})), React__default.default.createElement(boemly.Heading, {
|
|
2965
|
+
my: "4",
|
|
2966
|
+
size: "lg"
|
|
2967
|
+
}, project.title), React__default.default.createElement(boemly.Flex, {
|
|
2968
|
+
flexDir: "row",
|
|
2969
|
+
gap: "2"
|
|
2970
|
+
}, React__default.default.createElement(boemly.Tag, null, React__default.default.createElement(boemly.Text, {
|
|
2971
|
+
size: "xsLowBold",
|
|
2972
|
+
color: "gray.800"
|
|
2973
|
+
}, formatNumber((project.area || 0) / 10000, FORMAT_AS_HECTARE_CONFIG))), React__default.default.createElement(boemly.Tag, null, React__default.default.createElement(boemly.Text, {
|
|
2974
|
+
size: "xsLowBold",
|
|
2975
|
+
color: "gray.800"
|
|
2976
|
+
}, project.location))), React__default.default.createElement(CreditsAvailableBadge, {
|
|
2977
|
+
status: project.creditAvailability
|
|
2978
|
+
})));
|
|
2948
2979
|
};
|
|
2949
2980
|
|
|
2950
2981
|
var TextWithCard = function TextWithCard(_ref) {
|
|
@@ -2959,7 +2990,7 @@ var TextWithCard = function TextWithCard(_ref) {
|
|
|
2959
2990
|
rowSpan: 1,
|
|
2960
2991
|
position: "relative",
|
|
2961
2992
|
"data-testid": "card-position-" + slice.cardPosition
|
|
2962
|
-
}, portfolioProject && React__default.default.createElement(
|
|
2993
|
+
}, portfolioProject && React__default.default.createElement(ProjectGridCard, {
|
|
2963
2994
|
project: portfolioProject
|
|
2964
2995
|
}), !portfolioProject && slice.card && React__default.default.createElement(boemly.ProjectCard, {
|
|
2965
2996
|
facts: slice.card.facts,
|
|
@@ -3253,7 +3284,7 @@ var ProjectsGrid = function ProjectsGrid(_ref2) {
|
|
|
3253
3284
|
_hover: {
|
|
3254
3285
|
boxShadow: 'lg'
|
|
3255
3286
|
}
|
|
3256
|
-
}, React__default.default.createElement(
|
|
3287
|
+
}, React__default.default.createElement(ProjectGridCard, {
|
|
3257
3288
|
project: project
|
|
3258
3289
|
})));
|
|
3259
3290
|
}))));
|
|
@@ -3307,47 +3338,11 @@ var MinimalProviders = function MinimalProviders(_ref) {
|
|
|
3307
3338
|
}, children));
|
|
3308
3339
|
};
|
|
3309
3340
|
|
|
3310
|
-
var CreditsAvailableBadge = function CreditsAvailableBadge(_ref) {
|
|
3311
|
-
var _variants;
|
|
3312
|
-
var status = _ref.status,
|
|
3313
|
-
href = _ref.href;
|
|
3314
|
-
var _useContext = React.useContext(IntlContext),
|
|
3315
|
-
formatMessage = _useContext.formatMessage;
|
|
3316
|
-
var variants = (_variants = {}, _variants[CreditsAvailableState$1.YES] = {
|
|
3317
|
-
color: 'green',
|
|
3318
|
-
text: formatMessage({
|
|
3319
|
-
id: 'components.creditsAvailableBadge.text.yes'
|
|
3320
|
-
})
|
|
3321
|
-
}, _variants[CreditsAvailableState$1.SOME] = {
|
|
3322
|
-
color: 'orange',
|
|
3323
|
-
text: formatMessage({
|
|
3324
|
-
id: 'components.creditsAvailableBadge.text.some'
|
|
3325
|
-
})
|
|
3326
|
-
}, _variants[CreditsAvailableState$1.NO] = {
|
|
3327
|
-
color: 'red',
|
|
3328
|
-
text: formatMessage({
|
|
3329
|
-
id: 'components.creditsAvailableBadge.text.no'
|
|
3330
|
-
})
|
|
3331
|
-
}, _variants[CreditsAvailableState$1.NOT_YET] = {
|
|
3332
|
-
color: 'blue',
|
|
3333
|
-
text: formatMessage({
|
|
3334
|
-
id: 'components.creditsAvailableBadge.text.notYet'
|
|
3335
|
-
})
|
|
3336
|
-
}, _variants);
|
|
3337
|
-
var variant = variants[status];
|
|
3338
|
-
return React__default.default.createElement(boemly.Badge, {
|
|
3339
|
-
as: href ? Link__default.default : undefined,
|
|
3340
|
-
href: href,
|
|
3341
|
-
colorScheme: variant.color,
|
|
3342
|
-
width: "fit-content"
|
|
3343
|
-
}, variant.text);
|
|
3344
|
-
};
|
|
3345
|
-
|
|
3346
3341
|
var MapMarker = function MapMarker(_ref) {
|
|
3347
3342
|
var title = _ref.title,
|
|
3348
3343
|
projectDeveloper = _ref.projectDeveloper,
|
|
3349
3344
|
slug = _ref.slug,
|
|
3350
|
-
|
|
3345
|
+
creditAvailability = _ref.creditAvailability,
|
|
3351
3346
|
_ref$portfolioHost = _ref.portfolioHost,
|
|
3352
3347
|
portfolioHost = _ref$portfolioHost === void 0 ? '' : _ref$portfolioHost,
|
|
3353
3348
|
_ref$isPublic = _ref.isPublic,
|
|
@@ -3381,12 +3376,12 @@ var MapMarker = function MapMarker(_ref) {
|
|
|
3381
3376
|
maxWidth: ['3xs', null, null, 'sm']
|
|
3382
3377
|
}, React__default.default.createElement(boemly.Flex, {
|
|
3383
3378
|
direction: "column"
|
|
3384
|
-
},
|
|
3385
|
-
status:
|
|
3379
|
+
}, React__default.default.createElement(CreditsAvailableBadge, {
|
|
3380
|
+
status: creditAvailability,
|
|
3386
3381
|
href: slug && portfolioHost + "/portfolio/" + slug
|
|
3387
|
-
}), React__default.default.createElement(boemly.
|
|
3382
|
+
}), React__default.default.createElement(boemly.Spacer, {
|
|
3388
3383
|
height: "3"
|
|
3389
|
-
})
|
|
3384
|
+
}), React__default.default.createElement(boemly.Heading, {
|
|
3390
3385
|
size: "md"
|
|
3391
3386
|
}, title), projectDeveloper && React__default.default.createElement(boemly.Text, {
|
|
3392
3387
|
size: "smLowNormal",
|
|
@@ -3450,7 +3445,7 @@ var ProjectsMap = function ProjectsMap(_ref) {
|
|
|
3450
3445
|
isPublic: project.isPublic,
|
|
3451
3446
|
portfolioHost: project.portfolioHost,
|
|
3452
3447
|
slug: project.slug,
|
|
3453
|
-
|
|
3448
|
+
creditAvailability: project.creditAvailability,
|
|
3454
3449
|
projectDeveloper: (_project$projectDevel = project.projectDeveloper) == null ? void 0 : _project$projectDevel.name
|
|
3455
3450
|
})));
|
|
3456
3451
|
// Offset is needed to center the marker on the coordinates
|
|
@@ -4919,11 +4914,11 @@ var ProjectInfo = function ProjectInfo(_ref) {
|
|
|
4919
4914
|
}),
|
|
4920
4915
|
text: formatNumber(project.riskBuffer / 100, FORMAT_AS_PERCENT_CONFIG),
|
|
4921
4916
|
caption: subtitles.riskBufferSubtitle
|
|
4922
|
-
})))) : React__default.default.createElement(React__default.default.Fragment, null),
|
|
4917
|
+
})))) : React__default.default.createElement(React__default.default.Fragment, null), React__default.default.createElement(boemly.Box, {
|
|
4923
4918
|
mt: "2"
|
|
4924
4919
|
}, React__default.default.createElement(CreditsAvailableBadge, {
|
|
4925
|
-
status: project.
|
|
4926
|
-
}))
|
|
4920
|
+
status: project.creditAvailability
|
|
4921
|
+
})));
|
|
4927
4922
|
};
|
|
4928
4923
|
|
|
4929
4924
|
var DocumentsDownloadList = function DocumentsDownloadList(_ref) {
|