-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from newfold-labs/add/PRESS0-1877
Add/press0 1877
- Loading branch information
Showing
8 changed files
with
248 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Cypress Tests for Module Updates in Brand Plugin | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, ready_for_review, synchronize] | ||
branches: | ||
- main | ||
- trunk | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
runs-on: ubuntu-latest | ||
outputs: | ||
branch: ${{ steps.extract_branch.outputs.branch }} | ||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
bluehost: | ||
name: Bluehost Build and Test | ||
needs: setup | ||
uses: newfold-labs/workflows/.github/workflows/module-plugin-test.yml@main | ||
with: | ||
only-module-tests: true | ||
module-repo: ${{ github.repository }} | ||
module-branch: ${{ needs.setup.outputs.branch }} | ||
plugin-repo: 'bluehost/bluehost-wordpress-plugin' | ||
secrets: inherit | ||
|
||
hostgator: | ||
name: HostGator Build and Test | ||
needs: setup | ||
uses: newfold-labs/workflows/.github/workflows/module-plugin-test.yml@main | ||
with: | ||
only-module-tests: true | ||
module-repo: ${{ github.repository }} | ||
module-branch: ${{ needs.setup.outputs.branch }} | ||
plugin-repo: 'newfold-labs/wp-plugin-hostgator' | ||
secrets: inherit | ||
|
||
crazydomains: | ||
name: Crazy Domains Build and Test | ||
needs: setup | ||
uses: newfold-labs/workflows/.github/workflows/module-plugin-test.yml@main | ||
with: | ||
only-module-tests: true | ||
module-repo: ${{ github.repository }} | ||
module-branch: ${{ needs.setup.outputs.branch }} | ||
plugin-repo: 'newfold-labs/wp-plugin-crazy-domains' | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
//Changes the text of the wordpress to wordpress content in import | ||
const importer_titles = document.getElementsByClassName("importer-title"); | ||
if( importer_titles ){ | ||
[...importer_titles].forEach((val, index) => { | ||
if( val?.outerText === 'WordPress'){ | ||
document.getElementsByClassName("importer-title")[index].innerText = migration.wordpress_title | ||
} | ||
}) | ||
} | ||
|
||
// designs a modal for migration tool | ||
const node = document.createElement("div"); | ||
node.innerHTML = `<div class='migrate-screen'> | ||
<div class='nfd-migration-loading'><span class='nfd-migration-loader'></span><h2 class='nfd-migration-title'>${migration.migration_title}</h2></div> | ||
${migration.migration_description} | ||
</div>`; | ||
|
||
node.style.position = "absolute"; | ||
node.style.top = "0"; | ||
node.style.bottom = "0"; | ||
node.style.right = "0"; | ||
node.style.left = "0"; | ||
node.style.backgroundColor = "#ffffff5e"; | ||
node.style.display = "none"; | ||
node.style.alignItems = "center"; | ||
node.style.justifyContent = "center"; | ||
node.setAttribute("id", "migration-progress-modal") | ||
|
||
document.getElementById("wpbody-content").appendChild(node) | ||
|
||
// load a pop up when user clicks on run importer for wordpress migration tool | ||
document.querySelector('a[href*="import=site_migration_wordpress_importer"]')?.addEventListener('click', function(e) { | ||
e.preventDefault(); | ||
document.getElementById("migration-progress-modal").style.display = "flex"; | ||
|
||
fetch( | ||
nfdplugin.restApiUrl + "/newfold-migration/v1/migrate/connect&_locale=user", | ||
{ | ||
credentials: 'same-origin', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'X-WP-Nonce': nfdplugin.restApiNonce, | ||
}, | ||
} | ||
) | ||
.then((response) => response.json()) | ||
.then(res => { | ||
fetch( | ||
nfdplugin.restApiUrl + "/newfold-data/v1/events&_locale=user", | ||
{ | ||
credentials: 'same-origin', | ||
method: 'post', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'X-WP-Nonce': nfdplugin.restApiNonce, | ||
}, | ||
body: JSON.stringify({ | ||
action: "migration_initiated_tools", | ||
category: "user_action", | ||
data: { | ||
page: window.location.href | ||
}}) | ||
}, | ||
) | ||
document.getElementById("migration-progress-modal").style.display = "none"; | ||
if(res?.success){ | ||
window.open(res?.data?.redirect_url, "_self") | ||
} | ||
// else{ | ||
// alert("please try again in sometime. Thanks!") | ||
// } | ||
}) | ||
.catch(err => console.error(err)) | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.migrate-screen{ | ||
box-shadow: 1px 2px 8px; | ||
font-size: 15px; | ||
display: flex; | ||
flex-direction: column; | ||
background-color: #fff; | ||
padding: 24px 32px 32px 24px; | ||
gap: 15px; | ||
border-radius: 4px 0px 0px 0px; | ||
margin-top: 1%; | ||
max-width: max-content; | ||
} | ||
|
||
.nfd-migration-loading{ | ||
display: flex; | ||
gap: 16px; | ||
align-items: center; | ||
} | ||
.nfd-migration-title{ | ||
display: inline-block; | ||
font-family: Open Sans; | ||
font-size: 20px; | ||
font-weight: 600; | ||
line-height: 27.24px; | ||
text-align: left; | ||
} | ||
|
||
.nfd-migration-loader { | ||
display: inline-block; | ||
border: 4px solid #949FB1; | ||
border-radius: 50%; | ||
border-top: 4px solid #0060F0; | ||
width: 29px; | ||
height: 28px; | ||
-webkit-animation: spin 2s linear infinite; /* Safari */ | ||
animation: spin 2s linear infinite; | ||
} | ||
|
||
/* Safari */ | ||
@-webkit-keyframes spin { | ||
0% { -webkit-transform: rotate(0deg); } | ||
100% { -webkit-transform: rotate(360deg); } | ||
} | ||
|
||
@keyframes spin { | ||
0% { transform: rotate(0deg); } | ||
100% { transform: rotate(360deg); } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters