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

Group and Policies settings #1866

Merged
merged 79 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
979ba39
group/RP basic setup
qianwei-yin Oct 14, 2024
3130876
group/RP nav link done
qianwei-yin Oct 14, 2024
35942b1
group/RP actions elements under table view done
qianwei-yin Oct 15, 2024
daf1848
group/RP group table set up
qianwei-yin Oct 16, 2024
06ce7b3
group/RP set group table data
qianwei-yin Oct 17, 2024
ea7f3df
group/RP toggle view by done
qianwei-yin Oct 17, 2024
ca7bb59
group/RP paginator for group table (both view by group and user) done
qianwei-yin Oct 19, 2024
4b971dd
group/RP policy table data and paginator done
qianwei-yin Oct 21, 2024
24a1cdd
group/RP group edit/new page set up
qianwei-yin Oct 22, 2024
abb2a97
group/RP group table checkbox feature done
qianwei-yin Oct 23, 2024
bcd058a
group/RP policy table checkbox feature done
qianwei-yin Oct 23, 2024
11ea749
group/RP group edit, add and delete user feature set up
qianwei-yin Oct 24, 2024
aa9812d
group/RP group edit page done
qianwei-yin Oct 24, 2024
94cb9f8
group/RP group new page done
qianwei-yin Oct 24, 2024
8e6617f
group/RP permission calculator set up, done with fetching data and cr…
qianwei-yin Oct 25, 2024
e59c48d
group/RP permission calculator partially done, save progress
qianwei-yin Oct 27, 2024
d0008c2
group/RP permission calculator buttons set up, and optimize table ren…
qianwei-yin Oct 27, 2024
f7b35c8
group/RP optimize table rendering
qianwei-yin Oct 28, 2024
f349305
group/RP calculator actions functionality done
qianwei-yin Oct 28, 2024
a7e24fb
group/RP sort feature done
qianwei-yin Oct 28, 2024
76eb523
group/RP edit group functionality done, optimize calculator table log…
qianwei-yin Oct 31, 2024
090b6d4
group/RP finish edit delete group, edit group, update group, and hand…
qianwei-yin Oct 31, 2024
294a4c8
group/RP finish feature on edit user's group list
qianwei-yin Oct 31, 2024
41cbf20
group/RP filter setup
qianwei-yin Nov 1, 2024
1590c78
group/RP filter feature for group table and policy table done
qianwei-yin Nov 2, 2024
e7b59be
group/RP calculator and single policy calculator done
qianwei-yin Nov 3, 2024
9cee696
group/RP calculator handle no data, not permitted, I am admin and che…
qianwei-yin Nov 3, 2024
bab2ff4
group/RP check if current user has permission on modifying policies, …
qianwei-yin Nov 4, 2024
37cca31
group/RP calculate new permission when editing a row protection, and …
qianwei-yin Nov 5, 2024
19a7ee8
group/RP add group id column to group table, also set up sort by grou…
qianwei-yin Nov 5, 2024
55bca57
group/RP edit permission table set up and do some refactoring
qianwei-yin Nov 8, 2024
5fdc589
group/RP add a single policy view, for users to create new or edit a …
qianwei-yin Nov 9, 2024
68650bf
group/RP set up quick fill feature in single policy view
qianwei-yin Nov 10, 2024
2ccd6e1
group/RP finish quick fill, finish add, update, delete a policy
qianwei-yin Nov 11, 2024
2354e13
group/RP do some refactoring
qianwei-yin Nov 11, 2024
ea7b7ca
group/RP some unfinished parts of calculator
qianwei-yin Nov 11, 2024
0b3bac0
group/RP basic setup
qianwei-yin Oct 14, 2024
0dfa799
group/RP nav link done
qianwei-yin Oct 14, 2024
3b1e608
group/RP actions elements under table view done
qianwei-yin Oct 15, 2024
b3a0d0b
group/RP group table set up
qianwei-yin Oct 16, 2024
bc04010
group/RP set group table data
qianwei-yin Oct 17, 2024
0cb735c
group/RP toggle view by done
qianwei-yin Oct 17, 2024
947b043
group/RP paginator for group table (both view by group and user) done
qianwei-yin Oct 19, 2024
184c50f
group/RP policy table data and paginator done
qianwei-yin Oct 21, 2024
fbfd3bb
group/RP group edit/new page set up
qianwei-yin Oct 22, 2024
24cf76c
group/RP group table checkbox feature done
qianwei-yin Oct 23, 2024
a376364
group/RP policy table checkbox feature done
qianwei-yin Oct 23, 2024
411a6f6
group/RP group edit, add and delete user feature set up
qianwei-yin Oct 24, 2024
0054a3a
group/RP group edit page done
qianwei-yin Oct 24, 2024
0926a99
group/RP group new page done
qianwei-yin Oct 24, 2024
b91d816
group/RP permission calculator set up, done with fetching data and cr…
qianwei-yin Oct 25, 2024
406fb2e
group/RP permission calculator partially done, save progress
qianwei-yin Oct 27, 2024
0a1df6e
group/RP permission calculator buttons set up, and optimize table ren…
qianwei-yin Oct 27, 2024
224102d
group/RP optimize table rendering
qianwei-yin Oct 28, 2024
29cb80e
group/RP calculator actions functionality done
qianwei-yin Oct 28, 2024
c2c5832
group/RP sort feature done
qianwei-yin Oct 28, 2024
0deac6c
group/RP edit group functionality done, optimize calculator table log…
qianwei-yin Oct 31, 2024
057d911
group/RP finish edit delete group, edit group, update group, and hand…
qianwei-yin Oct 31, 2024
4cff1ce
group/RP finish feature on edit user's group list
qianwei-yin Oct 31, 2024
d63dd5e
group/RP filter setup
qianwei-yin Nov 1, 2024
34a70fa
group/RP filter feature for group table and policy table done
qianwei-yin Nov 2, 2024
e71d167
group/RP calculator and single policy calculator done
qianwei-yin Nov 3, 2024
6079c65
group/RP calculator handle no data, not permitted, I am admin and che…
qianwei-yin Nov 3, 2024
f364a48
group/RP check if current user has permission on modifying policies, …
qianwei-yin Nov 4, 2024
0172ffd
group/RP calculate new permission when editing a row protection, and …
qianwei-yin Nov 5, 2024
7254de4
group/RP add group id column to group table, also set up sort by grou…
qianwei-yin Nov 5, 2024
0b3ea07
group/RP edit permission table set up and do some refactoring
qianwei-yin Nov 8, 2024
31aec7b
group/RP add a single policy view, for users to create new or edit a …
qianwei-yin Nov 9, 2024
1edaa23
group/RP set up quick fill feature in single policy view
qianwei-yin Nov 10, 2024
7573a23
group/RP finish quick fill, finish add, update, delete a policy
qianwei-yin Nov 11, 2024
a3c727f
group/RP do some refactoring
qianwei-yin Nov 11, 2024
4133433
group/RP some unfinished parts of calculator
qianwei-yin Nov 11, 2024
e12beff
Merge branch 'dev/group-rp' of github.com:cvisionai/tator into dev/gr…
qianwei-yin Nov 11, 2024
8dfaaf5
Merge branch 'main' into dev/group-rp
qianwei-yin Nov 11, 2024
7e4cde6
seems like changed the styling of table.css, change it back
qianwei-yin Nov 11, 2024
b661823
format table.css
qianwei-yin Nov 11, 2024
ff28a55
Merge branch 'main' into dev/group-rp
qianwei-yin Nov 13, 2024
eafa23c
Merge branch 'main' into dev/group-rp
qianwei-yin Nov 15, 2024
5f72697
group/RP batch delete policies
qianwei-yin Nov 15, 2024
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
4 changes: 4 additions & 0 deletions ui/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ app.get('/:projectId/annotation/:id', (req, res) => {
res = addHeaders(res);
});

app.get('/permission-settings', (req, res) => {
res.render("permission-settings", params);
});

app.get('/token', (req, res) => {
res.render('token', params);
});
Expand Down
345 changes: 345 additions & 0 deletions ui/server/views/includes/permission-settings/single-view.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,345 @@
<template id="group-single-view">
<div class="d-flex flex-column pl-md-6 px-6">
<div
id="title-div"
class="d-flex flex-row flex-justify-between flex-items-center mb-3"
>
<a
class="btn btn-width btn-outline text-gray my-3 px-2"
href="#Group-All"
>
<svg
slot="icon"
class="mr-2"
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 512 512"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M176.1 103C181.7 107.7 184 113.8 184 120S181.7 132.3 176.1 136.1L81.94 232H488C501.3 232 512 242.8 512 256s-10.75 24-24 24H81.94l95.03 95.03c9.375 9.375 9.375 24.56 0 33.94s-24.56 9.375-33.94 0l-136-136c-9.375-9.375-9.375-24.56 0-33.94l136-136C152.4 93.66 167.6 93.66 176.1 103z"
/>
</svg>
<span> Back </span>
</a>
<h2 class="h2" id="title"></h2>
<span></span>
</div>

<div id="no-data" class="text-center" hidden></div>

<form id="group-form" hidden>
<enum-input
hidden
id="organization-id-input"
name="Organization ID"
type="int"
></enum-input>
<text-input
id="group-name"
name="Group name"
type="string"
hidden
></text-input>

<div class="mt-4 mb-2">Total <span id="item-count"></span></div>
<div id="card-list" class="mb-5 card-list">
<!-- MEMBER/GROUP CARDS -->
</div>
<div class="f3 text-center hidden" id="group-input-warning"></div>

<div class="d-flex flex-column" id="form-input-for-group">
<text-area id="username-list-input" name="Username list" type="string">
</text-area>

<div class="d-flex flex-row" style="align-self: end">
<div class="f3 mr-4 hidden" id="username-list-warning"></div>
<button id="username-list-add" class="btn btn-small btn-outline">
Add
</button>
<button id="username-list-delete" class="btn btn-small btn-outline">
Delete
</button>
</div>
</div>
</form>

<div
id="group-single-view--save-cancel-section"
class="d-flex flex-items-center flex-justify-center my-4"
style="display: none"
>
<input
id="group-single-view-save"
type="submit"
value="Save"
class="btn btn-clear f1 text-semibold"
/>
<a
href="#Group-All"
id="group-single-view-cancel"
class="px-5 f1 text-gray hover-text-white"
>
Cancel
</a>
</div>
</div>
</template>

<template id="policy-calculator-view">
<div class="d-flex flex-column pl-md-6 px-6">
<div
id="title-div"
class="d-flex flex-row flex-justify-between flex-items-center mb-3"
>
<a
class="btn btn-width btn-outline text-gray my-3 px-2"
href="#Policy-All"
>
<svg
slot="icon"
class="mr-2"
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 512 512"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M176.1 103C181.7 107.7 184 113.8 184 120S181.7 132.3 176.1 136.1L81.94 232H488C501.3 232 512 242.8 512 256s-10.75 24-24 24H81.94l95.03 95.03c9.375 9.375 9.375 24.56 0 33.94s-24.56 9.375-33.94 0l-136-136c-9.375-9.375-9.375-24.56 0-33.94l136-136C152.4 93.66 167.6 93.66 176.1 103z"
/>
</svg>
<span> Back </span>
</a>
<h2 class="h2" id="title">Effective Permission Calculator</h2>
<span></span>
</div>

<form id="calculator-table-form">
<div
class="d-flex flex-row flex-justify-around"
id="inputs-div"
style="display: none"
>
<div class="d-flex flex-column">
<enum-input
id="entity-type-input"
name="Entity"
data-key="entityType"
></enum-input>
<text-input
id="entity-id-input"
name="ID"
type="int"
data-key="entityId"
></text-input>
</div>
<div class="d-flex flex-column">
<enum-input
id="target-type-input"
name="Target"
data-key="targetType"
></enum-input>
<text-input
id="target-id-input"
name="ID"
type="int"
data-key="targetId"
></text-input>
</div>
</div>

<text-input
name="Permission"
type="int"
id="permission-input"
hidden
></text-input>
<div id="no-permission" class="text-center my-4 text-red" hidden></div>

<div id="no-data" class="text-center my-4" hidden></div>

<div class="my-4 px-3 calculator-table-div">
<table
id="calculator-table"
class="table permission-table calculator-table"
>
<colgroup id="calculator-table--colgroup"></colgroup>
<thead id="calculator-table--head"></thead>
<tbody id="calculator-table--body"></tbody>
</table>
</div>
</form>

<div
id="calculator-table--save-reset-section"
class="d-flex flex-items-center flex-justify-center my-4"
style="display: none"
>
<input
id="calculator-table-save"
type="submit"
value="Save"
class="btn btn-clear f1 text-semibold"
style="display: none"
/>
<button
id="calculator-table-reset"
class="btn btn-width btn-outline text-gray my-3 px-4"
>
Reset
</button>
</div>
</div>
</template>

<template id="policy-single-view">
<div class="d-flex flex-column pl-md-6 px-6">
<div
id="title-div"
class="d-flex flex-row flex-justify-between flex-items-center mb-3"
>
<a
class="btn btn-width btn-outline text-gray my-3 px-2"
href="#Policy-All"
>
<svg
slot="icon"
class="mr-2"
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 512 512"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M176.1 103C181.7 107.7 184 113.8 184 120S181.7 132.3 176.1 136.1L81.94 232H488C501.3 232 512 242.8 512 256s-10.75 24-24 24H81.94l95.03 95.03c9.375 9.375 9.375 24.56 0 33.94s-24.56 9.375-33.94 0l-136-136c-9.375-9.375-9.375-24.56 0-33.94l136-136C152.4 93.66 167.6 93.66 176.1 103z"
/>
</svg>
<span> Back </span>
</a>
<h2 class="h2" id="title"></h2>
<span></span>
</div>

<form id="edit-table-form">
<div class="d-flex flex-row flex-justify-between" id="inputs-div">
<div class="d-flex flex-column">
<enum-input
id="entity-type-input"
name="Entity"
data-key="entityType"
></enum-input>
<text-input
id="entity-id-input"
name="ID"
type="int"
data-key="entityId"
></text-input>
</div>
<div class="d-flex flex-column">
<enum-input
id="target-type-input"
name="Target"
data-key="targetType"
></enum-input>
<text-input
id="target-id-input"
name="ID"
type="int"
data-key="targetId"
></text-input>
</div>
</div>

<div
class="d-flex flex-row flex-justify-between"
id="permission-input-div"
>
<enum-input
class="col-4"
id="quick-fill-input"
name="Quick Fill"
data-key="quickFill"
></enum-input>
<text-input
class="col-5"
name="Permission"
type="int"
id="permission-input"
></text-input>
</div>

<div id="no-permission" class="text-center my-4 text-red" hidden></div>
<div id="no-data" class="text-center my-4" hidden></div>

<div class="my-4 px-3 edit-table-div" id="edit-table-div" hidden>
<table id="edit-table" class="table permission-table calculator-table">
<colgroup id="edit-table--colgroup"></colgroup>
<thead id="edit-table--head"></thead>
<tbody id="edit-table--body"></tbody>
</table>
</div>
</form>

<div
id="edit-table--save-reset-section"
class="d-flex flex-items-center flex-justify-center my-4"
style="display: none; gap: 5px"
>
<input
id="edit-table-save"
type="submit"
value="Save"
class="btn btn-clear f1 text-semibold"
/>
<button
id="edit-table-reset"
class="btn btn-width btn-outline text-gray my-3 px-4"
style="display: none"
>
Reset
</button>
<button
id="edit-table-delete"
class="btn btn-width btn-outline text-gray my-3 px-4"
style="display: none"
>
Delete
</button>
</div>
</div>
</template>

<template id="group-member-card">
<div class="group-member-card px-2 py-2" id="group-member-card-div">
<h3
class="h3 pb-2 group-member-card--username"
id="group-member-card--username"
></h3>
<p id="group-member-card--email" class="f3 group-member-card--email"></p>
</div>
</template>

<template id="user-group-card">
<div class="user-group-card px-2 py-2" id="user-group-card-div">
<h3 class="h3 pb-2 d-flex flex-row flex-justify-between">
<span id="user-group-card--id"></span>
<x-mark-button id="remove-group-button"></x-mark-button>
</h3>
<p id="user-group-card--name" class="f3 user-group-card--name"></p>
</div>
</template>
Loading
Loading