Skip to content

Commit

Permalink
Merge pull request 'dev' (#556) from dev into main
Browse files Browse the repository at this point in the history
  • Loading branch information
oyeaussie committed May 19, 2024
2 parents 9270ecb + c6d08e0 commit f3385b4
Show file tree
Hide file tree
Showing 9 changed files with 367 additions and 391 deletions.
2 changes: 2 additions & 0 deletions apps/Core/Components/Devtools/Modules/ModulesComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ public function viewAction()
}

if ($this->view->newrelease) {
$this->view->availableReleaseTypes = $this->modulesPackage->getAvailableReleaseTypes();

$module['isPreRelease'] = false;
$module['preRelease'] = false;
$module['buildMeta'] = false;
Expand Down
315 changes: 238 additions & 77 deletions apps/Core/Packages/Devtools/Modules/DevtoolsModules.php

Large diffs are not rendered by default.

71 changes: 54 additions & 17 deletions apps/Core/Views/Default/html/devtools/modules/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,33 @@
$('#custom').attr('hidden', true);
$('#{{componentId}}-{{sectionId}}-custom-version').val('');

if (bump === 'buildMeta') {
$('#{{componentId}}-{{sectionId}}-build-meta-prefix').val('');
$('#{{componentId}}-{{sectionId}}-pre-release-prefix').val('');
$('#{{componentId}}-{{sectionId}}-build-meta-prefix').attr('disabled', false);
$('#{{componentId}}-{{sectionId}}-pre-release-prefix').attr('disabled', true);
$('#{{componentId}}-{{sectionId}}-force-mark-prerelease').attr('disabled', true);
$('#{{componentId}}-{{sectionId}}-force-mark-prerelease')[0].checked = true;
} else if (bump === 'preRelease') {
if (bump === 'preRelease' ||
bump === 'major_preRelease' ||
bump === 'minor_preRelease' ||
bump === 'patch_preRelease'
) {
$('#{{componentId}}-{{sectionId}}-pre-release-prefix').val('');
$('#{{componentId}}-{{sectionId}}-build-meta-prefix').val('');
$('#{{componentId}}-{{sectionId}}-pre-release-prefix').attr('disabled', false);
$('#{{componentId}}-{{sectionId}}-build-meta-prefix').attr('disabled', true);
$('#{{componentId}}-{{sectionId}}-force-mark-prerelease').attr('disabled', true);
$('#{{componentId}}-{{sectionId}}-force-mark-prerelease')[0].checked = true;
} else if (bump === 'preReleaseBuildMeta') {
} else if (bump === 'buildMeta' ||
bump === 'major_buildMeta' ||
bump === 'minor_buildMeta' ||
bump === 'patch_buildMeta'
) {
$('#{{componentId}}-{{sectionId}}-build-meta-prefix').val('');
$('#{{componentId}}-{{sectionId}}-pre-release-prefix').val('');
$('#{{componentId}}-{{sectionId}}-build-meta-prefix').attr('disabled', false);
$('#{{componentId}}-{{sectionId}}-pre-release-prefix').attr('disabled', true);
$('#{{componentId}}-{{sectionId}}-force-mark-prerelease').attr('disabled', true);
$('#{{componentId}}-{{sectionId}}-force-mark-prerelease')[0].checked = true;
} else if (bump === 'preReleaseBuildMeta' ||
bump === 'major_preReleaseBuildMeta' ||
bump === 'minor_preReleaseBuildMeta' ||
bump === 'patch_preReleaseBuildMeta'
) {
$('#{{componentId}}-{{sectionId}}-pre-release-prefix').val('');
$('#{{componentId}}-{{sectionId}}-build-meta-prefix').val('');
$('#{{componentId}}-{{sectionId}}-pre-release-prefix').attr('disabled', false);
Expand Down Expand Up @@ -172,19 +184,31 @@
postData['force-mark-prerelease'] = $('#{{componentId}}-{{sectionId}}-force-mark-prerelease')[0].checked;
postData['bump'] = bump;

if (bump === 'preRelease') {
if (bump === 'preRelease' ||
bump === 'major_preRelease' ||
bump === 'minor_preRelease' ||
bump === 'patch_preRelease'
) {
postData['preReleasePrefix'] = $('#{{componentId}}-{{sectionId}}-pre-release-prefix').val();
if (postData['preReleasePrefix'] === '') {
PNotify.error({'text': 'Provide pre-release prefix.'});
return;
}
} else if (bump === 'buildMeta') {
} else if (bump === 'buildMeta' ||
bump === 'major_buildMeta' ||
bump === 'minor_buildMeta' ||
bump === 'patch_buildMeta'
) {
postData['buildMetaPrefix'] = $('#{{componentId}}-{{sectionId}}-build-meta-prefix').val();
if (postData['buildMetaPrefix'] === '') {
PNotify.error({'text': 'Provide build meta prefix.'});
return;
}
} else if (bump === 'preReleaseBuildMeta') {
} else if (bump === 'preReleaseBuildMeta' ||
bump === 'major_preReleaseBuildMeta' ||
bump === 'minor_preReleaseBuildMeta' ||
bump === 'patch_preReleaseBuildMeta'
) {
postData['preReleasePrefix'] = $('#{{componentId}}-{{sectionId}}-pre-release-prefix').val();
postData['buildMetaPrefix'] = $('#{{componentId}}-{{sectionId}}-build-meta-prefix').val();
if (postData['preReleasePrefix'] === '') {
Expand Down Expand Up @@ -301,24 +325,36 @@
$('#{{componentId}}-{{sectionId}}').BazContentSectionWithForm({'task':'validateForm'});

if ($('#{{componentId}}-{{sectionId}}-alert').length === 0) {
$('#generate').attr('disabled', true);
$('#generate').children('i').removeClass('fa-wand-sparkles').addClass('fa-spin fa-cog');
// $('#generate').attr('disabled', true);
// $('#generate').children('i').removeClass('fa-wand-sparkles').addClass('fa-spin fa-cog');

var postData = { };
postData['bump'] = $('#{{componentId}}-{{sectionId}}-release-type').val();
if (postData['bump'] === 'preRelease') {
if (postData['bump'] === 'preRelease' ||
postData['bump'] === 'major_preRelease' ||
postData['bump'] === 'minor_preRelease' ||
postData['bump'] === 'patch_preRelease'
) {
postData['preReleasePrefix'] = $('#{{componentId}}-{{sectionId}}-pre-release-prefix').val();
if (postData['preReleasePrefix'] === '') {
PNotify.error({'text': 'Provide pre-release prefix.'});
return;
}
} else if (postData['bump'] === 'buildMeta') {
} else if (postData['bump'] === 'buildMeta' ||
postData['bump'] === 'major_buildMeta' ||
postData['bump'] === 'minor_buildMeta' ||
postData['bump'] === 'patch_buildMeta'
) {
postData['buildMetaPrefix'] = $('#{{componentId}}-{{sectionId}}-build-meta-prefix').val();
if (postData['buildMetaPrefix'] === '') {
PNotify.error({'text': 'Provide build meta prefix.'});
return;
}
} else if (postData['bump'] === 'preReleaseBuildMeta') {
} else if (postData['bump'] === 'preReleaseBuildMeta' ||
postData['bump'] === 'major_preReleaseBuildMeta' ||
postData['bump'] === 'minor_preReleaseBuildMeta' ||
postData['bump'] === 'patch_preReleaseBuildMeta'
) {
postData['preReleasePrefix'] = $('#{{componentId}}-{{sectionId}}-pre-release-prefix').val();
postData['buildMetaPrefix'] = $('#{{componentId}}-{{sectionId}}-build-meta-prefix').val();
if (postData['preReleasePrefix'] === '') {
Expand Down Expand Up @@ -1223,6 +1259,7 @@
$('#repo-details').attr('hidden', false);
$('#module-details').attr('hidden', true);
$('.addData').attr('hidden', true);
$('.updateData').attr('hidden', true);
$('.cancelForm').attr('hidden', true);
$('.closeForm').attr('hidden', false);

Expand Down
39 changes: 5 additions & 34 deletions apps/Core/Views/Default/html/devtools/modules/module/release.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,40 +175,11 @@
'fieldAdditionalClass' : 'mb-2',
'fieldBazScan' : true,
'fieldHelpTooltipContent' : 'Select release type: Major, Minor Or Patch.',
'fieldDataSelect2Options' : {
'major' : {
'id' : 'major',
'name' : 'MAJOR'
},
'minor' : {
'id' : 'minor',
'name' : 'MINOR'
},
'patch' : {
'id' : 'patch',
'name' : 'PATCH'
},
'preRelease' : {
'id' : 'preRelease',
'name' : 'PRE RELEASE'
},
'buildMeta' : {
'id' : 'buildMeta',
'name' : 'BUILD META'
},
'preReleaseBuildMeta' : {
'id' : 'preReleaseBuildMeta',
'name' : 'PRE RELEASE + BUILD META'
},
'custom' : {
'id' : 'custom',
'name' : 'CUSTOM (NON SEMANTIC VERSION)'
}
},
'fieldDataSelect2OptionsArray' : true,
'fieldDataSelect2OptionsKey' : 'id',
'fieldDataSelect2OptionsValue' : 'name',
'fieldDataSelect2OptionsSelected' : releastTypeSelect
'fieldDataSelect2Options' : availableReleaseTypes,
'fieldDataSelect2OptionsArray' : true,
'fieldDataSelect2OptionsKey' : 'id',
'fieldDataSelect2OptionsValue' : 'name',
'fieldDataSelect2OptionsSelected' : releastTypeSelect
]
)}}
</div>
Expand Down
3 changes: 2 additions & 1 deletion apps/Core/Views/Default/html/devtools/modules/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
'cardBodyInclude' : 'modules/module',
'formButtons' :
[
'cancelActionUrl' : 'devtools/modules'
'cancelActionUrl' : 'devtools/modules',
'closeActionUrl' : 'devtools/modules'
],
'formSecondaryButtons' :
[
Expand Down
Loading

0 comments on commit f3385b4

Please sign in to comment.