Merge branch 'develop' of https://github.com/makeplane/plane into refactor/mobx-store

This commit is contained in:
Aaryan Khandelwal 2023-12-15 17:16:52 +05:30
commit 5086ac4c2e
7 changed files with 29 additions and 44 deletions

View File

@ -1,11 +1,13 @@
name: Create PR in Plane EE Repository to sync the changes
name: Create Sync Action
on:
pull_request:
branches:
- master
- develop # Change this to preview
types:
- closed
env:
SOURCE_BRANCH_NAME: ${{github.event.pull_request.base.ref}}
jobs:
create_pr:
@ -16,27 +18,13 @@ jobs:
pull-requests: write
contents: read
steps:
- name: Check SOURCE_REPO
id: check_repo
env:
SOURCE_REPO: ${{ secrets.SOURCE_REPO_NAME }}
run: |
echo "::set-output name=is_correct_repo::$(if [[ "$SOURCE_REPO" == "makeplane/plane" ]]; then echo 'true'; else echo 'false'; fi)"
- name: Checkout Code
if: steps.check_repo.outputs.is_correct_repo == 'true'
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Branch Name
if: steps.check_repo.outputs.is_correct_repo == 'true'
run: |
echo "SOURCE_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
- name: Setup GH CLI
if: steps.check_repo.outputs.is_correct_repo == 'true'
run: |
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
@ -46,34 +34,22 @@ jobs:
sudo apt install gh -y
- name: Create Pull Request
if: steps.check_repo.outputs.is_correct_repo == 'true'
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
TARGET_REPO="${{ secrets.TARGET_REPO_NAME }}"
TARGET_BRANCH="${{ secrets.TARGET_REPO_BRANCH }}"
TARGET_REPO="${{ secrets.SYNC_TARGET_REPO_NAME }}"
TARGET_BRANCH="${{ secrets.SYNC_TARGET_BRANCH_NAME }}"
TARGET_BASE_BRANCH="${{ secrets.SYNC_TARGET_BASE_BRANCH_NAME }}"
SOURCE_BRANCH="${{ env.SOURCE_BRANCH_NAME }}"
git checkout $SOURCE_BRANCH
git remote add target "https://$GH_TOKEN@github.com/$TARGET_REPO.git"
git push target $SOURCE_BRANCH:$SOURCE_BRANCH
git remote add target-origin "https://$GH_TOKEN@github.com/$TARGET_REPO.git"
git push target-origin $SOURCE_BRANCH:$TARGET_BRANCH
PR_TITLE="${{ github.event.pull_request.title }}"
PR_BODY="${{ github.event.pull_request.body }}"
# Remove double quotes
PR_TITLE_CLEANED="${PR_TITLE//\"/}"
PR_BODY_CLEANED="${PR_BODY//\"/}"
# Construct PR_BODY_CONTENT using a here-document
PR_BODY_CONTENT=$(cat <<EOF
$PR_BODY_CLEANED
EOF
)
PR_TITLE=${{secrets.SYNC_PR_TITLE}}
gh pr create \
--base $TARGET_BRANCH \
--head $SOURCE_BRANCH \
--title "[SYNC] $PR_TITLE_CLEANED" \
--body "$PR_BODY_CONTENT" \
--base $TARGET_BASE_BRANCH \
--head $TARGET_BRANCH \
--title "$PR_TITLE" \
--repo $TARGET_REPO

View File

@ -118,6 +118,7 @@ export const LinkModal: FC<Props> = (props) => {
ref={ref}
hasError={Boolean(errors.url)}
placeholder="https://..."
pattern="^(https?://).*"
className="w-full"
/>
)}

View File

@ -0,0 +1,5 @@
export const SWR_CONFIG = {
refreshWhenHidden: false,
revalidateIfStale: false,
errorRetryCount: 3,
};

View File

@ -12,6 +12,9 @@ import { THEMES } from "constants/themes";
import InstanceLayout from "layouts/instance-layout";
// contexts
import { ToastContextProvider } from "contexts/toast.context";
import { SWRConfig } from "swr";
// constants
import { SWR_CONFIG } from "constants/swr-config";
// dynamic imports
const StoreWrapper = dynamic(() => import("lib/wrappers/store-wrapper"), { ssr: false });
const PosthogWrapper = dynamic(() => import("lib/wrappers/posthog-wrapper"), { ssr: false });
@ -51,7 +54,7 @@ export const AppProvider: FC<IAppProvider> = observer((props) => {
posthogAPIKey={envConfig?.posthog_api_key || null}
posthogHost={envConfig?.posthog_host || null}
>
{children}
<SWRConfig value={SWR_CONFIG}>{children}</SWRConfig>
</PosthogWrapper>
</CrispWrapper>
</StoreWrapper>

View File

@ -170,7 +170,7 @@ export class CycleIssuesFilterStore extends IssueFilterBaseStore implements ICyc
return filters;
} catch (error) {
this.fetchFilters(workspaceSlug, projectId, cycleId);
console.log("error in fetchCycleFilters", error);
throw error;
}
};
@ -215,7 +215,7 @@ export class CycleIssuesFilterStore extends IssueFilterBaseStore implements ICyc
await this.fetchCycleFilters(workspaceSlug, projectId, cycleId);
return;
} catch (error) {
this.fetchFilters(workspaceSlug, projectId, cycleId);
console.log("error in cycleFetchFilters", error);
throw error;
}
};

View File

@ -170,7 +170,7 @@ export class ModuleIssuesFilterStore extends IssueFilterBaseStore implements IMo
return filters;
} catch (error) {
this.fetchFilters(workspaceSlug, projectId, moduleId);
console.log("error in moduleFetchFilters", error);
throw error;
}
};
@ -216,7 +216,7 @@ export class ModuleIssuesFilterStore extends IssueFilterBaseStore implements IMo
await this.fetchModuleFilters(workspaceSlug, projectId, moduleId);
return;
} catch (error) {
this.fetchFilters(workspaceSlug, projectId, moduleId);
console.log("error in projectFetchFilters", error);
throw error;
}
};

View File

@ -170,7 +170,7 @@ export class ViewIssuesFilterStore extends IssueFilterBaseStore implements IView
return filters;
} catch (error) {
this.fetchFilters(workspaceSlug, projectId, viewId);
console.log("error in viewFetchFilters", error);
throw error;
}
};
@ -216,7 +216,7 @@ export class ViewIssuesFilterStore extends IssueFilterBaseStore implements IView
await this.fetchViewFilters(workspaceSlug, projectId, viewId);
return;
} catch (error) {
this.fetchFilters(workspaceSlug, projectId, viewId);
console.log("error in viewFetchFilters", error);
throw error;
}
};