Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
16357f83
Commit
16357f83
authored
1 year ago
by
Loïc Correnson
Committed by
Allan Blanchard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[wp/ivette] selected goals feedback
parent
c9dcc47d
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
ivette/src/frama-c/plugins/wp/goals.tsx
+6
-2
6 additions, 2 deletions
ivette/src/frama-c/plugins/wp/goals.tsx
ivette/src/frama-c/plugins/wp/index.tsx
+11
-1
11 additions, 1 deletion
ivette/src/frama-c/plugins/wp/index.tsx
with
17 additions
and
3 deletions
ivette/src/frama-c/plugins/wp/goals.tsx
+
6
−
2
View file @
16357f83
...
@@ -84,10 +84,11 @@ function filterGoal(
...
@@ -84,10 +84,11 @@ function filterGoal(
export
interface
GoalTableProps
{
export
interface
GoalTableProps
{
scope
:
string
|
undefined
;
scope
:
string
|
undefined
;
failed
:
boolean
;
failed
:
boolean
;
onFilter
:
(
goals
:
number
,
total
:
number
)
=>
void
;
}
}
export
function
GoalTable
(
props
:
GoalTableProps
):
JSX
.
Element
{
export
function
GoalTable
(
props
:
GoalTableProps
):
JSX
.
Element
{
const
{
scope
,
failed
}
=
props
;
const
{
scope
,
failed
,
onFilter
}
=
props
;
const
model
=
States
.
useSyncArrayModel
(
WP
.
goals
);
const
model
=
States
.
useSyncArrayModel
(
WP
.
goals
);
const
[
_
,
updateAstSelection
]
=
States
.
useSelection
();
const
[
_
,
updateAstSelection
]
=
States
.
useSelection
();
const
[
wpoSelection
,
setWpoSelection
]
=
React
.
useState
(
WP
.
goalDefault
);
const
[
wpoSelection
,
setWpoSelection
]
=
React
.
useState
(
WP
.
goalDefault
);
...
@@ -106,7 +107,10 @@ export function GoalTable(props: GoalTableProps): JSX.Element {
...
@@ -106,7 +107,10 @@ export function GoalTable(props: GoalTableProps): JSX.Element {
}
else
{
}
else
{
model
.
setFilter
();
model
.
setFilter
();
}
}
},
[
model
,
scope
,
failed
]);
const
goals
=
model
.
getRowCount
();
const
total
=
model
.
getTotalRowCount
();
onFilter
(
goals
,
total
);
},
[
model
,
scope
,
failed
,
onFilter
]);
return
(
return
(
<
Table
<
Table
...
...
This diff is collapsed.
Click to expand it.
ivette/src/frama-c/plugins/wp/index.tsx
+
11
−
1
View file @
16357f83
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
*
as
Dome
from
'
dome
'
;
import
*
as
Dome
from
'
dome
'
;
import
{
Label
}
from
'
dome/controls/labels
'
;
import
{
IconButton
}
from
'
dome/controls/buttons
'
;
import
{
IconButton
}
from
'
dome/controls/buttons
'
;
import
*
as
Ivette
from
'
ivette
'
;
import
*
as
Ivette
from
'
ivette
'
;
import
*
as
States
from
'
frama-c/states
'
;
import
*
as
States
from
'
frama-c/states
'
;
...
@@ -40,18 +41,27 @@ function WPGoals(): JSX.Element {
...
@@ -40,18 +41,27 @@ function WPGoals(): JSX.Element {
const
[
scoped
,
flipScoped
]
=
Dome
.
useFlipSettings
(
'
frama-c.wp.goals.scoped
'
);
const
[
scoped
,
flipScoped
]
=
Dome
.
useFlipSettings
(
'
frama-c.wp.goals.scoped
'
);
const
[
failed
,
flipFailed
]
=
Dome
.
useFlipSettings
(
'
frama-c.wp.goals.failed
'
);
const
[
failed
,
flipFailed
]
=
Dome
.
useFlipSettings
(
'
frama-c.wp.goals.failed
'
);
const
[
selection
]
=
States
.
useSelection
();
const
[
selection
]
=
States
.
useSelection
();
const
[
goals
,
setGoals
]
=
React
.
useState
(
0
);
const
[
total
,
setTotal
]
=
React
.
useState
(
0
);
const
onFilter
=
React
.
useCallback
((
goals
,
total
)
=>
{
setGoals
(
goals
);
setTotal
(
total
);
},
[
setGoals
,
setTotal
]);
const
fct
=
selection
?.
current
?.
fct
;
const
fct
=
selection
?.
current
?.
fct
;
const
scope
=
scoped
?
fct
:
undefined
;
const
scope
=
scoped
?
fct
:
undefined
;
return
(
return
(
<>
<>
<
Ivette
.
TitleBar
>
<
Ivette
.
TitleBar
>
<
Label
display
=
{
goals
<
total
}
>
{
goals
}
/
{
total
}
</
Label
>
<
IconButton
icon
=
'COMPONENT'
title
=
'Current Scope Only'
<
IconButton
icon
=
'COMPONENT'
title
=
'Current Scope Only'
enabled
=
{
!!
fct
}
enabled
=
{
!!
fct
}
selected
=
{
scoped
}
onClick
=
{
flipScoped
}
/>
selected
=
{
scoped
}
onClick
=
{
flipScoped
}
/>
<
IconButton
icon
=
'CIRC.QUESTION'
title
=
'Unresolved Goals Only'
<
IconButton
icon
=
'CIRC.QUESTION'
title
=
'Unresolved Goals Only'
selected
=
{
failed
}
onClick
=
{
flipFailed
}
/>
selected
=
{
failed
}
onClick
=
{
flipFailed
}
/>
</
Ivette
.
TitleBar
>
</
Ivette
.
TitleBar
>
<
GoalTable
scope
=
{
scope
}
failed
=
{
failed
}
/>
<
GoalTable
scope
=
{
scope
}
failed
=
{
failed
}
onFilter
=
{
onFilter
}
/>
</>
</>
);
);
}
}
...
...
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