mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 00:53:26 +02:00
add groups feature
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Copyright © 2019 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
||||
**/
|
||||
|
||||
module.exports =
|
||||
function GenericModalServiceFactory($uibModal) {
|
||||
const service = {}
|
||||
|
||||
const ModalInstanceCtrl = function($scope, $uibModalInstance, data) {
|
||||
$scope.data = data
|
||||
|
||||
$scope.ok = function() {
|
||||
$uibModalInstance.close(true)
|
||||
}
|
||||
|
||||
$scope.cancel = function() {
|
||||
$uibModalInstance.dismiss('cancel')
|
||||
}
|
||||
}
|
||||
|
||||
service.open = function(data) {
|
||||
var modalInstance = $uibModal.open({
|
||||
template: require('./generic-modal.pug'),
|
||||
controller: ModalInstanceCtrl,
|
||||
size: data.size,
|
||||
animation: true,
|
||||
resolve: {
|
||||
data: function() {
|
||||
return data
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return modalInstance.result
|
||||
}
|
||||
|
||||
return service
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Copyright © 2019 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
||||
**/
|
||||
|
||||
describe('GenericModalService', function() {
|
||||
|
||||
beforeEach(angular.mock.module(require('./').name))
|
||||
|
||||
it('should ...', inject(function() {
|
||||
|
||||
//expect(FatalMessageService.doSomething()).toEqual('something');
|
||||
|
||||
}))
|
||||
|
||||
})
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
Copyright © 2019 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
||||
//
|
||||
|
||||
.stf-generic-modal.stf-modal
|
||||
.modal-header
|
||||
h4.modal-title.text-warning(ng-if="data.type === 'Warning'")
|
||||
i.fa.fa-warning
|
||||
.button-spacer
|
||||
span(translate) {{data.type}}
|
||||
|
||||
h4.modal-title.text-info(ng-if="data.type === 'Information'")
|
||||
i.fa.fa-info-circle
|
||||
.button-spacer
|
||||
span(translate) {{data.type}}
|
||||
|
||||
h4.modal-title.text-danger(ng-if="data.type === 'Error'")
|
||||
i.fa.fa-times-circle
|
||||
.button-spacer
|
||||
span(translate) {{data.type}}
|
||||
|
||||
.modal-body
|
||||
label.control-label
|
||||
span(translate) {{data.message}}
|
||||
|
||||
.modal-footer
|
||||
button.btn.btn-primary(
|
||||
type='button'
|
||||
ng-click='ok()')
|
||||
span(translate) OK
|
||||
|
||||
button.btn.btn-warning(
|
||||
type='button'
|
||||
ng-if='data.cancel'
|
||||
ng-click='cancel()')
|
||||
span(translate) Cancel
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright © 2019 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
||||
**/
|
||||
|
||||
module.exports = angular.module('stf.generic-modal', [
|
||||
require('stf/common-ui/modals/common').name
|
||||
])
|
||||
.factory('GenericModalService', require('./generic-modal-service'))
|
||||
Reference in New Issue
Block a user