Skip to content

Commit

Permalink
OLMIS-7987: Move Submit Requisitionless Orders functionalities from A…
Browse files Browse the repository at this point in the history
…ngola to Core instance (#43)

* OLMIS-7987: Move Submit Requisitionless Orders functionalities from Angola to Core instance

* OLMIS-7987: Move Submit Requisitionless Orders functionalities from Angola to Core instance
  • Loading branch information
mdulko-soldevelo authored Sep 24, 2024
1 parent 4aa811f commit eeb0760
Show file tree
Hide file tree
Showing 37 changed files with 1,813 additions and 118 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Bug fixes:
New Functionalities:
* [OLMIS-7976](https://openlmis.atlassian.net/browse/OLMIS-7976): Improved visual apperance of the homepage alerts component

New functionalities that are backwards-compatible:
* [OLMIS-7987](https://openlmis.atlassian.net/browse/OLMIS-7987): Move Submit Requisitionless Orders functionalities from Angola to Core instance

Improvements:
* [OIS-23](https://openlmis.atlassian.net/browse/OIS-23): Add basic mixin utils for RTL support

Expand Down
74 changes: 63 additions & 11 deletions src/openlmis-table/_openlmis-table-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,36 @@ the current table sort order is recommended.*
Styleguide 4.1
*/

@mixin sortableColumn {
position: relative;
padding-left: 2rem;

&::before {
position: absolute;
left: 0;
padding-left: .5rem;
font-weight: 300;
margin-right: .2rem;
}
}

@mixin sortedColumnAsc {
@include sortableColumn();
@include icon('sort-up');

&::before {
transform: translateY(.25rem);
}
}

@mixin sortedColumnDesc {
@include sortableColumn();
@include icon('sort-down');

&::before {
transform: translateY(-0.25rem);
}
}

.ps-container {
overflow: hidden !important;
Expand All @@ -121,7 +150,7 @@ Styleguide 4.1

> * {
margin-bottom: 0.5em;
&:last-child{
&:last-child {
margin-bottom: 0em;
}
}
Expand All @@ -136,16 +165,16 @@ Styleguide 4.1

> * {
margin: 0em 0.5em;
&:first-child{
@include margin-left(0em);
&:first-child {
margin-left: 0em;
}
&:last-child{
@include margin-right(0em);
&:last-child {
margin-right: 0em;
}
}

> form {
@extend form.filters;
@extend form.filters;
}
}

Expand All @@ -170,24 +199,47 @@ Styleguide 4.1
.openlmis-flex-table {
overflow: auto;
position: relative; // tell JS to calculate offset from here
> table {
table {
@extend .openlmis-table;
width: 100%;
border: 10px solid black;
thead {
tr {
.header-sortable {
@include icon('sort');
@include sortableColumn();

&:hover {
cursor: pointer;
}
}

.sorted-ascending {
@include icon('sort-up');
@include sortedColumnAsc();
}

.sorted-descending {
@include sortedColumnDesc();
}
}
}

.checkbox-cell {
padding: 8px;
}
}
}

.toolbar {

overflow: hidden; // prevents from addin scrollbar to toolbar on firefox

*:last-child {
margin-right: 0;
}

}

}

form.openlmis-table-container {
max-width: initial;
max-width: initial;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org. 
*/

(function() {

'use strict';

/**
* @ngdoc component
* @name openlmis-table.component:openlmisTableAction
*
* @description
* Component responsible for rendering a single actions in actions cell
*
* @param {ActionConfig} actionConfig - holds config for this action
* structure of 'ActionConfig' is described in openlmis-table.component.js
* @param {item} item element from data array that is displayed in table row
* where this actions cell is placed
*/
angular
.module('openlmis-table')
.component('openlmisTableAction', {
templateUrl: 'openlmis-table/openlmis-table-component/openlmis-table-actions' +
'/openlmis-table-action/openlmis-table-action.html',
bindings: {
actionConfig: '<?',
item: '<?'
},
controller: 'OpenlmisTableActionController',
controllerAs: '$ctrl'
});
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org. 
*/

(function() {

'use strict';

/**
* @ngdoc controller
* @name openlmis-table.controller:OpenlmisTableActionController *
*
* @description - initializes some default values declared for table actions
*
*/
angular
.module('openlmis-table')
.controller('OpenlmisTableActionController', OpenlmisTableActionController);

OpenlmisTableActionController.$inject = ['TABLE_CONSTANTS'];

function OpenlmisTableActionController(TABLE_CONSTANTS) {
var $ctrl = this;

$ctrl.$onInit = onInit;

function onInit() {
if ($ctrl.actionConfig.displayAction === undefined) {
$ctrl.actionConfig.displayAction = TABLE_CONSTANTS.defaultDisplayActionFunction;
}
if ($ctrl.actionConfig.classes === undefined) {
$ctrl.actionConfig.classes = '';
}
}
}
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<span ng-switch on="$ctrl.actionConfig.type">
<openlmis-table-download-action
ng-switch-when="DOWNLOAD"
action-config="$ctrl.actionConfig"
item="$ctrl.item">
</openlmis-table-download-action>
<openlmis-table-redirect-action
ng-switch-when="REDIRECT"
action-config="$ctrl.actionConfig"
item="$ctrl.item">
</openlmis-table-redirect-action>
<openlmis-table-click-action
ng-switch-when="CLICK"
action-config="$ctrl.actionConfig"
item="$ctrl.item">
</openlmis-table-click-action>
</span>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org. 
*/

(function() {

'use strict';

/**
* @ngdoc component
* @name openlmis-table.component:openlmisTableClickAction
*
* @description
* Component responsible for rendering a click action
*
* @param {ActionConfig} actionConfig - holds config for this action
* structure of 'ActionConfig' is described in openlmis-table.component.js
* @param {item} item element from data array that is displayed in table row
* where this actions cell is placed
*/
angular
.module('openlmis-table')
.component('openlmisTableClickAction', {
templateUrl: 'openlmis-table/openlmis-table-component/openlmis-table-actions' +
'/openlmis-table-actions-templates/openlmis-table-click-action/openlmis-table-click-action.html',
bindings: {
actionConfig: '<?',
item: '<?'
},
controllerAs: '$ctrl'
});
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<button
ng-if="$ctrl.actionConfig.displayAction($ctrl.item)"
ng-click="$ctrl.actionConfig.onClick($ctrl.item)"
class="{{$ctrl.actionConfig.classes}}">
{{$ctrl.actionConfig.text | message}}
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org. 
*/

(function() {

'use strict';

/**
* @ngdoc component
* @name openlmis-table.component:openlmisTableDownloadAction
*
* @description
* Component responsible for rendering a download action
*
* @param {ActionConfig} actionConfig - holds config for this action
* structure of 'ActionConfig' is described in openlmis-table.component.js
* @param {item} item element from data array that is displayed in table row
* where this actions cell is placed
*/
angular
.module('openlmis-table')
.component('openlmisTableDownloadAction', {
templateUrl: 'openlmis-table/openlmis-table-component/openlmis-table-actions' +
'/openlmis-table-actions-templates/openlmis-table-download-action/openlmis-table-download-action.html',
bindings: {
actionConfig: '<?',
item: '<?'
},
controllerAs: '$ctrl'
});
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<button
ng-if="$ctrl.actionConfig.displayItem($ctrl.item)"
openlmis-download="$ctrl.actionConfig.onClick($ctrl.item)"
class="{{$ctrl.actionConfig.classes}}">
{{$ctrl.actionConfig.text | message}}
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org. 
*/

(function() {

'use strict';

/**
* @ngdoc component
* @name openlmis-table.component:openlmisTableRedirectAction
*
* @description
* Component responsible for rendering a redirect action
*
* @param {ActionConfig} actionConfig - holds config for this action
* structure of 'ActionConfig' is described in openlmis-table.component.js
* @param {item} item element from data array that is displayed in table row
* where this actions cell is placed
*/
angular
.module('openlmis-table')
.component('openlmisTableRedirectAction', {
templateUrl: 'openlmis-table/openlmis-table-component/openlmis-table-actions' +
'/openlmis-table-actions-templates/openlmis-table-redirect-action/openlmis-table-redirect-action.html',
bindings: {
actionConfig: '<?',
item: '<?'
},
controllerAs: '$ctrl'
});
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<button
ng-if="$ctrl.actionConfig.displayAction($ctrl.item)"
ui-sref="{{$ctrl.actionConfig.redirectLink($ctrl.item)}}"
class="{{$ctrl.actionConfig.classes}}">
{{$ctrl.actionConfig.text | message}}
</button>
Loading

0 comments on commit eeb0760

Please sign in to comment.