Skip to content

Commit

Permalink
Merge pull request #7 from Bynder/improvement/grunt-building
Browse files Browse the repository at this point in the history
🔨 Sorted being able to install npm and build grunt
  • Loading branch information
CWDN authored May 30, 2024
2 parents 47b5254 + 36a3c06 commit e54fb4d
Show file tree
Hide file tree
Showing 16 changed files with 60 additions and 66 deletions.
2 changes: 1 addition & 1 deletion assets/css/gathercontent-importer.min.css

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions assets/css/sass/gathercontent-importer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ ul.gc-radio-desc li, ul.gc-reveal-items-list li {
&.text{
option[data-type="text"],
option[data-type="textarea"],
option[data-type="wysiwyg"]{
option[data-type="wysiwyg"]{
display:block;
}
}
&.attachment{
option[data-type="gallery"],
option[data-type="image"]{
display:block;
option[data-type="image"]{
display:block;
}
}
&.choice_checkbox{
Expand All @@ -204,14 +204,14 @@ ul.gc-radio-desc li, ul.gc-reveal-items-list li {
&.repeater{
option[data-type="text"],
option[data-type="textarea"],
option[data-type="wysiwyg"]{
option[data-type="wysiwyg"]{
display:none;
}
option[data-type="repeater"]{ display:block; }
}
}
}

.ajax-disabled{
opacity:0.75;
pointer-events:none;
Expand Down Expand Up @@ -391,6 +391,11 @@ ul.gc-radio-desc li, ul.gc-reveal-items-list li {
background-color: #f5bfbf;
}

.gc-component-disabled {
pointer-events: none;
opacity: 0.5;
}

@import 'sync';
@import 'modal';
@import 'single';
6 changes: 3 additions & 3 deletions assets/js/gathercontent-general.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Content Workflow Plugin - v1.0.0 - 2024-05-03
* http://www.gathercontent.com
* Content Workflow (by Bynder) - v1.0.0 - 2024-05-29
*
*
* Copyright (c) 2024 Bynder
* Copyright (c) 2024 Content Workflow (by Bynder)
* Licensed under the GPLv2 license.
*/

Expand Down
4 changes: 2 additions & 2 deletions assets/js/gathercontent-general.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions assets/js/gathercontent-mapping.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Content Workflow Plugin - v1.0.0 - 2024-05-03
* http://www.gathercontent.com
* Content Workflow (by Bynder) - v1.0.0 - 2024-05-29
*
*
* Copyright (c) 2024 GatherContent
* Copyright (c) 2024 Content Workflow (by Bynder)
* Licensed under the GPLv2 license.
*/

Expand Down Expand Up @@ -452,6 +452,7 @@ module.exports = function (app, _meta_keys) {
* 2nd Dropdown - event change
*/
changeValue: function changeValue(evt) {
var component = jQuery(evt.target).closest('.component-table-wrapper').attr('id');
var value = jQuery(evt.target).val();
var type = this.model.get('type');
var fieldType = this.model.get('field_type');
Expand All @@ -465,7 +466,6 @@ module.exports = function (app, _meta_keys) {
this.model.set('field_value', value);
// Components - Update "Field"
if ("component" === type) {
var component = jQuery(evt.target).closest('.component-table-wrapper').attr('id');
this.updateAjax_Field(component, value, false);
}
// Repeaters - Update "Field"
Expand Down Expand Up @@ -523,7 +523,7 @@ module.exports = function (app, _meta_keys) {
* AJAX Update: "Field" - ACF Field group's field
* - "Field" refers to the 3rd dropdown of the component fields top level
* - After selecting the field group from the 2nd dropdown, call WP_AJAX to get the relevent fields from the group selected and populate the 3rd dropdown (aka "Field")
*
*
* @param {string} component - ID without the "#" of the component parent row
* @param {string} field_name - Parent field name/key of the sub fields, should be a repeater
* @param {object} saved_fields - OPTIONAL: Pass saved subfields if you want to set pre-existing values
Expand Down Expand Up @@ -570,7 +570,7 @@ module.exports = function (app, _meta_keys) {
* AJAX Update: "Subfields" - ACF Field group's repeater subfields
* - "Subfields" are in the component accordion
* - After selecting the field group from the 3rd dropdown, call WP_AJAX to get the relevent subfields from the ACF Repeater selected and populate the subfields
*
*
* @param {string} component - ID without the "#" of the component parent row
* @param {string} field_name - Parent field name/key of the sub fields, should be a repeater
* @param {object} saved_fields - OPTIONAL: Pass saved subfields if you want to set pre-existing values
Expand Down
4 changes: 2 additions & 2 deletions assets/js/gathercontent-mapping.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions assets/js/gathercontent-single.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Content Workflow Plugin - v1.0.0 - 2024-05-03
* http://www.gathercontent.com
* Content Workflow (by Bynder) - v1.0.0 - 2024-05-29
*
*
* Copyright (c) 2024 GatherContent
* Copyright (c) 2024 Content Workflow (by Bynder)
* Licensed under the GPLv2 license.
*/

Expand Down
4 changes: 2 additions & 2 deletions assets/js/gathercontent-single.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions assets/js/gathercontent-sync.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Content Workflow Plugin - v1.0.0 - 2024-05-03
* http://www.gathercontent.com
* Content Workflow (by Bynder) - v1.0.0 - 2024-05-29
*
*
* Copyright (c) 2024 GatherContent
* Copyright (c) 2024 Content Workflow (by Bynder)
* Licensed under the GPLv2 license.
*/

Expand Down
4 changes: 2 additions & 2 deletions assets/js/gathercontent-sync.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions assets/js/gathercontent.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Content Workflow Plugin - v1.0.0 - 2024-05-03
* http://www.gathercontent.com
* Content Workflow (by Bynder) - v1.0.0 - 2024-05-29
*
*
* Copyright (c) 2024 GatherContent
* Copyright (c) 2024 Content Workflow (by Bynder)
* Licensed under the GPLv2 license.
*/

Expand Down
4 changes: 2 additions & 2 deletions assets/js/gathercontent.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions assets/js/src/components/views/tab-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = function( app, _meta_keys ) {
* 2nd Dropdown - event change
*/
changeValue: function( evt ) {
var component = jQuery( evt.target ).closest('.component-table-wrapper').attr('id');
var value = jQuery( evt.target ).val();
var type = this.model.get( 'type' );
var fieldType = this.model.get( 'field_type' );
Expand All @@ -58,19 +59,18 @@ module.exports = function( app, _meta_keys ) {
this.model.set( 'field_value', '' );
this.model.set( 'field_field', '' );
this.model.set( 'field_subfields', {} );
jQuery('#'+component+' .component-table-inner ').find('select').html("<option value=''>Unused</option>").val("");
jQuery('#'+component+' .component-table-inner ').find('select').html("<option value=''>Unused</option>").val("");
} else {
this.model.set( 'field_value', value );
// Components - Update "Field"
if( "component" === type ){
var component = jQuery( evt.target ).closest('.component-table-wrapper').attr('id');
this.updateAjax_Field(component, value, false);
}
// Repeaters - Update "Field"
else if( "wp-type-acf" === fieldType ){
var id = jQuery( evt.target ).closest('td').attr('id');
this.updateAjax_Field(id, value, false);
}
}
}
},

Expand All @@ -84,7 +84,7 @@ module.exports = function( app, _meta_keys ) {
this.model.set( 'field_subfields', {} );
if ( '' === value ) {
this.model.set( 'field_field', '' );
jQuery('#'+component+' .component-table-inner ').find('select').html("<option value=''>Unused</option>").val("");
jQuery('#'+component+' .component-table-inner ').find('select').html("<option value=''>Unused</option>").val("");
} else {
this.model.set( 'field_field', value );
// Update subfields
Expand All @@ -111,15 +111,15 @@ module.exports = function( app, _meta_keys ) {
var options_html = "<option value=''>Unused</option>";
jQuery.each(data.field_data, function(i, field) {
options_html += "<option class='hidden' value='"+field.key+"' data-type='"+field.type+"'>"+field.label+"</option>";
});
});
return options_html;
},

/**
* AJAX Update: "Field" - ACF Field group's field
* - "Field" refers to the 3rd dropdown of the component fields top level
* - After selecting the field group from the 2nd dropdown, call WP_AJAX to get the relevent fields from the group selected and populate the 3rd dropdown (aka "Field")
*
*
* @param {string} component - ID without the "#" of the component parent row
* @param {string} field_name - Parent field name/key of the sub fields, should be a repeater
* @param {object} saved_fields - OPTIONAL: Pass saved subfields if you want to set pre-existing values
Expand Down Expand Up @@ -166,7 +166,7 @@ module.exports = function( app, _meta_keys ) {
* AJAX Update: "Subfields" - ACF Field group's repeater subfields
* - "Subfields" are in the component accordion
* - After selecting the field group from the 3rd dropdown, call WP_AJAX to get the relevent subfields from the ACF Repeater selected and populate the subfields
*
*
* @param {string} component - ID without the "#" of the component parent row
* @param {string} field_name - Parent field name/key of the sub fields, should be a repeater
* @param {object} saved_fields - OPTIONAL: Pass saved subfields if you want to set pre-existing values
Expand Down
9 changes: 0 additions & 9 deletions includes/classes/admin/mapping-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,15 +541,6 @@ public function map_template() {
array('additionalClass' => 'gc-component-disabled'),
false
);

?>
<style>
.gc-component-disabled {
pointer-events: none;
opacity: 0.5;
}
</style>
<?php
}

if ( ! $sync_items && $mapping_id ) {
Expand Down
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"description": "Imports items from Content Workflow to your wordpress site",
"version": "1.0.0",
"license": "GPLv2",
"scripts": {
"build": "grunt build"
},
"repository": {
"type": "git",
"url": "https://github.com/Bynder/cw-wordpress-plugin"
Expand All @@ -14,7 +17,7 @@
"url": "https://www.bynder.com/products/content-workflow/"
},
"engines": {
"node": ">=14.0.0 <15.0.0"
"node": ">=14.0.0 <16.20.3"
},
"devDependencies": {
"autoprefixer": "^6.7.7",
Expand All @@ -23,24 +26,19 @@
"browserify-shim": "^3.8.14",
"chai": "^3.5.0",
"glob": "~5.0.15",
"grunt": "^1.4.1",
"grunt": "^1.6.1",
"grunt-browserify": "^4.0.1",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-compress": "^2.0.0",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-cssmin": "^0.12.3",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-mocha": "^1.0.4",
"grunt-phpunit": "^0.3.6",
"grunt-postcss": "^0.6.0",
"grunt-sass": "^3.1.0",
"grunt-postcss": "^0.9.0",
"grunt-contrib-jshint": "^3.2.0",
"grunt-contrib-uglify": "^5.2.2",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^5.0.0",
"grunt-wp-readme-to-markdown": "^0.9.0",
"load-grunt-config": "~0.17.2",
"load-grunt-tasks": "^3.5.2",
"node-sass": "^6.0.1"
"node-sass": "^9.0.0"
},
"browserify-shim": {
"jquery": "global:jQuery"
Expand Down
6 changes: 3 additions & 3 deletions tasks/options/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ module.exports = {
' | Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
' | Licensed <%= pkg.license %>' +
' */\n',
mangle: {
except: ['jQuery']
}
// mangle: {
// except: ['jQuery']
// }
}
}
};

0 comments on commit e54fb4d

Please sign in to comment.