| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /* eslint-disable
- max-len,
- no-return-assign,
- */
- // TODO: This file was created by bulk-decaffeinate.
- // Fix any style issues and re-enable lint.
- /*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
- import App from '../../../base'
- export default App.controller('HistoryV2AddLabelModalController', [
- '$scope',
- '$modalInstance',
- 'ide',
- 'update',
- function ($scope, $modalInstance, ide, update) {
- $scope.update = update
- $scope.inputs = { labelName: null }
- $scope.state = {
- inflight: false,
- error: false,
- }
- $modalInstance.opened.then(() =>
- $scope.$applyAsync(() => $scope.$broadcast('open'))
- )
- return ($scope.addLabelModalFormSubmit = function () {
- $scope.state.inflight = true
- return ide.historyManager
- .labelCurrentVersion($scope.inputs.labelName)
- .then(function (response) {
- $scope.state.inflight = false
- return $modalInstance.close()
- })
- .catch(function (response) {
- const { data, status } = response
- $scope.state.inflight = false
- if (status === 400) {
- return ($scope.state.error = { message: data })
- } else {
- return ($scope.state.error = true)
- }
- })
- })
- },
- ])
|