diff options
author | 2019-06-13 15:16:57 +0200 | |
---|---|---|
committer | 2019-06-13 15:16:57 +0200 | |
commit | 97852499feba82003021c501b97b075e11647f5e (patch) | |
tree | 1cbd4031cc8a3910e511a1013a2af54fc38bc353 | |
parent | Improve serviceLimit implementation (diff) | |
download | ferdium-app-97852499feba82003021c501b97b075e11647f5e.tar.gz ferdium-app-97852499feba82003021c501b97b075e11647f5e.tar.zst ferdium-app-97852499feba82003021c501b97b075e11647f5e.zip |
Add "service limit reached" screen
-rw-r--r-- | src/components/services/content/ServiceRestricted.js | 54 | ||||
-rw-r--r-- | src/components/services/content/ServiceView.js | 25 | ||||
-rw-r--r-- | src/components/services/content/Services.js | 1 | ||||
-rw-r--r-- | src/i18n/locales/defaultMessages.json | 174 | ||||
-rw-r--r-- | src/i18n/locales/en-US.json | 3 | ||||
-rw-r--r-- | src/i18n/messages/src/components/services/content/ServiceRestricted.json | 41 | ||||
-rw-r--r-- | src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json | 32 | ||||
-rw-r--r-- | src/models/Service.js | 2 | ||||
-rw-r--r-- | src/stores/ServicesStore.js | 24 |
9 files changed, 268 insertions, 88 deletions
diff --git a/src/components/services/content/ServiceRestricted.js b/src/components/services/content/ServiceRestricted.js new file mode 100644 index 000000000..9fb7d0961 --- /dev/null +++ b/src/components/services/content/ServiceRestricted.js | |||
@@ -0,0 +1,54 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | import { defineMessages, intlShape } from 'react-intl'; | ||
5 | |||
6 | import { serviceLimitStore } from '../../../features/serviceLimit'; | ||
7 | import Button from '../../ui/Button'; | ||
8 | |||
9 | const messages = defineMessages({ | ||
10 | headline: { | ||
11 | id: 'service.restrictedHandler.headline', | ||
12 | defaultMessage: '!!!You have reached your service limit.', | ||
13 | }, | ||
14 | text: { | ||
15 | id: 'service.restrictedHandler.text', | ||
16 | defaultMessage: '!!!Please upgrade your account to use more than {count} services.', | ||
17 | }, | ||
18 | action: { | ||
19 | id: 'service.restrictedHandler.action', | ||
20 | defaultMessage: '!!!Upgrade Account', | ||
21 | }, | ||
22 | }); | ||
23 | |||
24 | export default @observer class ServiceRestricted extends Component { | ||
25 | static propTypes = { | ||
26 | name: PropTypes.string.isRequired, | ||
27 | upgrade: PropTypes.func.isRequired, | ||
28 | }; | ||
29 | |||
30 | static contextTypes = { | ||
31 | intl: intlShape, | ||
32 | }; | ||
33 | |||
34 | countdownInterval = null; | ||
35 | |||
36 | countdownIntervalTimeout = 1000; | ||
37 | |||
38 | render() { | ||
39 | const { name, upgrade } = this.props; | ||
40 | const { intl } = this.context; | ||
41 | |||
42 | return ( | ||
43 | <div className="services__info-layer"> | ||
44 | <h1>{intl.formatMessage(messages.headline)}</h1> | ||
45 | <p>{intl.formatMessage(messages.text, { count: serviceLimitStore.serviceLimit })}</p> | ||
46 | <Button | ||
47 | label={intl.formatMessage(messages.action, { name })} | ||
48 | buttonType="inverted" | ||
49 | onClick={() => upgrade()} | ||
50 | /> | ||
51 | </div> | ||
52 | ); | ||
53 | } | ||
54 | } | ||
diff --git a/src/components/services/content/ServiceView.js b/src/components/services/content/ServiceView.js index 13148b9b3..18279fd06 100644 --- a/src/components/services/content/ServiceView.js +++ b/src/components/services/content/ServiceView.js | |||
@@ -10,6 +10,7 @@ import WebviewLoader from '../../ui/WebviewLoader'; | |||
10 | import WebviewCrashHandler from './WebviewCrashHandler'; | 10 | import WebviewCrashHandler from './WebviewCrashHandler'; |
11 | import WebviewErrorHandler from './ErrorHandlers/WebviewErrorHandler'; | 11 | import WebviewErrorHandler from './ErrorHandlers/WebviewErrorHandler'; |
12 | import ServiceDisabled from './ServiceDisabled'; | 12 | import ServiceDisabled from './ServiceDisabled'; |
13 | import ServiceRestricted from './ServiceRestricted'; | ||
13 | import ServiceWebview from './ServiceWebview'; | 14 | import ServiceWebview from './ServiceWebview'; |
14 | 15 | ||
15 | export default @observer class ServiceView extends Component { | 16 | export default @observer class ServiceView extends Component { |
@@ -21,6 +22,7 @@ export default @observer class ServiceView extends Component { | |||
21 | edit: PropTypes.func.isRequired, | 22 | edit: PropTypes.func.isRequired, |
22 | enable: PropTypes.func.isRequired, | 23 | enable: PropTypes.func.isRequired, |
23 | isActive: PropTypes.bool, | 24 | isActive: PropTypes.bool, |
25 | upgrade: PropTypes.func.isRequired, | ||
24 | }; | 26 | }; |
25 | 27 | ||
26 | static defaultProps = { | 28 | static defaultProps = { |
@@ -72,6 +74,7 @@ export default @observer class ServiceView extends Component { | |||
72 | reload, | 74 | reload, |
73 | edit, | 75 | edit, |
74 | enable, | 76 | enable, |
77 | upgrade, | ||
75 | } = this.props; | 78 | } = this.props; |
76 | 79 | ||
77 | const webviewClasses = classnames({ | 80 | const webviewClasses = classnames({ |
@@ -99,7 +102,7 @@ export default @observer class ServiceView extends Component { | |||
99 | reload={reload} | 102 | reload={reload} |
100 | /> | 103 | /> |
101 | )} | 104 | )} |
102 | {service.isEnabled && service.isLoading && service.isFirstLoad && ( | 105 | {service.isEnabled && service.isLoading && service.isFirstLoad && !service.isServiceAccessRestricted && ( |
103 | <WebviewLoader | 106 | <WebviewLoader |
104 | loaded={false} | 107 | loaded={false} |
105 | name={service.name} | 108 | name={service.name} |
@@ -126,11 +129,21 @@ export default @observer class ServiceView extends Component { | |||
126 | )} | 129 | )} |
127 | </Fragment> | 130 | </Fragment> |
128 | ) : ( | 131 | ) : ( |
129 | <ServiceWebview | 132 | <> |
130 | service={service} | 133 | {service.isServiceAccessRestricted ? ( |
131 | setWebviewReference={setWebviewReference} | 134 | <ServiceRestricted |
132 | detachService={detachService} | 135 | name={service.recipe.name} |
133 | /> | 136 | webview={service.webview} |
137 | upgrade={upgrade} | ||
138 | /> | ||
139 | ) : ( | ||
140 | <ServiceWebview | ||
141 | service={service} | ||
142 | setWebviewReference={setWebviewReference} | ||
143 | detachService={detachService} | ||
144 | /> | ||
145 | )} | ||
146 | </> | ||
134 | )} | 147 | )} |
135 | {statusBar} | 148 | {statusBar} |
136 | </div> | 149 | </div> |
diff --git a/src/components/services/content/Services.js b/src/components/services/content/Services.js index 8f8c38a11..48de0ebaa 100644 --- a/src/components/services/content/Services.js +++ b/src/components/services/content/Services.js | |||
@@ -89,6 +89,7 @@ export default @observer class Services extends Component { | |||
89 | }, | 89 | }, |
90 | redirect: false, | 90 | redirect: false, |
91 | })} | 91 | })} |
92 | upgrade={() => openSettings({ path: 'user' })} | ||
92 | /> | 93 | /> |
93 | ))} | 94 | ))} |
94 | </div> | 95 | </div> |
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index a5572bd32..533944fd0 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json | |||
@@ -894,6 +894,50 @@ | |||
894 | { | 894 | { |
895 | "descriptors": [ | 895 | "descriptors": [ |
896 | { | 896 | { |
897 | "defaultMessage": "!!!You have reached your service limit.", | ||
898 | "end": { | ||
899 | "column": 3, | ||
900 | "line": 13 | ||
901 | }, | ||
902 | "file": "src/components/services/content/ServiceRestricted.js", | ||
903 | "id": "service.restrictedHandler.headline", | ||
904 | "start": { | ||
905 | "column": 12, | ||
906 | "line": 10 | ||
907 | } | ||
908 | }, | ||
909 | { | ||
910 | "defaultMessage": "!!!Please upgrade your account to use more than {count} services.", | ||
911 | "end": { | ||
912 | "column": 3, | ||
913 | "line": 17 | ||
914 | }, | ||
915 | "file": "src/components/services/content/ServiceRestricted.js", | ||
916 | "id": "service.restrictedHandler.text", | ||
917 | "start": { | ||
918 | "column": 8, | ||
919 | "line": 14 | ||
920 | } | ||
921 | }, | ||
922 | { | ||
923 | "defaultMessage": "!!!Upgrade Account", | ||
924 | "end": { | ||
925 | "column": 3, | ||
926 | "line": 21 | ||
927 | }, | ||
928 | "file": "src/components/services/content/ServiceRestricted.js", | ||
929 | "id": "service.restrictedHandler.action", | ||
930 | "start": { | ||
931 | "column": 10, | ||
932 | "line": 18 | ||
933 | } | ||
934 | } | ||
935 | ], | ||
936 | "path": "src/components/services/content/ServiceRestricted.json" | ||
937 | }, | ||
938 | { | ||
939 | "descriptors": [ | ||
940 | { | ||
897 | "defaultMessage": "!!!Welcome to Franz", | 941 | "defaultMessage": "!!!Welcome to Franz", |
898 | "end": { | 942 | "end": { |
899 | "column": 3, | 943 | "column": 3, |
@@ -1307,104 +1351,104 @@ | |||
1307 | "defaultMessage": "!!!Available services", | 1351 | "defaultMessage": "!!!Available services", |
1308 | "end": { | 1352 | "end": { |
1309 | "column": 3, | 1353 | "column": 3, |
1310 | "line": 16 | 1354 | "line": 17 |
1311 | }, | 1355 | }, |
1312 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 1356 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
1313 | "id": "settings.navigation.availableServices", | 1357 | "id": "settings.navigation.availableServices", |
1314 | "start": { | 1358 | "start": { |
1315 | "column": 21, | 1359 | "column": 21, |
1316 | "line": 13 | 1360 | "line": 14 |
1317 | } | 1361 | } |
1318 | }, | 1362 | }, |
1319 | { | 1363 | { |
1320 | "defaultMessage": "!!!Your services", | 1364 | "defaultMessage": "!!!Your services", |
1321 | "end": { | 1365 | "end": { |
1322 | "column": 3, | 1366 | "column": 3, |
1323 | "line": 20 | 1367 | "line": 21 |
1324 | }, | 1368 | }, |
1325 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 1369 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
1326 | "id": "settings.navigation.yourServices", | 1370 | "id": "settings.navigation.yourServices", |
1327 | "start": { | 1371 | "start": { |
1328 | "column": 16, | 1372 | "column": 16, |
1329 | "line": 17 | 1373 | "line": 18 |
1330 | } | 1374 | } |
1331 | }, | 1375 | }, |
1332 | { | 1376 | { |
1333 | "defaultMessage": "!!!Your workspaces", | 1377 | "defaultMessage": "!!!Your workspaces", |
1334 | "end": { | 1378 | "end": { |
1335 | "column": 3, | 1379 | "column": 3, |
1336 | "line": 24 | 1380 | "line": 25 |
1337 | }, | 1381 | }, |
1338 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 1382 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
1339 | "id": "settings.navigation.yourWorkspaces", | 1383 | "id": "settings.navigation.yourWorkspaces", |
1340 | "start": { | 1384 | "start": { |
1341 | "column": 18, | 1385 | "column": 18, |
1342 | "line": 21 | 1386 | "line": 22 |
1343 | } | 1387 | } |
1344 | }, | 1388 | }, |
1345 | { | 1389 | { |
1346 | "defaultMessage": "!!!Account", | 1390 | "defaultMessage": "!!!Account", |
1347 | "end": { | 1391 | "end": { |
1348 | "column": 3, | 1392 | "column": 3, |
1349 | "line": 28 | 1393 | "line": 29 |
1350 | }, | 1394 | }, |
1351 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 1395 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
1352 | "id": "settings.navigation.account", | 1396 | "id": "settings.navigation.account", |
1353 | "start": { | 1397 | "start": { |
1354 | "column": 11, | 1398 | "column": 11, |
1355 | "line": 25 | 1399 | "line": 26 |
1356 | } | 1400 | } |
1357 | }, | 1401 | }, |
1358 | { | 1402 | { |
1359 | "defaultMessage": "!!!Manage Team", | 1403 | "defaultMessage": "!!!Manage Team", |
1360 | "end": { | 1404 | "end": { |
1361 | "column": 3, | 1405 | "column": 3, |
1362 | "line": 32 | 1406 | "line": 33 |
1363 | }, | 1407 | }, |
1364 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 1408 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
1365 | "id": "settings.navigation.team", | 1409 | "id": "settings.navigation.team", |
1366 | "start": { | 1410 | "start": { |
1367 | "column": 8, | 1411 | "column": 8, |
1368 | "line": 29 | 1412 | "line": 30 |
1369 | } | 1413 | } |
1370 | }, | 1414 | }, |
1371 | { | 1415 | { |
1372 | "defaultMessage": "!!!Settings", | 1416 | "defaultMessage": "!!!Settings", |
1373 | "end": { | 1417 | "end": { |
1374 | "column": 3, | 1418 | "column": 3, |
1375 | "line": 36 | 1419 | "line": 37 |
1376 | }, | 1420 | }, |
1377 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 1421 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
1378 | "id": "settings.navigation.settings", | 1422 | "id": "settings.navigation.settings", |
1379 | "start": { | 1423 | "start": { |
1380 | "column": 12, | 1424 | "column": 12, |
1381 | "line": 33 | 1425 | "line": 34 |
1382 | } | 1426 | } |
1383 | }, | 1427 | }, |
1384 | { | 1428 | { |
1385 | "defaultMessage": "!!!Invite Friends", | 1429 | "defaultMessage": "!!!Invite Friends", |
1386 | "end": { | 1430 | "end": { |
1387 | "column": 3, | 1431 | "column": 3, |
1388 | "line": 40 | 1432 | "line": 41 |
1389 | }, | 1433 | }, |
1390 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 1434 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
1391 | "id": "settings.navigation.inviteFriends", | 1435 | "id": "settings.navigation.inviteFriends", |
1392 | "start": { | 1436 | "start": { |
1393 | "column": 17, | 1437 | "column": 17, |
1394 | "line": 37 | 1438 | "line": 38 |
1395 | } | 1439 | } |
1396 | }, | 1440 | }, |
1397 | { | 1441 | { |
1398 | "defaultMessage": "!!!Logout", | 1442 | "defaultMessage": "!!!Logout", |
1399 | "end": { | 1443 | "end": { |
1400 | "column": 3, | 1444 | "column": 3, |
1401 | "line": 44 | 1445 | "line": 45 |
1402 | }, | 1446 | }, |
1403 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 1447 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
1404 | "id": "settings.navigation.logout", | 1448 | "id": "settings.navigation.logout", |
1405 | "start": { | 1449 | "start": { |
1406 | "column": 10, | 1450 | "column": 10, |
1407 | "line": 41 | 1451 | "line": 42 |
1408 | } | 1452 | } |
1409 | } | 1453 | } |
1410 | ], | 1454 | ], |
@@ -1525,286 +1569,286 @@ | |||
1525 | "defaultMessage": "!!!Save service", | 1569 | "defaultMessage": "!!!Save service", |
1526 | "end": { | 1570 | "end": { |
1527 | "column": 3, | 1571 | "column": 3, |
1528 | "line": 26 | 1572 | "line": 27 |
1529 | }, | 1573 | }, |
1530 | "file": "src/components/settings/services/EditServiceForm.js", | 1574 | "file": "src/components/settings/services/EditServiceForm.js", |
1531 | "id": "settings.service.form.saveButton", | 1575 | "id": "settings.service.form.saveButton", |
1532 | "start": { | 1576 | "start": { |
1533 | "column": 15, | 1577 | "column": 15, |
1534 | "line": 23 | 1578 | "line": 24 |
1535 | } | 1579 | } |
1536 | }, | 1580 | }, |
1537 | { | 1581 | { |
1538 | "defaultMessage": "!!!Delete Service", | 1582 | "defaultMessage": "!!!Delete Service", |
1539 | "end": { | 1583 | "end": { |
1540 | "column": 3, | 1584 | "column": 3, |
1541 | "line": 30 | 1585 | "line": 31 |
1542 | }, | 1586 | }, |
1543 | "file": "src/components/settings/services/EditServiceForm.js", | 1587 | "file": "src/components/settings/services/EditServiceForm.js", |
1544 | "id": "settings.service.form.deleteButton", | 1588 | "id": "settings.service.form.deleteButton", |
1545 | "start": { | 1589 | "start": { |
1546 | "column": 17, | 1590 | "column": 17, |
1547 | "line": 27 | 1591 | "line": 28 |
1548 | } | 1592 | } |
1549 | }, | 1593 | }, |
1550 | { | 1594 | { |
1551 | "defaultMessage": "!!!Available services", | 1595 | "defaultMessage": "!!!Available services", |
1552 | "end": { | 1596 | "end": { |
1553 | "column": 3, | 1597 | "column": 3, |
1554 | "line": 34 | 1598 | "line": 35 |
1555 | }, | 1599 | }, |
1556 | "file": "src/components/settings/services/EditServiceForm.js", | 1600 | "file": "src/components/settings/services/EditServiceForm.js", |
1557 | "id": "settings.service.form.availableServices", | 1601 | "id": "settings.service.form.availableServices", |
1558 | "start": { | 1602 | "start": { |
1559 | "column": 21, | 1603 | "column": 21, |
1560 | "line": 31 | 1604 | "line": 32 |
1561 | } | 1605 | } |
1562 | }, | 1606 | }, |
1563 | { | 1607 | { |
1564 | "defaultMessage": "!!!Your services", | 1608 | "defaultMessage": "!!!Your services", |
1565 | "end": { | 1609 | "end": { |
1566 | "column": 3, | 1610 | "column": 3, |
1567 | "line": 38 | 1611 | "line": 39 |
1568 | }, | 1612 | }, |
1569 | "file": "src/components/settings/services/EditServiceForm.js", | 1613 | "file": "src/components/settings/services/EditServiceForm.js", |
1570 | "id": "settings.service.form.yourServices", | 1614 | "id": "settings.service.form.yourServices", |
1571 | "start": { | 1615 | "start": { |
1572 | "column": 16, | 1616 | "column": 16, |
1573 | "line": 35 | 1617 | "line": 36 |
1574 | } | 1618 | } |
1575 | }, | 1619 | }, |
1576 | { | 1620 | { |
1577 | "defaultMessage": "!!!Add {name}", | 1621 | "defaultMessage": "!!!Add {name}", |
1578 | "end": { | 1622 | "end": { |
1579 | "column": 3, | 1623 | "column": 3, |
1580 | "line": 42 | 1624 | "line": 43 |
1581 | }, | 1625 | }, |
1582 | "file": "src/components/settings/services/EditServiceForm.js", | 1626 | "file": "src/components/settings/services/EditServiceForm.js", |
1583 | "id": "settings.service.form.addServiceHeadline", | 1627 | "id": "settings.service.form.addServiceHeadline", |
1584 | "start": { | 1628 | "start": { |
1585 | "column": 22, | 1629 | "column": 22, |
1586 | "line": 39 | 1630 | "line": 40 |
1587 | } | 1631 | } |
1588 | }, | 1632 | }, |
1589 | { | 1633 | { |
1590 | "defaultMessage": "!!!Edit {name}", | 1634 | "defaultMessage": "!!!Edit {name}", |
1591 | "end": { | 1635 | "end": { |
1592 | "column": 3, | 1636 | "column": 3, |
1593 | "line": 46 | 1637 | "line": 47 |
1594 | }, | 1638 | }, |
1595 | "file": "src/components/settings/services/EditServiceForm.js", | 1639 | "file": "src/components/settings/services/EditServiceForm.js", |
1596 | "id": "settings.service.form.editServiceHeadline", | 1640 | "id": "settings.service.form.editServiceHeadline", |
1597 | "start": { | 1641 | "start": { |
1598 | "column": 23, | 1642 | "column": 23, |
1599 | "line": 43 | 1643 | "line": 44 |
1600 | } | 1644 | } |
1601 | }, | 1645 | }, |
1602 | { | 1646 | { |
1603 | "defaultMessage": "!!!Hosted", | 1647 | "defaultMessage": "!!!Hosted", |
1604 | "end": { | 1648 | "end": { |
1605 | "column": 3, | 1649 | "column": 3, |
1606 | "line": 50 | 1650 | "line": 51 |
1607 | }, | 1651 | }, |
1608 | "file": "src/components/settings/services/EditServiceForm.js", | 1652 | "file": "src/components/settings/services/EditServiceForm.js", |
1609 | "id": "settings.service.form.tabHosted", | 1653 | "id": "settings.service.form.tabHosted", |
1610 | "start": { | 1654 | "start": { |
1611 | "column": 13, | 1655 | "column": 13, |
1612 | "line": 47 | 1656 | "line": 48 |
1613 | } | 1657 | } |
1614 | }, | 1658 | }, |
1615 | { | 1659 | { |
1616 | "defaultMessage": "!!!Self hosted ⭐️", | 1660 | "defaultMessage": "!!!Self hosted ⭐️", |
1617 | "end": { | 1661 | "end": { |
1618 | "column": 3, | 1662 | "column": 3, |
1619 | "line": 54 | 1663 | "line": 55 |
1620 | }, | 1664 | }, |
1621 | "file": "src/components/settings/services/EditServiceForm.js", | 1665 | "file": "src/components/settings/services/EditServiceForm.js", |
1622 | "id": "settings.service.form.tabOnPremise", | 1666 | "id": "settings.service.form.tabOnPremise", |
1623 | "start": { | 1667 | "start": { |
1624 | "column": 16, | 1668 | "column": 16, |
1625 | "line": 51 | 1669 | "line": 52 |
1626 | } | 1670 | } |
1627 | }, | 1671 | }, |
1628 | { | 1672 | { |
1629 | "defaultMessage": "!!!Use the hosted {name} service.", | 1673 | "defaultMessage": "!!!Use the hosted {name} service.", |
1630 | "end": { | 1674 | "end": { |
1631 | "column": 3, | 1675 | "column": 3, |
1632 | "line": 58 | 1676 | "line": 59 |
1633 | }, | 1677 | }, |
1634 | "file": "src/components/settings/services/EditServiceForm.js", | 1678 | "file": "src/components/settings/services/EditServiceForm.js", |
1635 | "id": "settings.service.form.useHostedService", | 1679 | "id": "settings.service.form.useHostedService", |
1636 | "start": { | 1680 | "start": { |
1637 | "column": 20, | 1681 | "column": 20, |
1638 | "line": 55 | 1682 | "line": 56 |
1639 | } | 1683 | } |
1640 | }, | 1684 | }, |
1641 | { | 1685 | { |
1642 | "defaultMessage": "!!!Could not validate custom {name} server.", | 1686 | "defaultMessage": "!!!Could not validate custom {name} server.", |
1643 | "end": { | 1687 | "end": { |
1644 | "column": 3, | 1688 | "column": 3, |
1645 | "line": 62 | 1689 | "line": 63 |
1646 | }, | 1690 | }, |
1647 | "file": "src/components/settings/services/EditServiceForm.js", | 1691 | "file": "src/components/settings/services/EditServiceForm.js", |
1648 | "id": "settings.service.form.customUrlValidationError", | 1692 | "id": "settings.service.form.customUrlValidationError", |
1649 | "start": { | 1693 | "start": { |
1650 | "column": 28, | 1694 | "column": 28, |
1651 | "line": 59 | 1695 | "line": 60 |
1652 | } | 1696 | } |
1653 | }, | 1697 | }, |
1654 | { | 1698 | { |
1655 | "defaultMessage": "!!!To add self hosted services, you need a Franz Premium Supporter Account.", | 1699 | "defaultMessage": "!!!To add self hosted services, you need a Franz Premium Supporter Account.", |
1656 | "end": { | 1700 | "end": { |
1657 | "column": 3, | 1701 | "column": 3, |
1658 | "line": 66 | 1702 | "line": 67 |
1659 | }, | 1703 | }, |
1660 | "file": "src/components/settings/services/EditServiceForm.js", | 1704 | "file": "src/components/settings/services/EditServiceForm.js", |
1661 | "id": "settings.service.form.customUrlPremiumInfo", | 1705 | "id": "settings.service.form.customUrlPremiumInfo", |
1662 | "start": { | 1706 | "start": { |
1663 | "column": 24, | 1707 | "column": 24, |
1664 | "line": 63 | 1708 | "line": 64 |
1665 | } | 1709 | } |
1666 | }, | 1710 | }, |
1667 | { | 1711 | { |
1668 | "defaultMessage": "!!!Upgrade your account", | 1712 | "defaultMessage": "!!!Upgrade your account", |
1669 | "end": { | 1713 | "end": { |
1670 | "column": 3, | 1714 | "column": 3, |
1671 | "line": 70 | 1715 | "line": 71 |
1672 | }, | 1716 | }, |
1673 | "file": "src/components/settings/services/EditServiceForm.js", | 1717 | "file": "src/components/settings/services/EditServiceForm.js", |
1674 | "id": "settings.service.form.customUrlUpgradeAccount", | 1718 | "id": "settings.service.form.customUrlUpgradeAccount", |
1675 | "start": { | 1719 | "start": { |
1676 | "column": 27, | 1720 | "column": 27, |
1677 | "line": 67 | 1721 | "line": 68 |
1678 | } | 1722 | } |
1679 | }, | 1723 | }, |
1680 | { | 1724 | { |
1681 | "defaultMessage": "!!!You will be notified about all new messages in a channel, not just @username, @channel, @here, ...", | 1725 | "defaultMessage": "!!!You will be notified about all new messages in a channel, not just @username, @channel, @here, ...", |
1682 | "end": { | 1726 | "end": { |
1683 | "column": 3, | 1727 | "column": 3, |
1684 | "line": 74 | 1728 | "line": 75 |
1685 | }, | 1729 | }, |
1686 | "file": "src/components/settings/services/EditServiceForm.js", | 1730 | "file": "src/components/settings/services/EditServiceForm.js", |
1687 | "id": "settings.service.form.indirectMessageInfo", | 1731 | "id": "settings.service.form.indirectMessageInfo", |
1688 | "start": { | 1732 | "start": { |
1689 | "column": 23, | 1733 | "column": 23, |
1690 | "line": 71 | 1734 | "line": 72 |
1691 | } | 1735 | } |
1692 | }, | 1736 | }, |
1693 | { | 1737 | { |
1694 | "defaultMessage": "!!!When disabled, all notification sounds and audio playback are muted", | 1738 | "defaultMessage": "!!!When disabled, all notification sounds and audio playback are muted", |
1695 | "end": { | 1739 | "end": { |
1696 | "column": 3, | 1740 | "column": 3, |
1697 | "line": 78 | 1741 | "line": 79 |
1698 | }, | 1742 | }, |
1699 | "file": "src/components/settings/services/EditServiceForm.js", | 1743 | "file": "src/components/settings/services/EditServiceForm.js", |
1700 | "id": "settings.service.form.isMutedInfo", | 1744 | "id": "settings.service.form.isMutedInfo", |
1701 | "start": { | 1745 | "start": { |
1702 | "column": 15, | 1746 | "column": 15, |
1703 | "line": 75 | 1747 | "line": 76 |
1704 | } | 1748 | } |
1705 | }, | 1749 | }, |
1706 | { | 1750 | { |
1707 | "defaultMessage": "!!!Notifications", | 1751 | "defaultMessage": "!!!Notifications", |
1708 | "end": { | 1752 | "end": { |
1709 | "column": 3, | 1753 | "column": 3, |
1710 | "line": 82 | 1754 | "line": 83 |
1711 | }, | 1755 | }, |
1712 | "file": "src/components/settings/services/EditServiceForm.js", | 1756 | "file": "src/components/settings/services/EditServiceForm.js", |
1713 | "id": "settings.service.form.headlineNotifications", | 1757 | "id": "settings.service.form.headlineNotifications", |
1714 | "start": { | 1758 | "start": { |
1715 | "column": 25, | 1759 | "column": 25, |
1716 | "line": 79 | 1760 | "line": 80 |
1717 | } | 1761 | } |
1718 | }, | 1762 | }, |
1719 | { | 1763 | { |
1720 | "defaultMessage": "!!!Unread message badges", | 1764 | "defaultMessage": "!!!Unread message badges", |
1721 | "end": { | 1765 | "end": { |
1722 | "column": 3, | 1766 | "column": 3, |
1723 | "line": 86 | 1767 | "line": 87 |
1724 | }, | 1768 | }, |
1725 | "file": "src/components/settings/services/EditServiceForm.js", | 1769 | "file": "src/components/settings/services/EditServiceForm.js", |
1726 | "id": "settings.service.form.headlineBadges", | 1770 | "id": "settings.service.form.headlineBadges", |
1727 | "start": { | 1771 | "start": { |
1728 | "column": 18, | 1772 | "column": 18, |
1729 | "line": 83 | 1773 | "line": 84 |
1730 | } | 1774 | } |
1731 | }, | 1775 | }, |
1732 | { | 1776 | { |
1733 | "defaultMessage": "!!!General", | 1777 | "defaultMessage": "!!!General", |
1734 | "end": { | 1778 | "end": { |
1735 | "column": 3, | 1779 | "column": 3, |
1736 | "line": 90 | 1780 | "line": 91 |
1737 | }, | 1781 | }, |
1738 | "file": "src/components/settings/services/EditServiceForm.js", | 1782 | "file": "src/components/settings/services/EditServiceForm.js", |
1739 | "id": "settings.service.form.headlineGeneral", | 1783 | "id": "settings.service.form.headlineGeneral", |
1740 | "start": { | 1784 | "start": { |
1741 | "column": 19, | 1785 | "column": 19, |
1742 | "line": 87 | 1786 | "line": 88 |
1743 | } | 1787 | } |
1744 | }, | 1788 | }, |
1745 | { | 1789 | { |
1746 | "defaultMessage": "!!!Delete", | 1790 | "defaultMessage": "!!!Delete", |
1747 | "end": { | 1791 | "end": { |
1748 | "column": 3, | 1792 | "column": 3, |
1749 | "line": 94 | 1793 | "line": 95 |
1750 | }, | 1794 | }, |
1751 | "file": "src/components/settings/services/EditServiceForm.js", | 1795 | "file": "src/components/settings/services/EditServiceForm.js", |
1752 | "id": "settings.service.form.iconDelete", | 1796 | "id": "settings.service.form.iconDelete", |
1753 | "start": { | 1797 | "start": { |
1754 | "column": 14, | 1798 | "column": 14, |
1755 | "line": 91 | 1799 | "line": 92 |
1756 | } | 1800 | } |
1757 | }, | 1801 | }, |
1758 | { | 1802 | { |
1759 | "defaultMessage": "!!!Drop your image, or click here", | 1803 | "defaultMessage": "!!!Drop your image, or click here", |
1760 | "end": { | 1804 | "end": { |
1761 | "column": 3, | 1805 | "column": 3, |
1762 | "line": 98 | 1806 | "line": 99 |
1763 | }, | 1807 | }, |
1764 | "file": "src/components/settings/services/EditServiceForm.js", | 1808 | "file": "src/components/settings/services/EditServiceForm.js", |
1765 | "id": "settings.service.form.iconUpload", | 1809 | "id": "settings.service.form.iconUpload", |
1766 | "start": { | 1810 | "start": { |
1767 | "column": 14, | 1811 | "column": 14, |
1768 | "line": 95 | 1812 | "line": 96 |
1769 | } | 1813 | } |
1770 | }, | 1814 | }, |
1771 | { | 1815 | { |
1772 | "defaultMessage": "!!!HTTP/HTTPS Proxy Settings", | 1816 | "defaultMessage": "!!!HTTP/HTTPS Proxy Settings", |
1773 | "end": { | 1817 | "end": { |
1774 | "column": 3, | 1818 | "column": 3, |
1775 | "line": 102 | 1819 | "line": 103 |
1776 | }, | 1820 | }, |
1777 | "file": "src/components/settings/services/EditServiceForm.js", | 1821 | "file": "src/components/settings/services/EditServiceForm.js", |
1778 | "id": "settings.service.form.proxy.headline", | 1822 | "id": "settings.service.form.proxy.headline", |
1779 | "start": { | 1823 | "start": { |
1780 | "column": 17, | 1824 | "column": 17, |
1781 | "line": 99 | 1825 | "line": 100 |
1782 | } | 1826 | } |
1783 | }, | 1827 | }, |
1784 | { | 1828 | { |
1785 | "defaultMessage": "!!!Please restart Franz after changing proxy Settings.", | 1829 | "defaultMessage": "!!!Please restart Franz after changing proxy Settings.", |
1786 | "end": { | 1830 | "end": { |
1787 | "column": 3, | 1831 | "column": 3, |
1788 | "line": 106 | 1832 | "line": 107 |
1789 | }, | 1833 | }, |
1790 | "file": "src/components/settings/services/EditServiceForm.js", | 1834 | "file": "src/components/settings/services/EditServiceForm.js", |
1791 | "id": "settings.service.form.proxy.restartInfo", | 1835 | "id": "settings.service.form.proxy.restartInfo", |
1792 | "start": { | 1836 | "start": { |
1793 | "column": 20, | 1837 | "column": 20, |
1794 | "line": 103 | 1838 | "line": 104 |
1795 | } | 1839 | } |
1796 | }, | 1840 | }, |
1797 | { | 1841 | { |
1798 | "defaultMessage": "!!!Proxy settings will not be synchronized with the Franz servers.", | 1842 | "defaultMessage": "!!!Proxy settings will not be synchronized with the Franz servers.", |
1799 | "end": { | 1843 | "end": { |
1800 | "column": 3, | 1844 | "column": 3, |
1801 | "line": 110 | 1845 | "line": 111 |
1802 | }, | 1846 | }, |
1803 | "file": "src/components/settings/services/EditServiceForm.js", | 1847 | "file": "src/components/settings/services/EditServiceForm.js", |
1804 | "id": "settings.service.form.proxy.info", | 1848 | "id": "settings.service.form.proxy.info", |
1805 | "start": { | 1849 | "start": { |
1806 | "column": 13, | 1850 | "column": 13, |
1807 | "line": 107 | 1851 | "line": 108 |
1808 | } | 1852 | } |
1809 | } | 1853 | } |
1810 | ], | 1854 | ], |
@@ -3289,29 +3333,29 @@ | |||
3289 | { | 3333 | { |
3290 | "descriptors": [ | 3334 | "descriptors": [ |
3291 | { | 3335 | { |
3292 | "defaultMessage": "!!!You have added {amount} of {amount} services. Please upgrade your account to add more services.", | 3336 | "defaultMessage": "!!!You have added {amount} of {limit} services. Please upgrade your account to add more services.", |
3293 | "end": { | 3337 | "end": { |
3294 | "column": 3, | 3338 | "column": 3, |
3295 | "line": 16 | 3339 | "line": 14 |
3296 | }, | 3340 | }, |
3297 | "file": "src/features/serviceLimit/components/LimitReachedInfobox.js", | 3341 | "file": "src/features/serviceLimit/components/LimitReachedInfobox.js", |
3298 | "id": "feature.serviceLimit.limitReached", | 3342 | "id": "feature.serviceLimit.limitReached", |
3299 | "start": { | 3343 | "start": { |
3300 | "column": 16, | 3344 | "column": 16, |
3301 | "line": 13 | 3345 | "line": 11 |
3302 | } | 3346 | } |
3303 | }, | 3347 | }, |
3304 | { | 3348 | { |
3305 | "defaultMessage": "!!!Upgrade account", | 3349 | "defaultMessage": "!!!Upgrade account", |
3306 | "end": { | 3350 | "end": { |
3307 | "column": 3, | 3351 | "column": 3, |
3308 | "line": 20 | 3352 | "line": 18 |
3309 | }, | 3353 | }, |
3310 | "file": "src/features/serviceLimit/components/LimitReachedInfobox.js", | 3354 | "file": "src/features/serviceLimit/components/LimitReachedInfobox.js", |
3311 | "id": "premiumFeature.button.upgradeAccount", | 3355 | "id": "premiumFeature.button.upgradeAccount", |
3312 | "start": { | 3356 | "start": { |
3313 | "column": 10, | 3357 | "column": 10, |
3314 | "line": 17 | 3358 | "line": 15 |
3315 | } | 3359 | } |
3316 | } | 3360 | } |
3317 | ], | 3361 | ], |
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index eded7b79b..d83ce37b0 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -119,6 +119,9 @@ | |||
119 | "service.errorHandler.headline": "Oh no!", | 119 | "service.errorHandler.headline": "Oh no!", |
120 | "service.errorHandler.message": "Error", | 120 | "service.errorHandler.message": "Error", |
121 | "service.errorHandler.text": "{name} has failed to load.", | 121 | "service.errorHandler.text": "{name} has failed to load.", |
122 | "service.restrictedHandler.action": "Upgrade Account", | ||
123 | "service.restrictedHandler.headline": "You have reached your service limit.", | ||
124 | "service.restrictedHandler.text": "Please upgrade your account to use more than {count} services.", | ||
122 | "service.webviewLoader.loading": "Loading", | 125 | "service.webviewLoader.loading": "Loading", |
123 | "services.getStarted": "Get started", | 126 | "services.getStarted": "Get started", |
124 | "services.welcome": "Welcome to Franz", | 127 | "services.welcome": "Welcome to Franz", |
diff --git a/src/i18n/messages/src/components/services/content/ServiceRestricted.json b/src/i18n/messages/src/components/services/content/ServiceRestricted.json new file mode 100644 index 000000000..30ecd4d75 --- /dev/null +++ b/src/i18n/messages/src/components/services/content/ServiceRestricted.json | |||
@@ -0,0 +1,41 @@ | |||
1 | [ | ||
2 | { | ||
3 | "id": "service.restrictedHandler.headline", | ||
4 | "defaultMessage": "!!!You have reached your service limit.", | ||
5 | "file": "src/components/services/content/ServiceRestricted.js", | ||
6 | "start": { | ||
7 | "line": 10, | ||
8 | "column": 12 | ||
9 | }, | ||
10 | "end": { | ||
11 | "line": 13, | ||
12 | "column": 3 | ||
13 | } | ||
14 | }, | ||
15 | { | ||
16 | "id": "service.restrictedHandler.text", | ||
17 | "defaultMessage": "!!!Please upgrade your account to use more than {count} services.", | ||
18 | "file": "src/components/services/content/ServiceRestricted.js", | ||
19 | "start": { | ||
20 | "line": 14, | ||
21 | "column": 8 | ||
22 | }, | ||
23 | "end": { | ||
24 | "line": 17, | ||
25 | "column": 3 | ||
26 | } | ||
27 | }, | ||
28 | { | ||
29 | "id": "service.restrictedHandler.action", | ||
30 | "defaultMessage": "!!!Upgrade Account", | ||
31 | "file": "src/components/services/content/ServiceRestricted.js", | ||
32 | "start": { | ||
33 | "line": 18, | ||
34 | "column": 10 | ||
35 | }, | ||
36 | "end": { | ||
37 | "line": 21, | ||
38 | "column": 3 | ||
39 | } | ||
40 | } | ||
41 | ] \ No newline at end of file | ||
diff --git a/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json b/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json index 70a989211..7dfb3ce04 100644 --- a/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json +++ b/src/i18n/messages/src/components/settings/navigation/SettingsNavigation.json | |||
@@ -4,11 +4,11 @@ | |||
4 | "defaultMessage": "!!!Available services", | 4 | "defaultMessage": "!!!Available services", |
5 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 5 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
6 | "start": { | 6 | "start": { |
7 | "line": 13, | 7 | "line": 14, |
8 | "column": 21 | 8 | "column": 21 |
9 | }, | 9 | }, |
10 | "end": { | 10 | "end": { |
11 | "line": 16, | 11 | "line": 17, |
12 | "column": 3 | 12 | "column": 3 |
13 | } | 13 | } |
14 | }, | 14 | }, |
@@ -17,11 +17,11 @@ | |||
17 | "defaultMessage": "!!!Your services", | 17 | "defaultMessage": "!!!Your services", |
18 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 18 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
19 | "start": { | 19 | "start": { |
20 | "line": 17, | 20 | "line": 18, |
21 | "column": 16 | 21 | "column": 16 |
22 | }, | 22 | }, |
23 | "end": { | 23 | "end": { |
24 | "line": 20, | 24 | "line": 21, |
25 | "column": 3 | 25 | "column": 3 |
26 | } | 26 | } |
27 | }, | 27 | }, |
@@ -30,11 +30,11 @@ | |||
30 | "defaultMessage": "!!!Your workspaces", | 30 | "defaultMessage": "!!!Your workspaces", |
31 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 31 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
32 | "start": { | 32 | "start": { |
33 | "line": 21, | 33 | "line": 22, |
34 | "column": 18 | 34 | "column": 18 |
35 | }, | 35 | }, |
36 | "end": { | 36 | "end": { |
37 | "line": 24, | 37 | "line": 25, |
38 | "column": 3 | 38 | "column": 3 |
39 | } | 39 | } |
40 | }, | 40 | }, |
@@ -43,11 +43,11 @@ | |||
43 | "defaultMessage": "!!!Account", | 43 | "defaultMessage": "!!!Account", |
44 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 44 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
45 | "start": { | 45 | "start": { |
46 | "line": 25, | 46 | "line": 26, |
47 | "column": 11 | 47 | "column": 11 |
48 | }, | 48 | }, |
49 | "end": { | 49 | "end": { |
50 | "line": 28, | 50 | "line": 29, |
51 | "column": 3 | 51 | "column": 3 |
52 | } | 52 | } |
53 | }, | 53 | }, |
@@ -56,11 +56,11 @@ | |||
56 | "defaultMessage": "!!!Manage Team", | 56 | "defaultMessage": "!!!Manage Team", |
57 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 57 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
58 | "start": { | 58 | "start": { |
59 | "line": 29, | 59 | "line": 30, |
60 | "column": 8 | 60 | "column": 8 |
61 | }, | 61 | }, |
62 | "end": { | 62 | "end": { |
63 | "line": 32, | 63 | "line": 33, |
64 | "column": 3 | 64 | "column": 3 |
65 | } | 65 | } |
66 | }, | 66 | }, |
@@ -69,11 +69,11 @@ | |||
69 | "defaultMessage": "!!!Settings", | 69 | "defaultMessage": "!!!Settings", |
70 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 70 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
71 | "start": { | 71 | "start": { |
72 | "line": 33, | 72 | "line": 34, |
73 | "column": 12 | 73 | "column": 12 |
74 | }, | 74 | }, |
75 | "end": { | 75 | "end": { |
76 | "line": 36, | 76 | "line": 37, |
77 | "column": 3 | 77 | "column": 3 |
78 | } | 78 | } |
79 | }, | 79 | }, |
@@ -82,11 +82,11 @@ | |||
82 | "defaultMessage": "!!!Invite Friends", | 82 | "defaultMessage": "!!!Invite Friends", |
83 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 83 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
84 | "start": { | 84 | "start": { |
85 | "line": 37, | 85 | "line": 38, |
86 | "column": 17 | 86 | "column": 17 |
87 | }, | 87 | }, |
88 | "end": { | 88 | "end": { |
89 | "line": 40, | 89 | "line": 41, |
90 | "column": 3 | 90 | "column": 3 |
91 | } | 91 | } |
92 | }, | 92 | }, |
@@ -95,11 +95,11 @@ | |||
95 | "defaultMessage": "!!!Logout", | 95 | "defaultMessage": "!!!Logout", |
96 | "file": "src/components/settings/navigation/SettingsNavigation.js", | 96 | "file": "src/components/settings/navigation/SettingsNavigation.js", |
97 | "start": { | 97 | "start": { |
98 | "line": 41, | 98 | "line": 42, |
99 | "column": 10 | 99 | "column": 10 |
100 | }, | 100 | }, |
101 | "end": { | 101 | "end": { |
102 | "line": 44, | 102 | "line": 45, |
103 | "column": 3 | 103 | "column": 3 |
104 | } | 104 | } |
105 | } | 105 | } |
diff --git a/src/models/Service.js b/src/models/Service.js index 88bce3360..fa3648a39 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -104,6 +104,8 @@ export default class Service { | |||
104 | 104 | ||
105 | this.recipe = recipe; | 105 | this.recipe = recipe; |
106 | 106 | ||
107 | this.isServiceAccessRestricted = false; | ||
108 | |||
107 | autorun(() => { | 109 | autorun(() => { |
108 | if (!this.isEnabled) { | 110 | if (!this.isEnabled) { |
109 | this.webview = null; | 111 | this.webview = null; |
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index ee47bf6db..79d1a0ea1 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -93,13 +93,21 @@ export default class ServicesStore extends Store { | |||
93 | () => this.stores.settings.app.spellcheckerLanguage, | 93 | () => this.stores.settings.app.spellcheckerLanguage, |
94 | () => this._shareSettingsWithServiceProcess(), | 94 | () => this._shareSettingsWithServiceProcess(), |
95 | ); | 95 | ); |
96 | |||
97 | reaction( | ||
98 | () => this.all, | ||
99 | () => this._restrictServiceAccess(), | ||
100 | ); | ||
96 | } | 101 | } |
97 | 102 | ||
98 | @computed get all() { | 103 | @computed get all() { |
99 | if (this.stores.user.isLoggedIn) { | 104 | if (this.stores.user.isLoggedIn) { |
100 | const services = this.allServicesRequest.execute().result; | 105 | const services = this.allServicesRequest.execute().result; |
101 | if (services) { | 106 | if (services) { |
102 | return observable(services.slice().slice().sort((a, b) => a.order - b.order)); | 107 | return observable(services.slice().slice().sort((a, b) => a.order - b.order).map((s, index) => { |
108 | s.index = index; | ||
109 | return s; | ||
110 | })); | ||
103 | } | 111 | } |
104 | } | 112 | } |
105 | return []; | 113 | return []; |
@@ -681,6 +689,20 @@ export default class ServicesStore extends Store { | |||
681 | return serviceData; | 689 | return serviceData; |
682 | } | 690 | } |
683 | 691 | ||
692 | _restrictServiceAccess() { | ||
693 | const services = this.all; | ||
694 | const { userHasReachedServiceLimit, serviceLimit } = this.stores.serviceLimit; | ||
695 | |||
696 | if (userHasReachedServiceLimit) { | ||
697 | services.map((service, index) => { | ||
698 | console.log('restrictServiceAcceess', index >= serviceLimit); | ||
699 | service.isServiceAccessRestricted = index >= serviceLimit; | ||
700 | |||
701 | return service; | ||
702 | }); | ||
703 | } | ||
704 | } | ||
705 | |||
684 | // Helper | 706 | // Helper |
685 | _initializeServiceRecipeInWebview(serviceId) { | 707 | _initializeServiceRecipeInWebview(serviceId) { |
686 | const service = this.one(serviceId); | 708 | const service = this.one(serviceId); |