2021-01-06 05:30:08 -05:00
|
|
|
import App from '../../../base'
|
|
|
|
import { react2angular } from 'react2angular'
|
|
|
|
|
|
|
|
import CloneProjectModal from '../components/clone-project-modal'
|
|
|
|
|
|
|
|
App.component('cloneProjectModal', react2angular(CloneProjectModal))
|
|
|
|
|
2021-04-14 09:17:21 -04:00
|
|
|
export default App.controller(
|
|
|
|
'LeftMenuCloneProjectModalController',
|
|
|
|
function ($scope, ide) {
|
|
|
|
$scope.show = false
|
|
|
|
$scope.projectId = ide.$scope.project_id
|
|
|
|
|
|
|
|
$scope.handleHide = () => {
|
|
|
|
$scope.$applyAsync(() => {
|
|
|
|
$scope.show = false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
$scope.openProject = projectId => {
|
|
|
|
window.location.assign(`/project/${projectId}`)
|
|
|
|
}
|
|
|
|
|
|
|
|
$scope.openCloneProjectModal = () => {
|
|
|
|
$scope.$applyAsync(() => {
|
|
|
|
const { project } = ide.$scope
|
|
|
|
|
|
|
|
if (project) {
|
|
|
|
$scope.projectId = project._id
|
|
|
|
$scope.projectName = project.name
|
|
|
|
|
|
|
|
$scope.show = true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2021-01-06 05:30:08 -05:00
|
|
|
}
|
2021-04-14 09:17:21 -04:00
|
|
|
)
|