-
Notifications
You must be signed in to change notification settings - Fork 65
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
Feature/access control #49
Conversation
# Conflicts: # package-lock.json # package.json # src/App.js # src/components/Banner.js # src/components/Footer.js # src/components/addpeer/AddPeerTabSelector.js # src/views/Peers_.js
|
…'t navigate to the Add Peer tab but replaces the Peers view with Add Peer view; Copy IP on Peers tab doesn't work. Same for the Setup Keys tab;
@dataontabs I pushed a missing part. When we have a self-hosted version then in the Add peer tab we should display netbird up command with the management URL |
…rd into feature/access-control
Should be ok to merge. Just sync between branch/main |
src/store/rule/types.ts
Outdated
Source: Group[] | string[] | null | ||
Destination: Group[] | string[] | null | ||
Flow: string | ||
Disabled: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace ····Disabled:·boolean
with ··Disabled:·boolean;
Disabled: boolean | |
Disabled: boolean; |
|
||
const { Title, Paragraph } = Typography; | ||
const { Column } = Table; | ||
const { confirm } = Modal; | ||
|
||
interface PeerDataTable extends Peer { | ||
key: string | ||
key: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace ····
with ··
key: string; | |
key: string; |
/>*/} | ||
|
||
<Radio.Group | ||
options={optionsDisabledEnabled} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Delete ····················
options={optionsDisabledEnabled} | |
options={optionsDisabledEnabled} |
<Option key={m}>{optionRender(m)}</Option> | ||
) | ||
} | ||
</Select> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Delete ··················
</Select> | |
</Select> |
return ( | ||
<Popover key={peerToAction.key} content={mainContent} title={null}> | ||
<Button type="link" onClick={() => setUpdateGroupsVisible(peerToAction, true)}>{label}</Button> | ||
</Popover> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Delete ······
</Popover> | |
</Popover> |
setUpdateGroupsVisible({} as Peer, false) | ||
dispatch(peerActions.resetSavedGroups(null)) | ||
} else if (savedGroups.error) { | ||
message.error({ content: 'Failed to update peer groups. You might not have enough permissions.', key: saveGroupsKey, duration: 2, style }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message.error({ content: 'Failed to update peer groups. You might not have enough permissions.', key: saveGroupsKey, duration: 2, style }); | |
message.error({ |
> | ||
<strong>{_g.Name}</strong> | ||
</Tag> | ||
<span style={{fontSize: ".85em"}}>{peersCount}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace ····················<span·style={{fontSize:·".85em"
with ··········<span·style={{·fontSize:·".85em"·
<span style={{fontSize: ".85em"}}>{peersCount}</span> | |
<span style={{ fontSize: ".85em" }}>{peersCount}</span> |
saveGroups: createAsyncAction( | ||
'SAVE_PEERS_GROUPS_REQUEST', | ||
'SAVE_PEERS_GROUPS_SUCCESS', | ||
'SAVE_PEERS_GROUPS_FAILURE', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace ··'SAVE_PEERS_GROUPS_FAILURE',
with "SAVE_PEERS_GROUPS_FAILURE"
'SAVE_PEERS_GROUPS_FAILURE', | |
"SAVE_PEERS_GROUPS_FAILURE" |
} | ||
|
||
export interface PeerToSave extends Peer { | ||
groupsToSave: string[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Insert ;
groupsToSave: string[] | |
groupsToSave: string[]; |
const gs = groups | ||
.filter(g => g.Peers?.find((_p:GroupPeer) => _p.ID === p.ID)) | ||
.map(g => ({ID: g.ID, Name: g.Name, PeersCount: g.Peers?.length, Peers: g.Peers || []})) | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Insert }));⏎··
return { | |
})); |
spinning: loading, | ||
delay: 1, | ||
size: "large" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace ····}
with ··};
} | |
}; |
groupsNoId: [], | ||
groupsToSave: [], | ||
groupsToRemove: [], | ||
groupsToAdd: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace ····groupsToAdd:·[]
with groupsToAdd:·[],
groupsToAdd: [] | |
groupsToAdd: [], |
} else if (deletedRule.error) { | ||
message.error({ content: 'Error! Something wrong to delete rule.', key: deleteKey, duration: 2, style }); | ||
message.error({ content: 'Failed to remove rule. You might not have enough permissions.', key: deleteKey, duration: 2, style }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message.error({ content: 'Failed to remove rule. You might not have enough permissions.', key: deleteKey, duration: 2, style }) | |
message.error({ |
No description provided.