Skip to content

Commit

Permalink
update issue #352
Browse files Browse the repository at this point in the history
- Added .gitignore for apptypes
- Fixed not able to add differnt version to dependency
- Fixed URL for Core and non core modules
- Fixed github link for apptypes
  • Loading branch information
oyeaussie committed Aug 23, 2024
1 parent e50194f commit b24b7e2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
17 changes: 11 additions & 6 deletions apps/Core/Packages/Devtools/Modules/DevtoolsModules.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ protected function addUpdateAppTypeFiles($appType)
if (!$dirExists) {//addGitkeep
$this->localContent->write($path . '/.gitkeep', '');
}

$file = $this->localContent->read('apps/Core/Packages/Devtools/Modules/Files/ApptypesGitignore.txt');
$this->localContent->write('apps/' . ucfirst($appType['app_type']) . '/.gitignore', $file);
} catch (FilesystemException | UnableToCheckExistence | UnableToWriteFile $exception) {
$this->addResponse('Unable to write json content to file: .gitkeep for apptypes');

Expand Down Expand Up @@ -2950,13 +2953,15 @@ public function generateModuleRepoUrl($data)
$name = preg_split('/(?=[A-Z])/', $name);

if ($data['module_type'] !== 'bundles') {
if (isset($baseView) && isset($baseView['name'])) {
$name = strtolower($baseView['name'] . '-' . implode('', $name));
} else {
$name = strtolower(implode('', $name));
}
if ($name[0] !== 'core') {
if (isset($baseView) && isset($baseView['name'])) {
$name = strtolower($baseView['name'] . '-' . implode('', $name));
} else {
$name = strtolower(implode('', $name));
}

$url .= '/' . $data['app_type'] . '-' . $data['module_type'] . '-' . $data['category'] . '-' . $name;
$url .= '/' . $data['app_type'] . '-' . $data['module_type'] . '-' . $data['category'] . '-' . $name;
}
} else {
$url .= '/' . $data['app_type'] . '-' . $data['module_type'] . '-' . strtolower(implode('', $name));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Components/*
Middlewares/*
Packages/*
Views/*
19 changes: 12 additions & 7 deletions apps/Core/Views/Default/html/devtools/modules/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -1295,9 +1295,14 @@
onSubmitResponse: function(response) {
if (response.responseData && response.responseData.newRepo && $('#repo-details').length > 0) {
$('#path').html(BazHelpers.capitalizeFirstLetter($('#{{componentId}}-{{sectionId}}-app_type').val()));
var devLink = '/src/branch/dev';

if (response.responseData.newRepo.html_url.includes('github')) {
devLink = '/tree/dev';
}
$('#repo_url').html(response.responseData.newRepo.clone_url);
$('#repo_url_dev').html(response.responseData.newRepo.html_url);
$('#repo_url_dev_a').attr('href', response.responseData.newRepo.html_url + '/src/branch/dev');
$('#repo_url_dev_a').attr('href', response.responseData.newRepo.html_url + devLink);

$('#repo-details').attr('hidden', false);
$('#module-details').attr('hidden', true);
Expand Down Expand Up @@ -3071,14 +3076,14 @@
var found = false;
if (label === 'core') {
dataCollectionSectionForm['vars']['moduleDependencies'][label] = { };
dataCollectionSectionForm['vars']['moduleDependencies'][label]['name'] = moduleData['name'];
dataCollectionSectionForm['vars']['moduleDependencies'][label]['version'] = moduleData['version'];
dataCollectionSectionForm['vars']['moduleDependencies'][label]['repo'] = moduleData['repo'];
dataCollectionSectionForm['vars']['moduleDependencies'][label]['name'] = $('#{{componentId}}-{{sectionId}}-dependencies-modulename').val();
dataCollectionSectionForm['vars']['moduleDependencies'][label]['version'] = $('#{{componentId}}-{{sectionId}}-dependencies-moduleversion').val();
dataCollectionSectionForm['vars']['moduleDependencies'][label]['repo'] = $('#{{componentId}}-{{sectionId}}-dependencies-modulerepo').val();
} else if (label === 'apptypes') {
dataCollectionSectionForm['vars']['moduleDependencies']['apptype'] = { };
dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['name'] = moduleData['name'];
dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['version'] = moduleData['version'];
dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['repo'] = moduleData['repo'];
dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['name'] = $('#{{componentId}}-{{sectionId}}-dependencies-modulename').val();
dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['version'] = $('#{{componentId}}-{{sectionId}}-dependencies-moduleversion').val();
dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['repo'] = $('#{{componentId}}-{{sectionId}}-dependencies-modulerepo').val();
} else if (label === 'external') {
if (dataCollectionSectionForm['vars']['module_type'] === 'core') {
if (!dataCollectionSectionForm['vars']['moduleDependencies']['composer']) {
Expand Down

0 comments on commit b24b7e2

Please sign in to comment.