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

feat: improved handling of clone and group fields #193

Merged
merged 25 commits into from
Apr 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
29da8c9
- this allows the Schema to load, but still doesn't fully solve the p…
jasonbahl Apr 5, 2024
dfd3701
- update Registry to determine clone interfaces that should be applie…
jasonbahl Apr 8, 2024
5c23a50
- composer fix-cs
jasonbahl Apr 8, 2024
2164ffb
- update repeater
jasonbahl Apr 8, 2024
7a43e86
- update logic in the clone field to better handle prefixed and non-p…
jasonbahl Apr 8, 2024
c804b07
- add tests for issue 172 including specific ACF Field Group Exports
jasonbahl Apr 9, 2024
29736bb
- composer check-cs / fix-cs
jasonbahl Apr 9, 2024
75329b1
- modify the JavaScript in main.js that collects form fields to send …
jasonbahl Apr 17, 2024
499c392
- bail earlier if field groups are already identified as having been …
jasonbahl Apr 17, 2024
d23170a
- prevent duplicate registration of connections for WPGraphQL v1.24 a…
jasonbahl Apr 17, 2024
4bf0557
Merge branch 'fix/interface-recursion' into fix/172-cloning-group-fields
jasonbahl Apr 17, 2024
112f8cb
- phpcs
jasonbahl Apr 17, 2024
c703c0c
- update phpstan/constants.php to be compatible with latest stubs
jasonbahl Apr 18, 2024
ca9adbb
- update phpstan/constants.php to be compatible with latest stubs
jasonbahl Apr 18, 2024
7b5d0f7
- update `get_parent_graphql_type_name` to reduce unnecessary recursion
jasonbahl Apr 18, 2024
ff391e8
- use acf_get_fields instead of acf_get_raw_fields
jasonbahl Apr 18, 2024
4c6e695
- update FieldConfig to check for values prefixed with `_` for resolu…
jasonbahl Apr 18, 2024
829ca4e
- composer fix-cs
jasonbahl Apr 18, 2024
1079ce3
- update app.setup.sh to allow testing against different branches of …
jasonbahl Apr 19, 2024
e4761ca
- add test for issue #197 (test passes against this PR branch: https:…
jasonbahl Apr 19, 2024
24152cf
- revert the change to acf_get_raw_fields back to acf_get_fields
jasonbahl Apr 22, 2024
43d2b91
- add another test for issue 172 (noted in the comments)
jasonbahl Apr 22, 2024
7ebc8a4
- composer fix-phpcs
jasonbahl Apr 22, 2024
6f56781
Merge commit 'd44413e138f947625195405be861d734b3cf6d4d' into fix/172-…
jasonbahl Apr 23, 2024
054a010
- revert the change to use acf_get_fields instead of acf_get_raw_fields
jasonbahl Apr 24, 2024
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
36 changes: 27 additions & 9 deletions docker/app.setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ACF_VERSION=${ACF_VERSION-"latest"}
ACF_PRO=${ACF_PRO-false}
WPGRAPHQL_CONTENT_BLOCKS=${WPGRAPHQL_CONTENT_BLOCKS-false}
WPGRAPHQL_CONTENT_BLOCKS_VERSION=${WPGRAPHQL_CONTENT_BLOCKS_VERSION-"latest"}
WPGRAPHQL_GIT_REPO=${WPGRAPHQL_GIT_REPO-}
WPGRAPHQL_GIT_BRANCH=${WPGRAPHQL_GIT_BRANCH-"develop"}

#// fallback to hello.php as a hack. dont love this, but we have to pass a slug.
export WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_SLUG=${WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_SLUG-'hello.php'}
Expand All @@ -36,15 +38,31 @@ apt-get -y update
apt-get -y install jq

if [ ! -f "${PLUGINS_DIR}/wp-graphql/wp-graphql.php" ]; then
# WPGRAPHQL_VERSION in format like v1.2.3 or latest
echo "Install wp-graphql version (${WPGRAPHQL_VERSION})"
if [[ -z ${WPGRAPHQL_VERSION} || "${WPGRAPHQL_VERSION}" == "latest" ]]; then
echo "Installing latest WPGraphQL from WordPress.org"
wp plugin install wp-graphql --activate --allow-root
else
echo "Installing WPGraphQL from Github"
wp plugin install "https://downloads.wordpress.org/plugin/wp-graphql.${WPGRAPHQL_VERSION-1.4.3}.zip" --allow-root --activate
fi


# if WPGRAPHQL_GIT_REPO is set, we'll install from the repo
if [[ -n ${WPGRAPHQL_GIT_REPO} ]]; then
echo "Installing WPGraphQL from GitHub repo ${WPGRAPHQL_GIT_REPO}"
# Clone the repository
git clone -b ${WPGRAPHQL_GIT_BRANCH} ${WPGRAPHQL_GIT_REPO} "${PLUGINS_DIR}/wp-graphql"
# Navigate to the plugin directory
cd "${PLUGINS_DIR}/wp-graphql"
# Install dependencies with Composer
composer install --no-dev
# Optionally activate the plugin using wp-cli
wp plugin activate wp-graphql --allow-root
Comment on lines +45 to +53
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE:

This allows us to run tests against arbitrary branches of WPGraphQL.

For example, this feature relies on some work in this PR (wp-graphql/wp-graphql#3100)

So, I was able to update my .env.testing file with these values:

 WPGRAPHQL_GIT_REPO="https://github.com/jasonbahl/wp-graphql.git"
 WPGRAPHQL_GIT_BRANCH="fix/interface-recursion"

And tests pass when running against that branch of WPGraphQL 👏🏻 👏🏻

CleanShot 2024-04-19 at 11 40 22

else
# WPGRAPHQL_VERSION in format like v1.2.3 or latest
echo "Install wp-graphql version (${WPGRAPHQL_VERSION})"
if [[ -z ${WPGRAPHQL_VERSION} || "${WPGRAPHQL_VERSION}" == "latest" ]]; then
echo "Installing latest WPGraphQL from WordPress.org"
wp plugin install wp-graphql --activate --allow-root
else
echo "Installing WPGraphQL from Github"
wp plugin install "https://downloads.wordpress.org/plugin/wp-graphql.${WPGRAPHQL_VERSION-1.4.3}.zip" --allow-root --activate
fi
fi

fi

# Activate the plugin
Expand Down