Skip to content

Commit

Permalink
Merge pull request #7235 from pavinduLakshan/move_common_extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
pavinduLakshan authored Jan 9, 2025
2 parents d1828de + c62ac96 commit 6ffd99f
Show file tree
Hide file tree
Showing 46 changed files with 292 additions and 294 deletions.
27 changes: 27 additions & 0 deletions .changeset/stupid-bikes-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
"@wso2is/admin.server-configurations.v1": patch
"@wso2is/admin.remote-userstores.v1": patch
"@wso2is/admin.email-management.v1": patch
"@wso2is/admin.email-providers.v1": patch
"@wso2is/admin.administrators.v1": patch
"@wso2is/admin.api-resources.v1": patch
"@wso2is/admin.api-resources.v2": patch
"@wso2is/admin.login-flow.ai.v1": patch
"@wso2is/admin.organizations.v1": patch
"@wso2is/admin.sms-providers.v1": patch
"@wso2is/admin.applications.v1": patch
"@wso2is/admin.org-insights.v1": patch
"@wso2is/admin.branding.ai.v1": patch
"@wso2is/admin.extensions.v1": patch
"@wso2is/admin.claims.v1": patch
"@wso2is/admin.groups.v1": patch
"@wso2is/admin.roles.v2": patch
"@wso2is/admin.users.v1": patch
"@wso2is/admin.core.v1": patch
"@wso2is/admin.home.v1": patch
"@wso2is/admin.logs.v1": patch
"@wso2is/console": patch
"@wso2is/i18n": patch
---

Move common i18n extensions in console app to i18n module
88 changes: 0 additions & 88 deletions apps/console/src/extensions/i18n/models/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,94 +20,6 @@ import { FormAttributes, Notification, NotificationItem } from "@wso2is/i18n";

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Extensions {
common: {
community: string;
help: {
communityLinks: {
discord: string;
stackOverflow: string;
};
docSiteLink: string;
helpCenterLink: {
title: string;
subtitle: string;
};
helpDropdownLink: string;
};
learnMore: string;
quickStart: {
greeting: {
alternativeHeading: string;
heading: string;
subHeading: string;
};
sections: {
addSocialLogin: {
actions: {
setup: string;
view: string;
};
description: string;
heading: string;
};
integrateApps: {
actions: {
create: string;
manage: string;
view: string;
};
capabilities: {
sso: string;
mfa: string;
social: string;
};
description: string;
heading: string;
};
learn: {
actions: {
view: string;
};
description: string;
heading: string;
};
manageUsers: {
actions: {
create: string;
manage: string;
view: string;
};
capabilities: {
collaborators: string;
customers: string;
groups: string;
};
description: string;
heading: string;
};
asgardeoTryIt: {
errorMessages: {
appCreateGeneric: {
message: string;
description: string;
};
appCreateDuplicate: {
message: string;
description: string;
};
}
}
};
};
upgrade: string;
dropdown: {
footer: {
privacyPolicy: string;
cookiePolicy: string;
termsOfService: string;
}
};
};
console: {
application: {
quickStart: {
Expand Down
95 changes: 0 additions & 95 deletions apps/console/src/extensions/i18n/resources/en-US/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,101 +26,6 @@ import { Extensions } from "../../models";
/* eslint-disable max-len */
/* eslint-disable sort-keys */
export const extensions: Extensions = {
common: {
community: "Community",
help: {
communityLinks: {
discord: "Ask on Discord",
stackOverflow: "Ask on Stack Overflow"
},
docSiteLink: "Documentation",
helpCenterLink: {
title: "Contact Support",
subtitle: "Talk to the {{productName}} team to obtain personalized assistance."
},
helpDropdownLink: "Get Help"
},
learnMore: "Learn More",
quickStart: {
greeting: {
alternativeHeading: "Welcome back, {{username}}!",
heading: "Welcome, {{username}}!",
subHeading: "Here’s how you can get started"
},
sections: {
addSocialLogin: {
actions: {
setup: "Set Up Social Connections",
view: "View Social Connections"
},
description:
"Let your users log in to your applications with an Identity Provider of " + "their choice",
heading: "Add social login"
},
integrateApps: {
actions: {
create: "Register Application",
manage: "Explore Applications",
view: "View Applications"
},
capabilities: {
sso: "SSO",
mfa: "MFA",
social: "Social Login"
},
description:
"Register your app and design the user login experience you want by configuring " +
"SSO, MFA, social login, and various flexible authentication rules.",
heading: "Add login to your apps"
},
learn: {
actions: {
view: "View Docs"
},
description:
"Get started using Asgardeo. Implement authentication for any kind of application " +
"in minutes.",
heading: "Learn"
},
manageUsers: {
actions: {
create: "Add Users",
manage: "Manage Users",
view: "View Users"
},
capabilities: {
collaborators: "Administrators",
customers: "Users",
groups: "User Groups"
},
description:
"Create user accounts for users and invite administrators to your organization. " +
"Allow your users to securely self-manage their profiles.",
heading: "Manage users and groups"
},
asgardeoTryIt: {
errorMessages: {
appCreateGeneric: {
message: "Something went wrong!",
description: "Failed to initialize the Try It app."
},
appCreateDuplicate: {
message: "Application already exists!",
description: "Please delete the existing {{productName}} Try It application."
}
}
}
}
},
upgrade: "Upgrade",
dropdown: {
footer: {
privacyPolicy: "Privacy",
cookiePolicy: "Cookies",
termsOfService: "Terms"
}
}
},
console: {
application: {
quickStart: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ const GuestUsersPage: FunctionComponent<GuestUsersPageInterface> = (
<DocumentationLink
link={ getLink("manage.users.collaboratorAccounts.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const InviteeRoleSelection: FunctionComponent<InviteeRoleSelectionPropsIn
<DocumentationLink
link={ getLink("manage.users.collaboratorAccounts.roles.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</Heading>
</Modal.Header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import { Show } from "@wso2is/access-control";
import { Show, useRequiredScopes } from "@wso2is/access-control";
import {
AppState,
FeatureConfigInterface,
Expand All @@ -27,7 +27,6 @@ import { APPLICATION_DOMAIN, INTERNAL_DOMAIN } from "@wso2is/admin.roles.v2/cons
import { RealmConfigInterface } from "@wso2is/admin.server-configurations.v1/models";
import { UserRolePermissions } from "@wso2is/admin.users.v1/components/user-role-permissions";
import { RolePermissions } from "@wso2is/admin.users.v1/components/wizard/user-role-permissions";
import { hasRequiredScopes } from "@wso2is/core/helpers";
import {
AlertInterface,
AlertLevels,
Expand Down Expand Up @@ -109,7 +108,7 @@ export const UserRolesList: FunctionComponent<UserRolesPropsInterface> = (
const { getLink } = useDocumentation();

const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => state.config.ui.features);
const allowedScopes: string = useSelector((state: AppState) => state?.auth?.allowedScopes);
const hasUserUpdatePermissions: boolean = useRequiredScopes(featureConfig?.users?.scopes?.update);

const [ showAddNewRoleModal, setAddNewRoleModalView ] = useState(false);
const [ roleList, setRoleList ] = useState<RolesInterface[]>([]);
Expand Down Expand Up @@ -696,9 +695,8 @@ export const UserRolesList: FunctionComponent<UserRolesPropsInterface> = (
{ t("user:updateUser.roles.editRoles.heading") }
</Heading>
<Heading subHeading ellipsis as="h6">
{ !hasRequiredScopes(featureConfig?.users,
featureConfig?.users?.scopes?.update,
allowedScopes) || (user?.userName === realmConfigs?.adminUser
{ !hasUserUpdatePermissions
|| (user?.userName === realmConfigs?.adminUser
&& authenticatedUser !== user?.userName)
? (
<>
Expand All @@ -714,7 +712,7 @@ export const UserRolesList: FunctionComponent<UserRolesPropsInterface> = (
link={ getLink("manage.users.collaboratorAccounts." +
"roles.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>
)
Expand Down Expand Up @@ -759,12 +757,7 @@ export const UserRolesList: FunctionComponent<UserRolesPropsInterface> = (
"modal-unselected-roles"
}
readOnly={
!hasRequiredScopes(
featureConfig?.users,
featureConfig?.users
?.scopes?.update,
allowedScopes
)
!hasUserUpdatePermissions
|| ( user?.userName
=== realmConfigs?.adminUser
&& authenticatedUser
Expand All @@ -785,8 +778,7 @@ export const UserRolesList: FunctionComponent<UserRolesPropsInterface> = (
) }
</Grid.Column>
</Grid.Row>
{ !hasRequiredScopes(featureConfig?.users, featureConfig?.users?.scopes?.update,
allowedScopes) || (user?.userName === realmConfigs?.adminUser
{ !hasUserUpdatePermissions || (user?.userName === realmConfigs?.adminUser
&& authenticatedUser !== user?.userName) && (
<Grid.Row>
<Grid.Column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const AdminSettingsPage: FunctionComponent<AdminSettingsPageInterface> =
<DocumentationLink
link={ getLink("manage.users.collaboratorAccounts.adminSettingsLearnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>
) }
Expand Down
2 changes: 1 addition & 1 deletion features/admin.administrators.v1/pages/administrators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ const CollaboratorsPage: FunctionComponent<CollaboratorsPageInterface> = (
<DocumentationLink
link={ getLink("manage.users.collaboratorAccounts.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export const AddAdminUserBasic: React.FunctionComponent<AddAdminUserBasicProps>
<DocumentationLink
link={ getLink("manage.users.newCollaboratorUser.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</Hint>
</Grid.Column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const AuthorizationAPIResource: FunctionComponent<AuthorizationAPIResourc
link={ getLink("develop.apiResources.addAPIResource." +
"requiredAuthorization.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const AddAPIResourceAuthorization: FunctionComponent<AddAPIResourceAuthor
<DocumentationLink
link={ getLink("develop.apiResources.addAPIResource.rbacInfoBox.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>)
}
Expand All @@ -123,7 +123,7 @@ export const AddAPIResourceAuthorization: FunctionComponent<AddAPIResourceAuthor
<DocumentationLink
link={ getLink("develop.apiResources.addAPIResource.requiredAuthorization.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>)
}
Expand Down
2 changes: 1 addition & 1 deletion features/admin.api-resources.v1/pages/api-resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const APIResourcesPage: FunctionComponent<APIResourcesPageInterface> = (
<DocumentationLink
link={ getLink("develop.apiResources.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const AuthorizationAPIResource: FunctionComponent<AuthorizationAPIResourc
link={ getLink("develop.apiResources.addAPIResource." +
"requiredAuthorization.learnMore") }
>
{ t("extensions:common.learnMore") }
{ t("common:learnMore") }
</DocumentationLink>
</>)
}
Expand Down
Loading

0 comments on commit 6ffd99f

Please sign in to comment.