Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check changeset #13

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/check-changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

# This workflow will check if a submitted PR has changesets.

name: 🦋 Check for Changeset

on:
workflow_run:
workflows: ["Receive PR"]
types:
- completed

env:
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}

jobs:
upload:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
uses: actions/[email protected]
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
- run: unzip pr.zip

- name: 'Comment on PR'
uses: actions/github-script@v3
with:
github-token: ${{ env.GH_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./NR'));
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: 'Everything is OK. Thank you for the PR!'
});
47 changes: 47 additions & 0 deletions .github/workflows/receive-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# -------------------------------------------------------------------------------------

name: Receive PR

on:
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# imitation of a build process
- name: Build
run: |
echo "Building..."
sleep 100
echo "Done!"
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -77,8 +77,8 @@ const ApplicationRoleInvitedUserGroups = (props: ApplicationRoleGroupsProps): Re
error: descendantDataFetchRequestError
} = useDescendantsOfSubOrg();

useEffect(() => {
if (originalApplicationRoleGroupData instanceof IdentityAppsApiException
useEffect(() => {
if (originalApplicationRoleGroupData instanceof IdentityAppsApiException
|| applicationRoleGroupDataFetchRequestError) {
handleAlerts({
description: t(
Expand All @@ -92,8 +92,8 @@ const ApplicationRoleInvitedUserGroups = (props: ApplicationRoleGroupsProps): Re
}
}, [ originalApplicationRoleGroupData ]);

useEffect(() => {
if (originalDescendantData instanceof IdentityAppsApiException
useEffect(() => {
if (originalDescendantData instanceof IdentityAppsApiException
|| descendantDataFetchRequestError) {
handleAlerts({
description: t(
Expand Down Expand Up @@ -155,11 +155,11 @@ const ApplicationRoleInvitedUserGroups = (props: ApplicationRoleGroupsProps): Re

if (query === "") {
setProcessedGroupsList(initialGroupsList);

return;
}

const filteredGroupsList: ApplicationRoleGroupInterface[] =
const filteredGroupsList: ApplicationRoleGroupInterface[] =
initialGroupsList.filter((group: ApplicationRoleGroupInterface) => {
return group.name.toLowerCase().includes(query.toLowerCase());
});
Expand Down Expand Up @@ -213,7 +213,7 @@ const ApplicationRoleInvitedUserGroups = (props: ApplicationRoleGroupsProps): Re

return null;
};

/**
* Resolves data table columns.
*/
Expand Down Expand Up @@ -314,7 +314,7 @@ const ApplicationRoleInvitedUserGroups = (props: ApplicationRoleGroupsProps): Re
data-componentid={ `${ componentId }-groups-list-search-input` }
icon={ <Icon name="search" /> }
iconPosition="left"
onChange={ (e: ChangeEvent<HTMLInputElement>) =>
onChange={ (e: ChangeEvent<HTMLInputElement>) =>
searchGroups(e.target.value) }
value={ searchQuery }
placeholder={ t("extensions:console.applicationRoles.roleGroups." +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -74,7 +74,7 @@ export const ApplicationRolesList = (props: ApplicationRolesListProps): ReactEle
*
* @returns placeholder component.
*/
const showPlaceholders = (): ReactElement => {
const showPlaceholders = (): ReactElement => {
// When the search returns empty.
if (searchQuery && roleList?.length === 0) {
return (
Expand Down Expand Up @@ -128,7 +128,7 @@ export const ApplicationRolesList = (props: ApplicationRolesListProps): ReactEle

/**
* Handle expand accordion title.
*
*
* @param appRole - Application role.
*/
const handleAccordionTitleClick = (
Expand All @@ -150,9 +150,9 @@ export const ApplicationRolesList = (props: ApplicationRolesListProps): ReactEle

/**
* Renders the application roles list.
*
*
* @param roles - Role list.
*
*
* @returns Role list component.
*/
const resolveApplicationRolesList = (filteredApplicationRoles: ApplicationRoleInterface[]): ReactElement => {
Expand All @@ -174,8 +174,8 @@ export const ApplicationRolesList = (props: ApplicationRolesListProps): ReactEle
active={ expandedAssignedApplications?.includes(application.app) }
accordionIndex={ application.app }
className="nested-list-accordion-title mb-2 mt-1"
onClick={
() =>
onClick={
() =>
handleAccordionTitleClick(
application,
expandedAssignedApplications,
Expand Down Expand Up @@ -224,7 +224,7 @@ export const ApplicationRolesList = (props: ApplicationRolesListProps): ReactEle
<Accordion
data-componentid={ `${ componentId }-application-roles` }
>
{
{
resolveApplicationRolesList(
roleList
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -95,7 +95,7 @@ const AssignGroupWizard = (props: AssignGroupProps): ReactElement => {
};

const filterOutExistingGroupsFromAllGroups = (
allGroups: RolesInterface[],
allGroups: RolesInterface[],
existingGroups: ApplicationRoleGroupInterface[]
) => {
const filteredGroups: RolesInterface[] = [];
Expand All @@ -104,27 +104,27 @@ const AssignGroupWizard = (props: AssignGroupProps): ReactElement => {
allGroups.forEach((item: RolesInterface) => {
const itemIndex: number = existingGroups.findIndex(
(existingGroup: ApplicationRoleGroupInterface) => existingGroup?.name === item?.displayName);

// No matching index found.
if (itemIndex === -1) {
filteredGroups.push(item);
}
});

setGroupsList(filteredGroups);
setInitialGroupList(filteredGroups);
}
};

const assignGroupsToRole = () => {
const selectedGroups: ApplicationRoleGroupInterface[] = [];

tempGroupList.forEach((group: RolesInterface) => {
selectedGroups.push({
name: group.displayName
});
});

handleGroupAdd(selectedGroups);
};

Expand Down Expand Up @@ -172,7 +172,7 @@ const AssignGroupWizard = (props: AssignGroupProps): ReactElement => {
* The following method handles the onChange event of the
* checkbox field of an unassigned item.
*/
const handleUnassignedItemCheckboxChange = (group: RolesInterface) => {
const handleUnassignedItemCheckboxChange = (group: RolesInterface) => {
const checkedGroups: RolesInterface[] = [ ...checkedUnassignedListItems ];

if (checkedGroups?.includes(group)) {
Expand Down Expand Up @@ -231,7 +231,7 @@ const AssignGroupWizard = (props: AssignGroupProps): ReactElement => {
</Modal.Header>
<Modal.Content className="content-container" scrolling>
{
!isLoading
!isLoading
? (
<TransferComponent
selectionComponent
Expand Down Expand Up @@ -265,7 +265,7 @@ const AssignGroupWizard = (props: AssignGroupProps): ReactElement => {
style={ { height: "100%" } }
handleItemChange={ () => handleUnassignedItemCheckboxChange(group) }
key={ index }
listItem={ groupName?.length > 1
listItem={ groupName?.length > 1
? groupName[1] : group?.displayName }
listItemId={ group.id }
listItemIndex={ index }
Expand All @@ -282,7 +282,7 @@ const AssignGroupWizard = (props: AssignGroupProps): ReactElement => {
)
: (
<ContentLoader />
)
)
}
</Modal.Content>
<Modal.Actions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -41,7 +41,7 @@ const EditApplicationRoles = (props: EditApplicationRolesProps): ReactElement =>

const [ activeTabIndex, setActiveTabIndex ] = useState<number>(undefined);
const defaultActiveIndex: number = 0;

const extendedFeatureConfig: ExtendedFeatureConfigInterface = useSelector(
(state: AppState) => state.config.ui.features);
const isSubOrg: boolean = window[ "AppUtils" ].getConfig().organizationName;
Expand Down Expand Up @@ -102,7 +102,7 @@ const EditApplicationRoles = (props: EditApplicationRolesProps): ReactElement =>
}
);
}

return panes;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -59,7 +59,7 @@ const RolesList = (props: RolesListProps): ReactElement => {

if (query === "") {
setProcessedRolesList(rolesList);

return;
}

Expand Down Expand Up @@ -125,7 +125,7 @@ const RolesList = (props: RolesListProps): ReactElement => {

return null;
};


/**
* Resolves data table columns.
Expand Down
Loading
Loading