>
<Alert variant={hasLegacyConfiguration ? 'warning' : 'info'}>
<FormattedMessage
- id={`settings.authentication.${hasLegacyConfiguration ? 'legacy_help' : 'help'}`}
+ id={`settings.authentication.${
+ hasLegacyConfiguration ? 'legacy_help.github' : 'help'
+ }`}
defaultMessage={translate(
- `settings.authentication.${hasLegacyConfiguration ? 'legacy_help' : 'help'}`,
- tab
+ `settings.authentication.${
+ hasLegacyConfiguration ? 'legacy_help.github' : 'help'
+ }`
)}
values={{
link: (
const invalidOrgs =
isValidApp && isAutoProvisioning && data
? data.installations.filter(
- (org) => org.autoProvisioning.status === GitHubProvisioningStatus.Error
+ (org) => org.autoProvisioning.status === GitHubProvisioningStatus.Failed
)
: [];
if (isValidApp && invalidOrgs.length === 0) {
setMessages([
translateWithParameters(
- `${intlPrefix}.valid${data.installations.length > 1 ? '.multiple_orgs' : ''}`,
+ `${intlPrefix}.valid${data.installations.length === 1 ? '_one' : ''}`,
isAutoProvisioning
? translate('settings.authentication.github.form.provisioning_with_github_short')
: translate('settings.authentication.form.provisioning_at_login_short'),
- data.installations.length
+ data.installations.length === 1
+ ? data.installations[0].organization
+ : data.installations.length
),
]);
setAlertVariant('success');
/>
<span className="sw-ml-2">{inst.organization}</span>
{isAutoProvisioning &&
- inst.autoProvisioning.status === GitHubProvisioningStatus.Error && (
+ inst.autoProvisioning.status === GitHubProvisioningStatus.Failed && (
<span> - {inst.autoProvisioning.errorMessage}</span>
)}
</li>
handler.setConfigurationValidity({
application: {
jit: {
- status: GitHubProvisioningStatus.Error,
+ status: GitHubProvisioningStatus.Failed,
errorMessage,
},
autoProvisioning: {
- status: GitHubProvisioningStatus.Error,
+ status: GitHubProvisioningStatus.Failed,
errorMessage,
},
},
status: GitHubProvisioningStatus.Success,
},
autoProvisioning: {
- status: GitHubProvisioningStatus.Error,
+ status: GitHubProvisioningStatus.Failed,
errorMessage,
},
},
{ organization: 'org1', autoProvisioning: { status: GitHubProvisioningStatus.Success } },
{
organization: 'org2',
- autoProvisioning: { status: GitHubProvisioningStatus.Error, errorMessage },
+ autoProvisioning: { status: GitHubProvisioningStatus.Failed, errorMessage },
},
],
});
handler.setConfigurationValidity({
application: {
jit: {
- status: GitHubProvisioningStatus.Error,
+ status: GitHubProvisioningStatus.Failed,
errorMessage,
},
autoProvisioning: {
- status: GitHubProvisioningStatus.Error,
+ status: GitHubProvisioningStatus.Failed,
errorMessage,
},
},
import { Feature } from '../../../../../types/features';
import { ExtendedSettingDefinition } from '../../../../../types/settings';
import {
+ useCheckGitHubConfigQuery,
useGithubStatusQuery,
useToggleGithubProvisioningMutation,
} from '../queries/identity-provider';
Feature.GithubProvisioning
);
const { data: githubProvisioningStatus } = useGithubStatusQuery();
+ const { refetch } = useCheckGitHubConfigQuery();
const toggleGithubProvisioning = useToggleGithubProvisioningMutation();
const [newGithubProvisioningStatus, setNewGithubProvisioningStatus] = useState<boolean>();
const hasGithubProvisioningConfigChange =
const reload = useCallback(async () => {
await reloadConfig();
+ // Temporary solution that will be solved once we migrate to react-query
+ refetch();
}, [reloadConfig]);
const changeProvisioning = async () => {
export enum GitHubProvisioningStatus {
Success = 'SUCCESS',
- Error = 'ERROR',
+ Failed = 'FAILED',
}
type GitHubProvisioning =
errorMessage?: never;
}
| {
- status: GitHubProvisioningStatus.Error;
+ status: GitHubProvisioningStatus.Failed;
errorMessage: string;
};
settings.authentication.github.configuration.validation.details=View details
settings.authentication.github.configuration.validation.test=Test configuration
settings.authentication.github.configuration.validation.loading=Checking the configuration
-settings.authentication.github.configuration.validation.valid=Configuration is valid for {0}.
-settings.authentication.github.configuration.validation.valid.multiple_orgs=Configuration is valid for {0}. {1} organizations will be synced.
+settings.authentication.github.configuration.validation.valid=Configuration is valid for {0}. {1} organizations will be synced.
+settings.authentication.github.configuration.validation.valid_one=Configuration is valid for {0}. Organization '{1}' will be synced.
settings.authentication.github.configuration.validation.invalid=Configuration is invalid. {0}
settings.authentication.github.configuration.validation.invalid_org=Organization "{0}" has the following error: {1}
settings.authentication.github.configuration.validation.details.title=Configuration validity: