Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vlass Manager UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
Vlass Manager UI
Commits
1312183b
Commit
1312183b
authored
4 years ago
by
Reid Givens
Browse files
Options
Downloads
Patches
Plain Diff
autosave notes; save notes on archive and accept, remove formatting from paste
parent
08259df5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/directives/content-editable.directive.ts
+17
-0
17 additions, 0 deletions
src/app/directives/content-editable.directive.ts
src/app/executions/execution/execution-detail/execution-detail.component.ts
+10
-6
10 additions, 6 deletions
.../execution/execution-detail/execution-detail.component.ts
with
27 additions
and
6 deletions
src/app/directives/content-editable.directive.ts
+
17
−
0
View file @
1312183b
...
...
@@ -33,6 +33,23 @@ export class ContentEditableDirective implements ControlValueAccessor {
}
}
@
HostListener
(
'
paste
'
,
[
'
$event
'
])
onPaste
(
$event
)
{
// after the paste, remove all the formatting
setTimeout
(()
=>
{
this
.
clearAttr
(
this
.
elementRef
.
nativeElement
);
},
500
);
}
clearAttr
(
el
:
any
)
{
this
.
renderer
.
removeAttribute
(
el
,
'
style
'
);
this
.
renderer
.
removeAttribute
(
el
,
'
class
'
);
this
.
renderer
.
removeAttribute
(
el
,
'
id
'
);
for
(
let
e
of
el
.
children
)
{
this
.
clearAttr
(
e
);
}
}
/**
* Writes a new value to the element.
* This method will be called by the forms API to write
...
...
This diff is collapsed.
Click to expand it.
src/app/executions/execution/execution-detail/execution-detail.component.ts
+
10
−
6
View file @
1312183b
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnInit
,
Output
}
from
'
@angular/core
'
;
import
{
Job
,
JobExecution
}
from
"
../../../model/job
"
;
import
{
Sub
scription
}
from
"
rxjs
"
;
import
{
Sub
ject
}
from
"
rxjs
"
;
import
{
JobsService
}
from
"
../../../services/jobs.service
"
;
import
{
FormControl
,
FormGroup
}
from
"
@angular/forms
"
;
import
{
ConfigurationService
}
from
"
../../../env/configuration.service
"
;
import
{
faCheckCircle
,
faCopy
,
faList
,
faSave
,
faStickyNote
}
from
"
@fortawesome/free-solid-svg-icons
"
;
import
{
AlertService
}
from
"
../../../services/alert.service
"
;
import
{
auditTime
,
takeUntil
}
from
"
rxjs/operators
"
;
@
Component
({
selector
:
'
app-execution-detail
'
,
...
...
@@ -14,9 +15,9 @@ import {AlertService} from "../../../services/alert.service";
})
export
class
ExecutionDetailComponent
implements
OnInit
,
OnDestroy
{
private
ngUnsubscribe
=
new
Subject
<
void
>
();
@
Input
()
job
:
Job
;
@
Output
()
reload
=
new
EventEmitter
();
private
jobDetail$
:
Subscription
;
public
jobDetail
:
JobExecution
;
noteFormGroup
:
FormGroup
;
...
...
@@ -39,13 +40,16 @@ export class ExecutionDetailComponent implements OnInit, OnDestroy {
}
ngOnInit
()
{
this
.
jobDetail$
=
this
.
jobService
.
getJobExecution
(
this
.
job
.
job_id
).
subscribe
((
j
:
JobExecution
)
=>
{
this
.
jobService
.
getJobExecution
(
this
.
job
.
job_id
).
pipe
(
takeUntil
(
this
.
ngUnsubscribe
)).
subscribe
((
j
:
JobExecution
)
=>
{
if
(
j
)
{
this
.
jobDetail
=
j
;
this
.
noteFormGroup
.
get
(
'
notes
'
).
setValue
(
j
.
notes
);
this
.
noteFormGroup
.
get
(
'
id
'
).
setValue
(
j
.
id
);
}
});
// autosave the form on changes
this
.
noteFormGroup
.
valueChanges
.
pipe
(
auditTime
(
2000
),
takeUntil
(
this
.
ngUnsubscribe
)).
subscribe
(()
=>
this
.
updateNotes
());
}
copyToClipboard
(
text
:
string
):
void
{
...
...
@@ -102,6 +106,7 @@ export class ExecutionDetailComponent implements OnInit, OnDestroy {
}
acceptQa
()
{
this
.
updateNotes
();
// make sure notes are saved before submitting
this
.
alertService
.
info
(
'
Accepting
'
+
this
.
job
.
job_id
);
this
.
performQa
(
this
.
job
.
job_id
,
'
accept
'
);
}
...
...
@@ -137,9 +142,8 @@ export class ExecutionDetailComponent implements OnInit, OnDestroy {
ngOnDestroy
():
void
{
if
(
this
.
jobDetail$
)
{
this
.
jobDetail$
.
unsubscribe
();
}
this
.
ngUnsubscribe
.
next
();
this
.
ngUnsubscribe
.
complete
();
}
}
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