Skip to content

Commit

Permalink
Revert "Merge pull request #9098 from weseek/imprv/144244-153642-corr…
Browse files Browse the repository at this point in the history
…ected-wording-on-management-screeen"

This reverts commit 26b6204, reversing
changes made to 42a65bd.
  • Loading branch information
miya committed Sep 12, 2024
1 parent 26b6204 commit 5511beb
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 28 deletions.
2 changes: 1 addition & 1 deletion apps/app/public/static/locales/en_US/commons.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@
"publish_transfer_key": "Publish transfer key",
"transfer_key_limit": "Transfer keys are valid for 1 hour after issuance.",
"once_transfer_key_used": "Once the transfer key is used for transfer, it cannot be used for any other transfer.",
"transfer_to_growi_cloud": "For more details, please click <a href='https://{{growiHelpDomain}}/ja/admin-guide/management-cookbook/g2g-transfer.html'>here.</a>"
"transfer_to_growi_cloud": "If you wish to transfer to GROWI.cloud, please click here."
}
}
2 changes: 1 addition & 1 deletion apps/app/public/static/locales/fr_FR/commons.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@
"publish_transfer_key": "Publier la clé de transfert",
"transfer_key_limit": "Les clés de transfert sont valides durant une heure.",
"once_transfer_key_used": "Les clés de transfert sont à usage unique.",
"transfer_to_growi_cloud": "Pour plus de détails, veuillez cliquer <a href='https://{{growiHelpDomain}}/ja/admin-guide/management-cookbook/g2g-transfer.html'>ici.</a>"
"transfer_to_growi_cloud": "Si vous souhaitez transférer depuis GROWI.cloud, cliquez ici."
}
}
2 changes: 1 addition & 1 deletion apps/app/public/static/locales/ja_JP/commons.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,6 @@
"publish_transfer_key": "移行キーを発行する",
"transfer_key_limit": "※ 移行キーの有効期限は発行から1時間となります。",
"once_transfer_key_used": "※ 移行キーは一度移行に利用するとそれ以降はご利用いただけなくなります。",
"transfer_to_growi_cloud": "詳しくは <a href='https://{{growiHelpDomain}}/ja/admin-guide/management-cookbook/g2g-transfer.html'>こちら</a>"
"transfer_to_growi_cloud": "GROWI.cloud への移行を実施する場合はこちらをご確認ください。"
}
}
2 changes: 1 addition & 1 deletion apps/app/public/static/locales/zh_CN/commons.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,6 @@
"publish_transfer_key": "发布迁移密钥",
"transfer_key_limit": "迁移密钥在签发后一小时内有效。",
"once_transfer_key_used": "一旦迁移密钥被用于迁移,它将不再可用于进一步的迁移。",
"transfer_to_growi_cloud": "有关更多详情,请点击<a href='https://{{growiHelpDomain}}/ja/admin-guide/management-cookbook/g2g-transfer.html'>此处</a>"
"transfer_to_growi_cloud": "如果您希望迁移到GROWI.cloud,请点击这里"
}
}
6 changes: 1 addition & 5 deletions apps/app/src/client/components/Admin/G2GDataTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { useGenerateTransferKey } from '~/client/services/g2g-transfer';
import { apiv3Get, apiv3Post } from '~/client/util/apiv3-client';
import { toastError, toastSuccess } from '~/client/util/toastr';
import { G2G_PROGRESS_STATUS, type G2GProgress } from '~/interfaces/g2g-transfer';
import { useGrowiHelpDomain } from '~/stores-universal/context';
import { useAdminSocket } from '~/stores/socket-io';

import CustomCopyToClipBoard from '../Common/CustomCopyToClipBoard';
Expand Down Expand Up @@ -124,8 +123,6 @@ const G2GDataTransfer = (): JSX.Element => {
}
}, [setTransferring, startTransferKey, selectedCollections, optionsMap]);

const { data: growiHelpDomain } = useGrowiHelpDomain();

// File upload
// const onChangeFileUploadTypeHandler = useCallback((e: ChangeEvent, type: string) => {
// setFileUploadType(type);
Expand Down Expand Up @@ -278,8 +275,7 @@ const G2GDataTransfer = (): JSX.Element => {
<div className="alert alert-warning mt-4">
<p className="mb-1">{t('commons:g2g_data_transfer.transfer_key_limit')}</p>
<p className="mb-1">{t('commons:g2g_data_transfer.once_transfer_key_used')}</p>
{/* eslint-disable-next-line react/no-danger */}
<p className="mb-0" dangerouslySetInnerHTML={{ __html: t('commons:g2g_data_transfer.transfer_to_growi_cloud', { growiHelpDomain }) }} />
<p className="mb-0">{t('commons:g2g_data_transfer.transfer_to_growi_cloud')}</p>
</div>
</div>
);
Expand Down
5 changes: 1 addition & 4 deletions apps/app/src/client/components/DataTransferForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import React from 'react';
import { useTranslation } from 'next-i18next';

import { useGenerateTransferKey } from '~/client/services/g2g-transfer';
import { useGrowiHelpDomain } from '~/stores-universal/context';

import CustomCopyToClipBoard from './Common/CustomCopyToClipBoard';

const DataTransferForm = (): JSX.Element => {
const { t } = useTranslation('commons');
const { transferKey, generateTransferKey } = useGenerateTransferKey();
const { data: growiHelpDomain } = useGrowiHelpDomain();

return (
<div data-testid="installerForm" className="py-3 px-4">
Expand All @@ -35,8 +33,7 @@ const DataTransferForm = (): JSX.Element => {
<div className="alert alert-warning mt-4">
<p className="mb-1">{t('g2g_data_transfer.transfer_key_limit')}</p>
<p className="mb-1">{t('g2g_data_transfer.once_transfer_key_used')}</p>
{/* eslint-disable-next-line react/no-danger */}
<p className="mb-0" dangerouslySetInnerHTML={{ __html: t('g2g_data_transfer.transfer_to_growi_cloud', { growiHelpDomain }) }} />
<p className="mb-0">{t('g2g_data_transfer.transfer_to_growi_cloud')}</p>
</div>
</div>
);
Expand Down
15 changes: 0 additions & 15 deletions apps/app/src/stores-universal/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,3 @@ export const useAcceptedUploadFileType = (): SWRResponse<AcceptedUploadFileType,
},
);
};

export const useGrowiHelpDomain = (): SWRResponse<'growi.cloud/help' | 'docs.growi.org', Error> => {
const { data: growiCloudUri } = useGrowiCloudUri();
const { data: growiAppIdForGrowiCloud } = useGrowiAppIdForGrowiCloud();

return useSWRImmutable(
[growiCloudUri, growiAppIdForGrowiCloud],
([growiCloudUri, growiAppIdForGrowiCloud]) => {
if (growiCloudUri != null && growiAppIdForGrowiCloud != null) {
return 'growi.cloud/help';
}
return 'docs.growi.org';
},
);
};

0 comments on commit 5511beb

Please sign in to comment.