Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fa206 multi select #360

Merged
merged 46 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
8d140d8
Initial commit with multi-select working
egbicker Nov 29, 2021
32731b4
Merge remote-tracking branch 'origin' into fa206-multi-select
egbicker Nov 29, 2021
b1ff6a7
Merge branch 'master' of github.com:ctc-oss/fapolicy-analyzer into fa…
egbicker Nov 30, 2021
63e086c
trust file multi-select functionality
egbicker Dec 1, 2021
474e4d8
policy rules multi select
egbicker Dec 3, 2021
71d8af1
merge
egbicker Dec 9, 2021
8321be8
ancillary and system multi-select performance updates
egbicker Dec 9, 2021
93550a5
subjec object update
egbicker Dec 9, 2021
0220ec1
Multi-select performance issues resolved
egbicker Dec 15, 2021
25d7454
Merge remote-tracking branch 'origin' into fa206-multi-select
egbicker Dec 15, 2021
7070b2d
test fixes
egbicker Dec 21, 2021
e1fbc0d
Merge remote-tracking branch 'origin' into fa206-multi-select
egbicker Dec 21, 2021
40acb92
tidying up for pr
egbicker Dec 21, 2021
6181d4b
linting
egbicker Dec 21, 2021
9ab7d41
Merge remote-tracking branch 'origin' into fa206-multi-select
egbicker Dec 22, 2021
221519c
PR fixes
egbicker Dec 22, 2021
d206d67
linting
egbicker Dec 22, 2021
d565a1e
fixing tests
egbicker Dec 22, 2021
7b71b16
making subject and user lists single select and object multi-select
egbicker Dec 27, 2021
ac40dfc
Updating for a single changelist with multiple entries
egbicker Dec 28, 2021
aa6a163
system trust selection logic
egbicker Dec 28, 2021
ac533f9
Multi select button activation logic
egbicker Dec 28, 2021
8af833b
Policy analysis trust/untrust pop up menu
egbicker Dec 29, 2021
4fceeb4
right click menu updates
egbicker Jan 3, 2022
18c5d90
Merge remote-tracking branch 'origin' into fa206-multi-select
egbicker Jan 3, 2022
ba813fc
multi-select right click menus
egbicker Jan 4, 2022
fbbc6a3
confirm change dialog
egbicker Jan 5, 2022
26a32c1
pop up confirmation
egbicker Jan 5, 2022
afcb180
header block
egbicker Jan 5, 2022
3338e52
Updating based on feedback
egbicker Jan 6, 2022
a3290ab
fixing tests
egbicker Jan 6, 2022
6012b2d
Merge remote-tracking branch 'origin' into fa206-multi-select
egbicker Jan 6, 2022
4c1b13a
Pop up confirm dialog updates
egbicker Jan 13, 2022
51c624c
adding tests for coverage
egbicker Jan 14, 2022
615acbe
linting
egbicker Jan 14, 2022
3cb41be
test update
egbicker Jan 17, 2022
6ea648a
conflict resolution
egbicker Jan 18, 2022
15261d8
test coverage
egbicker Jan 18, 2022
172563a
linting
egbicker Jan 18, 2022
934ca0e
Easy fixes from testing
dorschs57 Jan 19, 2022
c46aac0
updates based on comments
egbicker Jan 19, 2022
5152b35
fixing issues from PR
egbicker Jan 20, 2022
d601241
linting
egbicker Jan 20, 2022
6881878
Merge remote-tracking branch 'origin' into fa206-multi-select
egbicker Jan 21, 2022
48c55b2
fixed changeset calculation logic
dorschs57 Jan 21, 2022
ed26285
cleanup
dorschs57 Jan 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions fapolicy_analyzer/glade/confirm_change_dialog.glade
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!--
Copyright Concurrent Technologies Corporation 2021

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkDialog" id="confirmChangeDialog">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Confirm Trust Changes</property>
<property name="window-position">center-on-parent</property>
<property name="type-hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="yesButton">
<property name="label" translatable="yes">Yes</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="noButton">
<property name="label" translatable="yes">No</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancelButton">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTextView" id="confirmInfo">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="editable">False</property>
<property name="justification">center</property>
<property name="cursor-visible">False</property>
<property name="accepts-tab">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-8">yesButton</action-widget>
<action-widget response="-9">noButton</action-widget>
<action-widget response="-6">cancelButton</action-widget>
</action-widgets>
</object>
</interface>
5 changes: 2 additions & 3 deletions fapolicy_analyzer/glade/searchable_list.glade
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!--
Copyright Concurrent Technologies Corporation 2021

Expand All @@ -15,8 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkBox" id="searchableList">
Expand Down Expand Up @@ -85,7 +84,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
<object class="GtkTreeSelection" id="treeSelection"/>
</child>
</object>
</child>
Expand Down
5 changes: 2 additions & 3 deletions fapolicy_analyzer/glade/system_trust_database_admin.glade
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!--
Copyright Concurrent Technologies Corporation 2021

Expand All @@ -15,8 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkBox" id="systemTrustDatabaseAdmin">
Expand Down Expand Up @@ -58,7 +57,7 @@
<property name="layout-style">expand</property>
<child>
<object class="GtkButton" id="addBtn">
<property name="label" translatable="yes">Add File To Ancillary Trust Database</property>
<property name="label" translatable="yes">Add To Ancillary Trust Database</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
Expand Down
79 changes: 55 additions & 24 deletions fapolicy_analyzer/locale/fapolicy_analyzer.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: fapolicy-analyzer snapshot\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-01-13 11:49-0500\n"
"POT-Creation-Date: 2022-01-21 10:10-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -18,21 +18,39 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: fapolicy_analyzer/ui/ancillary_trust_database_admin.py:89
#: fapolicy_analyzer/ui/system_trust_database_admin.py:99
#: fapolicy_analyzer/ui/ancillary_trust_database_admin.py:94
#: fapolicy_analyzer/ui/system_trust_database_admin.py:103
msgid ""
"File: {trust.path}\n"
"Size: {trust.size}\n"
"SHA256: {trust.hash}"
msgstr ""

#: fapolicy_analyzer/ui/ancillary_trust_database_admin.py:99
#: fapolicy_analyzer/ui/system_trust_database_admin.py:108
#: fapolicy_analyzer/ui/ancillary_trust_database_admin.py:104
#: fapolicy_analyzer/ui/system_trust_database_admin.py:112
msgid ""
"{fs.stat(trust.path)}\n"
"SHA256: {fs.sha(trust.path)}"
msgstr ""

#: fapolicy_analyzer/ui/confirm_change_dialog.py:37
msgid "{deletions} file{plural(deletions)} will be untrusted."
msgstr ""

#: fapolicy_analyzer/ui/confirm_change_dialog.py:42
msgid "{additions} file{plural(additions)} will be trusted."
msgstr ""

#: fapolicy_analyzer/ui/confirm_change_dialog.py:48
msgid ""
"{total - (total_changes)} file{plural(total - (total_changes))} from the "
"System Trust Database will be unaffected."
msgstr ""

#: fapolicy_analyzer/ui/confirm_change_dialog.py:58
msgid "Do you wish to continue?"
msgstr ""

#: fapolicy_analyzer/ui/deploy_confirm_dialog.py:44
msgid "Reverting to previous settings in {i+1} seconds"
msgstr ""
Expand Down Expand Up @@ -268,27 +286,27 @@ msgid "An error occurred trying to retrieve the group list. Please try again."
msgstr ""

#: fapolicy_analyzer/ui/strings.py:122
msgid "Trust Database Read Failure"
msgid "Trust Database"
msgstr ""

#: fapolicy_analyzer/ui/strings.py:123
msgid ""
"\n"
" The fapolicyd trusted resources database\n"
" could not be opened and/or read.\n"
"The fapolicyd trusted resources database\n"
"could not be opened and/or read.\n"
"\n"
" Typical reasons for this failure:\n"
"Typical reasons for this failure:\n"
"\n"
" 1. The user does not have read permissions to access\n"
" the database directory or its contents.\n"
" [Default: /var/lib/fapolicyd]\n"
"1. The user does not have read permissions to access\n"
"the database directory or its contents.\n"
"[Default: /var/lib/fapolicyd]\n"
"\n"
" 2. The database does not exist or was not initialized.\n"
"2. The database does not exist or was not initialized.\n"
"\n"
" Either the fapolicyd daemon package has not been\n"
" installed or if installed, has not been executed. The first\n"
" execution of the fapolicyd daemon will create and\n"
" populate the trust database.\n"
"Either the fapolicyd daemon package has not been\n"
"installed or if installed, has not been executed. The first\n"
"execution of the fapolicyd daemon will create and\n"
"populate the trust database.\n"
" "
msgstr ""

Expand Down Expand Up @@ -319,6 +337,23 @@ msgstr ""
msgid "Untrust"
msgstr ""

#: fapolicy_analyzer/glade/confirm_change_dialog.glade:23
msgid "Confirm Trust Changes"
msgstr ""

#: fapolicy_analyzer/glade/confirm_change_dialog.glade:37
msgid "Yes"
msgstr ""

#: fapolicy_analyzer/glade/confirm_change_dialog.glade:50
msgid "No"
msgstr ""

#: fapolicy_analyzer/glade/confirm_change_dialog.glade:63
#: fapolicy_analyzer/glade/trust_reconciliation_dialog.glade:67
msgid "Cancel"
msgstr ""

#: fapolicy_analyzer/glade/deploy_confirm_dialog.glade:27
msgid "Keep these trust changes?"
msgstr ""
Expand Down Expand Up @@ -381,16 +416,16 @@ msgstr ""
msgid "x"
msgstr ""

#: fapolicy_analyzer/glade/searchable_list.glade:126
#: fapolicy_analyzer/glade/searchable_list.glade:125
msgid "page0"
msgstr ""

#: fapolicy_analyzer/glade/splash_screen.glade:44
msgid "Initializing File Access Policy Analyzer..."
msgstr ""

#: fapolicy_analyzer/glade/system_trust_database_admin.glade:61
msgid "Add File To Ancillary Trust Database"
#: fapolicy_analyzer/glade/system_trust_database_admin.glade:60
msgid "Add To Ancillary Trust Database"
msgstr ""

#: fapolicy_analyzer/glade/trust_file_details.glade:60
Expand All @@ -409,10 +444,6 @@ msgstr ""
msgid "Trust Reconsiliation"
msgstr ""

#: fapolicy_analyzer/glade/trust_reconciliation_dialog.glade:67
msgid "Cancel"
msgstr ""

#: fapolicy_analyzer/glade/unapplied_changes_dialog.glade:25
msgid "Unapplied Changes"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_updates_trust_details(widget, mocker):
mocker.patch(
"ui.ancillary_trust_database_admin.fs.stat", return_value="stat for foo file"
)
trust = MagicMock(status="T", path="/tmp/foo", size=1, hash="abc", spec=Trust)
trust = [MagicMock(status="T", path="/tmp/foo", size=1, hash="abc", spec=Trust)]
widget.on_trust_selection_changed(trust)
widget.trustFileDetails.set_in_database_view.assert_called_with(
"File: /tmp/foo\nSize: 1\nSHA256: abc"
Expand All @@ -87,7 +87,7 @@ def test_updates_trust_details_for_deleted_files(widget, mocker):
mocker.patch(
"ui.ancillary_trust_database_admin.fs.stat", return_value="stat for foo file"
)
trust = MagicMock(path="/tmp/foo")
trust = [MagicMock(path="/tmp/foo")]
widget.on_trust_selection_changed(trust)
widget.trustFileDetails.set_in_database_view.assert_not_called()
widget.trustFileDetails.set_on_file_system_view.assert_called_with(
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_on_trustBtn_clicked(widget, mock_dispatch, mocker):
mocker.patch(
"ui.ancillary_trust_database_admin.fs.stat", return_value="stat for foo file"
)
trust = MagicMock(path="/tmp/foo")
trust = [MagicMock(path="/tmp/foo")]
widget.on_trust_selection_changed(trust)
widget.get_object("trustBtn").clicked()
mock_dispatch.assert_called_with(
Expand Down Expand Up @@ -166,7 +166,7 @@ def test_on_untrustBtn_clicked(widget, mock_dispatch, mocker):
mocker.patch(
"ui.ancillary_trust_database_admin.fs.stat", return_value="stat for foo file"
)
trust = MagicMock(path="/tmp/foo")
trust = [MagicMock(path="/tmp/foo")]
widget.on_trust_selection_changed(trust)
widget.get_object("untrustBtn").clicked()
mock_dispatch.assert_called_with(
Expand Down
Loading