Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
texjs-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Mehren
texjs-web
Commits
b1b770f9
Verified
Commit
b1b770f9
authored
Jun 8, 2018
by
Shane Kilkelly
Committed by
David Mehren
Nov 25, 2018
Browse files
Options
Downloads
Patches
Plain Diff
Mostly working selection of output files from another project
parent
62ca5304
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/views/project/editor/file-tree.pug
+18
-2
18 additions, 2 deletions
app/views/project/editor/file-tree.pug
public/coffee/ide/file-tree/controllers/FileTreeController.coffee
+28
-15
28 additions, 15 deletions
...offee/ide/file-tree/controllers/FileTreeController.coffee
with
46 additions
and
17 deletions
app/views/project/editor/file-tree.pug
+
18
−
2
View file @
b1b770f9
...
@@ -345,7 +345,7 @@ script(type='text/ng-template', id='newDocModalTemplate')
...
@@ -345,7 +345,7 @@ script(type='text/ng-template', id='newDocModalTemplate')
// Project Linked Files Modal
// Project Linked Files Modal
script(type='text/ng-template', id='projectLinkedFileModalTemplate')
script(type='text/ng-template', id='projectLinkedFileModalTemplate')
.modal-header
.modal-header
h3 New file from Project ({{ isOutputFiles }})
h3 New file from Project ({{ isOutputFiles
Mode
}})
.modal-body
.modal-body
div
div
...
@@ -369,7 +369,7 @@ script(type='text/ng-template', id='projectLinkedFileModalTemplate')
...
@@ -369,7 +369,7 @@ script(type='text/ng-template', id='projectLinkedFileModalTemplate')
) {{ project.name }}
) {{ project.name }}
br
br
.form-controls
.form-controls
(ng-if="!isOutputFilesMode")
label(for="project-entity-select") Select a File
label(for="project-entity-select") Select a File
span(ng-show="state.inFlight.entities")
span(ng-show="state.inFlight.entities")
|
|
...
@@ -384,6 +384,22 @@ script(type='text/ng-template', id='projectLinkedFileModalTemplate')
...
@@ -384,6 +384,22 @@ script(type='text/ng-template', id='projectLinkedFileModalTemplate')
ng-repeat="projectEntity in data.projectEntities"
ng-repeat="projectEntity in data.projectEntities"
value="{{ projectEntity.path }}"
value="{{ projectEntity.path }}"
) {{ projectEntity.path.slice(1) }}
) {{ projectEntity.path.slice(1) }}
.form-controls(ng-if="isOutputFilesMode")
label(for="project-entity-select") Select an Output File
span(ng-show="state.inFlight.compile")
|
i.fa.fa-spinner.fa-spin
select.form-control(
name="project-output-file-select"
ng-model="data.selectedProjectOutputFile"
ng-disabled="!shouldEnableProjectOutputFileSelect()"
)
option(value="" disabled selected) - Please Select an Output File
option(
ng-repeat="outputFile in data.projectOutputFiles"
value="{{ outputFile.path }}"
) {{ outputFile.path }}
br
br
.form-controls
.form-controls
...
...
This diff is collapsed.
Click to expand it.
public/coffee/ide/file-tree/controllers/FileTreeController.coffee
+
28
−
15
View file @
b1b770f9
...
@@ -53,7 +53,7 @@ define [
...
@@ -53,7 +53,7 @@ define [
scope
:
$scope
scope
:
$scope
resolve
:
{
resolve
:
{
parent_folder
:
()
->
ide
.
fileTreeManager
.
getCurrentFolder
()
parent_folder
:
()
->
ide
.
fileTreeManager
.
getCurrentFolder
()
isOutputFiles
:
()
->
false
isOutputFiles
Mode
:
()
->
false
}
}
)
)
...
@@ -67,7 +67,7 @@ define [
...
@@ -67,7 +67,7 @@ define [
scope
:
$scope
scope
:
$scope
resolve
:
{
resolve
:
{
parent_folder
:
()
->
ide
.
fileTreeManager
.
getCurrentFolder
()
parent_folder
:
()
->
ide
.
fileTreeManager
.
getCurrentFolder
()
isOutputFiles
:
()
->
true
isOutputFiles
Mode
:
()
->
true
}
}
)
)
...
@@ -230,10 +230,10 @@ define [
...
@@ -230,10 +230,10 @@ define [
]
]
App
.
controller
"ProjectLinkedFileModalController"
,
[
App
.
controller
"ProjectLinkedFileModalController"
,
[
"$scope"
,
"ide"
,
"$modalInstance"
,
"$timeout"
,
"parent_folder"
,
"isOutputFiles"
,
"$scope"
,
"ide"
,
"$modalInstance"
,
"$timeout"
,
"parent_folder"
,
"isOutputFiles
Mode
"
,
(
$scope
,
ide
,
$modalInstance
,
$timeout
,
parent_folder
,
isOutputFiles
)
->
(
$scope
,
ide
,
$modalInstance
,
$timeout
,
parent_folder
,
isOutputFiles
Mode
)
->
$scope
.
isOutputFiles
=
isOutputFiles
$scope
.
isOutputFiles
Mode
=
isOutputFiles
Mode
console
.
log
">>>> LINKED"
,
isOutputFiles
console
.
log
">>>> LINKED"
,
isOutputFiles
Mode
$scope
.
data
=
$scope
.
data
=
projects
:
null
# or []
projects
:
null
# or []
...
@@ -241,6 +241,7 @@ define [
...
@@ -241,6 +241,7 @@ define [
projectEntities
:
null
# or []
projectEntities
:
null
# or []
projectOutputFiles
:
null
# or []
projectOutputFiles
:
null
# or []
selectedProjectEntity
:
null
selectedProjectEntity
:
null
selectedProjectOutputFile
:
null
name
:
null
name
:
null
$scope
.
state
=
$scope
.
state
=
inFlight
:
inFlight
:
...
@@ -253,7 +254,7 @@ define [
...
@@ -253,7 +254,7 @@ define [
$scope
.
$watch
'data.selectedProjectId'
,
(
newVal
,
oldVal
)
->
$scope
.
$watch
'data.selectedProjectId'
,
(
newVal
,
oldVal
)
->
return
if
!
newVal
return
if
!
newVal
$scope
.
data
.
selectedProjectEntity
=
null
$scope
.
data
.
selectedProjectEntity
=
null
if
isOutputFiles
if
isOutputFiles
Mode
$scope
.
compileProjectAndGetOutputFiles
(
$scope
.
data
.
selectedProjectId
)
$scope
.
compileProjectAndGetOutputFiles
(
$scope
.
data
.
selectedProjectId
)
else
else
$scope
.
getProjectEntities
(
$scope
.
data
.
selectedProjectId
)
$scope
.
getProjectEntities
(
$scope
.
data
.
selectedProjectId
)
...
@@ -265,6 +266,13 @@ define [
...
@@ -265,6 +266,13 @@ define [
if
fileName
if
fileName
$scope
.
data
.
name
=
fileName
$scope
.
data
.
name
=
fileName
# auto-set filename based on selected file
$scope
.
$watch
'data.selectedProjectOutputFile'
,
(
newVal
,
oldVal
)
->
return
if
!
newVal
fileName
=
newVal
.
split
(
'/'
).
reverse
()[
0
]
if
fileName
$scope
.
data
.
name
=
fileName
_setInFlight
=
(
type
)
->
_setInFlight
=
(
type
)
->
$scope
.
state
.
inFlight
[
type
]
=
true
$scope
.
state
.
inFlight
[
type
]
=
true
...
@@ -295,12 +303,12 @@ define [
...
@@ -295,12 +303,12 @@ define [
data
.
selectedProjectId
&&
data
.
selectedProjectId
&&
(
(
(
(
!
isOutputFiles
&&
!
isOutputFiles
Mode
&&
data
.
projectEntities
&&
data
.
projectEntities
&&
data
.
selectedProjectEntity
data
.
selectedProjectEntity
)
||
)
||
(
(
isOutputFiles
&&
isOutputFiles
Mode
&&
data
.
projectOutputFiles
&&
data
.
projectOutputFiles
&&
data
.
selectedProjectOutputFile
data
.
selectedProjectOutputFile
)
)
...
@@ -332,17 +340,22 @@ define [
...
@@ -332,17 +340,22 @@ define [
.
catch
(
err
)
->
.
catch
(
err
)
->
_reset
(
err
:
true
)
_reset
(
err
:
true
)
window
.
_C
=
$scope
.
compileProjectAndGetOutputFiles
=
(
project_id
)
=>
$scope
.
compileProjectAndGetOutputFiles
=
(
project_id
)
=>
_setInFlight
(
'compile'
)
_setInFlight
(
'compile'
)
$http
.
post
(
"/project/
$
{project_id}/compile"
,
{
ide
.
$http
.
post
(
"/project/
#
{
project_id
}
/compile"
,
{
check
:
"silent"
,
check
:
"silent"
,
draft
:
false
,
draft
:
false
,
incrementalCompilesEnabled
:
false
incrementalCompilesEnabled
:
false
_csrf
:
window
.
csrfToken
_csrf
:
window
.
csrfToken
})
})
.
then
(
data
)
->
.
then
(
resp
)
->
console
.
log
">> COMPILE"
,
data
console
.
log
">> COMPILE"
,
resp
.
data
if
resp
.
data
.
status
==
'success'
$scope
.
data
.
projectOutputFiles
=
resp
.
data
.
outputFiles
_reset
(
err
:
false
)
_reset
(
err
:
false
)
else
$scope
.
data
.
projectOutputFiles
=
null
_reset
(
err
:
true
)
.
catch
(
err
)
->
.
catch
(
err
)
->
console
.
error
(
err
)
console
.
error
(
err
)
_reset
(
err
:
true
)
_reset
(
err
:
true
)
...
@@ -354,7 +367,7 @@ define [
...
@@ -354,7 +367,7 @@ define [
$scope
.
create
=
()
->
$scope
.
create
=
()
->
projectId
=
$scope
.
data
.
selectedProjectId
projectId
=
$scope
.
data
.
selectedProjectId
name
=
$scope
.
data
.
name
name
=
$scope
.
data
.
name
if
isOutputFiles
if
isOutputFiles
Mode
provider
=
'project_output_file'
provider
=
'project_output_file'
payload
=
{
payload
=
{
source_project_id
:
projectId
,
source_project_id
:
projectId
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment