@crowdin/app-project-module 1.0.1 → 1.1.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/out/index.js +4 -1
- package/out/middlewares/auto-credentials-masker.js +4 -1
- package/out/modules/integration/handlers/sync-settings-save.js +5 -2
- package/out/modules/integration/util/cron.js +16 -5
- package/out/static/js/main.js +5 -3
- package/out/static/ui/form.bundle.js +46368 -0
- package/out/static/ui/form.bundle.js.map +1 -0
- package/out/static/ui/main.bundle.js +20 -2
- package/out/static/ui/main.bundle.js.map +1 -1
- package/out/util/credentials-masker.d.ts +5 -1
- package/out/util/credentials-masker.js +2 -2
- package/out/views/FormPage.js +1 -1
- package/package.json +2 -7
- package/out/static/js/form.js +0 -106
|
@@ -622,6 +622,17 @@
|
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
624
|
}, []);
|
|
625
|
+
// Expose centralized API to global scope for main.js compatibility
|
|
626
|
+
reactExports.useEffect(() => {
|
|
627
|
+
window.app = {
|
|
628
|
+
subscriptionModal: subscriptionModal,
|
|
629
|
+
subscriptionLink: subscriptionLink,
|
|
630
|
+
openModal: openModal,
|
|
631
|
+
};
|
|
632
|
+
return () => {
|
|
633
|
+
delete window.app;
|
|
634
|
+
};
|
|
635
|
+
}, []);
|
|
625
636
|
// crowdin-users-select doesn't trigger onChange reliably, using native event listener instead
|
|
626
637
|
reactExports.useEffect(() => {
|
|
627
638
|
const selectElement = usersSelectRef.current;
|
|
@@ -1686,11 +1697,17 @@
|
|
|
1686
1697
|
const allFolderFiles = scheduleModal.querySelector('#all-folder-files').checked || false;
|
|
1687
1698
|
const type = scheduleModal.getAttribute('data-type');
|
|
1688
1699
|
if (type === 'crowdin') {
|
|
1700
|
+
const crowdinFiles = await appComponent.current.getCrowdinFilesData();
|
|
1701
|
+
const syncedFileIds = Object.keys(syncData.current);
|
|
1702
|
+
const crowdinFolderIds = crowdinFiles
|
|
1703
|
+
.filter((file) => file.node_type === folderType || file.node_type === branchType)
|
|
1704
|
+
.filter((file) => syncedFileIds.includes(String(file.id)))
|
|
1705
|
+
.map((file) => String(file.id));
|
|
1689
1706
|
appComponent.current.setCrowdinScheduleSync(syncData.current, newFile, selectedFiles);
|
|
1690
1707
|
appComponent.current.setCrowdinFilesHasSyncOption(true);
|
|
1691
1708
|
const syncedFiles = await appComponent.current.getCrowdinScheduleSync(true);
|
|
1692
1709
|
appComponent.current.setAttribute('is-crowdin-sync-settings-in-progress', true);
|
|
1693
|
-
updateSyncSettings(syncedFiles, 'schedule', 'crowdin');
|
|
1710
|
+
updateSyncSettings(syncedFiles, 'schedule', 'crowdin', [], crowdinFolderIds);
|
|
1694
1711
|
}
|
|
1695
1712
|
else if (type === 'integration') {
|
|
1696
1713
|
if (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.integration) {
|
|
@@ -1917,7 +1934,7 @@
|
|
|
1917
1934
|
}
|
|
1918
1935
|
updateSyncSettings(syncedFiles, 'schedule', 'crowdin');
|
|
1919
1936
|
}
|
|
1920
|
-
function updateSyncSettings(files, type, provider, expandIntegrationFolders = []) {
|
|
1937
|
+
function updateSyncSettings(files, type, provider, expandIntegrationFolders = [], folderIds = []) {
|
|
1921
1938
|
checkOrigin()
|
|
1922
1939
|
.then((restParams) => fetch('api/sync-settings' + restParams, {
|
|
1923
1940
|
method: 'POST',
|
|
@@ -1928,6 +1945,7 @@
|
|
|
1928
1945
|
provider,
|
|
1929
1946
|
expandIntegrationFolders,
|
|
1930
1947
|
hasLoadMoreElements: hasLoadMoreElements.current,
|
|
1948
|
+
folderIds,
|
|
1931
1949
|
}),
|
|
1932
1950
|
}))
|
|
1933
1951
|
.then(checkResponse)
|