Skip to content

Commit

Permalink
Merge #5557
Browse files Browse the repository at this point in the history
5557: Fix: end to end test bugs r=jniles a=jniles

Fixes a number of test bugs introduced by the transition to Jenkins and the changes we've made to Stock Management.

Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
  • Loading branch information
bors[bot] and jniles authored Apr 12, 2021
2 parents 515248d + 94e7c97 commit e2f6ec4
Show file tree
Hide file tree
Showing 37 changed files with 166 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
name="requestor"
type="radio"
ng-model="$ctrl.requestorType"
ng-value="requestor"
ng-change="$ctrl.onChangeRequestor()"
ng-value="requestor"
data-requestor-option="{{ requestor.type_key }}"
ng-required="$ctrl.required">
<span translate>{{ requestor.title_key }}</span>
Expand Down Expand Up @@ -47,4 +47,3 @@
</bh-depot-select>
</div>
</div>

6 changes: 3 additions & 3 deletions client/src/js/components/bhServiceOrDepot/bhServiceOrDepot.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ angular.module('bhima.components')
});

bhServiceOrDepotController.$inject = [
'ServiceService', 'DepotService', 'StockService', 'NotifyService',
'ServiceService', 'DepotService', 'StockService', 'NotifyService', '$q',
];

/**
* service or depot selection component
*/
function bhServiceOrDepotController(Services, Depots, Stock, Notify) {
function bhServiceOrDepotController(Services, Depots, Stock, Notify, $q) {
const $ctrl = this;

$ctrl.$onInit = function onInit() {
$ctrl.label = $ctrl.label || 'REQUISITION.SERVICE_OR_DEPOT';

Promise.all([
$q.all([
Stock.stockRequestorType.read(),
Depots.read(),
Services.read(),
Expand Down
1 change: 1 addition & 0 deletions client/src/modules/ipr_tax/ipr_tax.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ angular.module('bhima.routes')
params : {
taxIprId : { value : null },
id : { value : null },
isCreateState : { value : false },
},
onEnter : ['$uibModal', '$transition$', iprTaxConfigModal],
onExit : ['$uibModalStack', closeModal],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module('bhima.controllers')
.controller('ConfigurationController', ConfigurationController);
.controller('ConfigurationController', ConfigurationController);

ConfigurationController.$inject = [
'ConfigurationService', 'ModalService',
Expand Down Expand Up @@ -37,7 +37,6 @@ function ConfigurationController(Configs, ModalService,
vm.gridApi = {};
vm.filterEnabled = false;


// options for the UI grid
vm.gridOptions = {
appScopeProvider : vm,
Expand Down Expand Up @@ -76,9 +75,8 @@ function ConfigurationController(Configs, ModalService,
function deleteConfig(title) {
ModalService.confirm('FORM.DIALOGS.CONFIRM_DELETE')
.then((bool) => {
if (!bool) { return; }

Configs.delete(title.id);
if (!bool) { return 0; }
return Configs.delete(title.id);
})
.then(() => {
Notify.success('FORM.INFO.DELETE_SUCCESS');
Expand Down
2 changes: 2 additions & 0 deletions client/src/modules/stock/entry/modals/lots.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,15 @@ function StockDefineLotsModalController(

function getFirstEmptyLot() {
let line;

for (let i = 0; i < vm.form.rows.length; i++) {
const row = vm.form.rows[i];
if (!row.lot || row.lot.length === 0) {
line = row;
break;
}
}

return line;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
uuid="$ctrl.model.requestor_uuid"
label="REQUISITION.RECEIVER"
on-select-callback="$ctrl.onSelectRequestor(requestor)"
ng-value="requestor"
required="true">
</bh-service-or-depot>

<!-- inventories -->
<div class="form-group">
<label translate>FORM.LABELS.ARTICLES</label>

<div style="margin-bottom: 5px;" class="space-between">
<div style="margin-bottom: 5px;" class="space-between">
<bh-add-item callback="$ctrl.addItem(numItem)" disable="true"></bh-add-item>

<button ng-disabled="!$ctrl.enableAutoSuggest || $ctrl.loadingSuggest" ng-click="$ctrl.autoSuggestInventories()" type="button" class="btn btn-success">
Expand Down
13 changes: 5 additions & 8 deletions client/src/modules/survey_form/modals/survey_form.modals.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,18 @@ <h1>
</div>
</div>
</div>

<!-- hint -->
<div class="form-group">
<label class="control-label" translate>FORM.LABELS.HINT</label>
<div>
<textarea
ng-model="SurveyFormModalCtrl.surveyForm.hint"
name="hint"
class="form-control"
rows="4">
</textarea>
</div>
</div>

<!-- required -->
<div class="checkbox">
<label>
Expand All @@ -140,15 +140,12 @@ <h1>
ng-true-value="1"
ng-false-value="0"
ng-model="SurveyFormModalCtrl.surveyForm.required">
<span translate>
<strong>
FORM.LABELS.REQUIRED
</strong>
</span>
<strong translate>FORM.LABELS.REQUIRED</strong>
</label>
</div>

<hr>
<hr />

<!-- default -->
<div class="form-group" ng-class="{ 'has-error' : SurveyFormForm.$submitted && SurveyFormForm.default.$invalid }">
<label class="control-label" translate>FORM.LABELS.DEFAULT</label>
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/users/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function UsersController($state, $uibModal, Users, Notify, Modal, uiGridConstant
}

function startup() {
if ($state.params.filters.length) {
if ($state.params.filters && $state.params.filters.length) {
Users.filters.replaceFiltersFromState($state.params.filters);
Users.cacheFilters();
}
Expand Down
87 changes: 46 additions & 41 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.3.3)
activesupport (6.0.3.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -16,46 +16,49 @@ GEM
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.7)
dnsruby (1.61.4)
concurrent-ruby (1.1.8)
dnsruby (1.61.5)
simpleidn (~> 0.1)
em-websocket (0.5.1)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
ethon (0.12.0)
ffi (>= 1.3.0)
eventmachine (1.2.7)
execjs (2.7.0)
faraday (1.0.1)
faraday (1.3.0)
faraday-net_http (~> 1.0)
multipart-post (>= 1.2, < 3)
ffi (1.13.1)
ruby2_keywords
faraday-net_http (1.0.1)
ffi (1.15.0)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (207)
github-pages-health-check (= 1.16.1)
github-pages (214)
github-pages-health-check (= 1.17.0)
jekyll (= 3.9.0)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.1.6)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.13.0)
jekyll-feed (= 0.15.1)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.13.0)
jekyll-mentions (= 1.5.1)
jekyll-mentions (= 1.6.0)
jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.3.0)
jekyll-redirect-from (= 0.15.0)
jekyll-redirect-from (= 0.16.0)
jekyll-relative-links (= 0.6.1)
jekyll-remote-theme (= 0.4.1)
jekyll-remote-theme (= 0.4.3)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.6.1)
jekyll-seo-tag (= 2.7.1)
jekyll-sitemap (= 1.4.0)
jekyll-swiss (= 1.0.0)
jekyll-theme-architect (= 0.1.1)
jekyll-theme-cayman (= 0.1.1)
jekyll-theme-dinky (= 0.1.1)
jekyll-theme-hacker (= 0.1.1)
jekyll-theme-hacker (= 0.1.2)
jekyll-theme-leap-day (= 0.1.1)
jekyll-theme-merlot (= 0.1.1)
jekyll-theme-midnight (= 0.1.1)
Expand All @@ -66,20 +69,20 @@ GEM
jekyll-theme-tactile (= 0.1.1)
jekyll-theme-time-machine (= 0.1.1)
jekyll-titles-from-headings (= 0.5.3)
jemoji (= 0.11.1)
kramdown (= 2.3.0)
jemoji (= 0.12.0)
kramdown (= 2.3.1)
kramdown-parser-gfm (= 1.1.0)
liquid (= 4.0.3)
mercenary (~> 0.3)
minima (= 2.5.1)
nokogiri (>= 1.10.4, < 2.0)
rouge (= 3.19.0)
rouge (= 3.26.0)
terminal-table (~> 1.4)
github-pages-health-check (1.16.1)
github-pages-health-check (1.17.0)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (~> 3.0)
public_suffix (>= 2.0.2, < 5.0)
typhoeus (~> 1.3)
html-pipeline (2.14.0)
activesupport (>= 2)
Expand Down Expand Up @@ -114,33 +117,34 @@ GEM
rouge (>= 2.0, < 4.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.13.0)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.5.1)
jekyll-mentions (1.6.0)
html-pipeline (~> 2.3)
jekyll (>= 3.7, < 5.0)
jekyll-optional-front-matter (0.3.2)
jekyll (>= 3.0, < 5.0)
jekyll-paginate (1.1.0)
jekyll-readme-index (0.3.0)
jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.15.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-relative-links (0.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-remote-theme (0.4.1)
jekyll-remote-theme (0.4.3)
addressable (~> 2.0)
jekyll (>= 3.5, < 5.0)
rubyzip (>= 1.3.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-swiss (1.0.0)
Expand All @@ -153,8 +157,8 @@ GEM
jekyll-theme-dinky (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-hacker (0.1.1)
jekyll (~> 3.5)
jekyll-theme-hacker (0.1.2)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-leap-day (0.1.1)
jekyll (~> 3.5)
Expand Down Expand Up @@ -188,16 +192,16 @@ GEM
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.11.1)
jemoji (0.12.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (2.3.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
Expand All @@ -206,25 +210,26 @@ GEM
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.14.2)
minitest (5.14.4)
multipart-post (2.1.1)
nokogiri (1.11.0)
nokogiri (1.11.2)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
octokit (4.18.0)
octokit (4.20.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.1.1)
public_suffix (4.0.6)
racc (1.5.2)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.4)
rouge (3.19.0)
ruby-enum (0.8.0)
rouge (3.26.0)
ruby-enum (0.9.0)
i18n
ruby2_keywords (0.0.4)
rubyzip (2.3.0)
safe_yaml (1.0.5)
sass (3.7.4)
Expand All @@ -235,20 +240,20 @@ GEM
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
simpleidn (0.1.1)
simpleidn (0.2.1)
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.7)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
zeitwerk (2.4.0)
zeitwerk (2.4.2)

PLATFORMS
ruby
Expand All @@ -258,4 +263,4 @@ DEPENDENCIES
jekyll-github-metadata

BUNDLED WITH
2.0.2
2.2.15
Loading

0 comments on commit e2f6ec4

Please sign in to comment.