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

Feature/access control #49

Merged
merged 56 commits into from
Jun 15, 2022
Merged

Feature/access control #49

merged 56 commits into from
Jun 15, 2022

Conversation

braginini
Copy link
Contributor

No description provided.

@braginini
Copy link
Contributor Author

braginini commented May 28, 2022

@dataontabs

  1. If I click the Add Peer button on the Peers list the page doesn't navigate to the Add Peer tab but replaces the Peers view with Add Peer view

  2. Copy IP on Peers tab doesn't work. Same for the Setup Keys tab

dataontabs and others added 5 commits May 28, 2022 12:22
…'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;
@braginini
Copy link
Contributor Author

@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
sudo netbird up --management-url http://0.0.0.0:33073

@mlsmaycon
Copy link
Contributor

Should be ok to merge. Just sync between branch/main

Source: Group[] | string[] | null
Destination: Group[] | string[] | null
Flow: string
Disabled: boolean
Copy link
Contributor Author

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;

Suggested change
Disabled: boolean
Disabled: boolean;


const { Title, Paragraph } = Typography;
const { Column } = Table;
const { confirm } = Modal;

interface PeerDataTable extends Peer {
key: string
key: string;
Copy link
Contributor Author

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 ··

Suggested change
key: string;
key: string;

/>*/}

<Radio.Group
options={optionsDisabledEnabled}
Copy link
Contributor Author

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 ····················

Suggested change
options={optionsDisabledEnabled}
options={optionsDisabledEnabled}

<Option key={m}>{optionRender(m)}</Option>
)
}
</Select>
Copy link
Contributor Author

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 ··················

Suggested change
</Select>
</Select>

return (
<Popover key={peerToAction.key} content={mainContent} title={null}>
<Button type="link" onClick={() => setUpdateGroupsVisible(peerToAction, true)}>{label}</Button>
</Popover>
Copy link
Contributor Author

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 ······

Suggested change
</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 });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>
<strong>{_g.Name}</strong>
</Tag>
<span style={{fontSize: ".85em"}}>{peersCount}</span>
Copy link
Contributor Author

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"·

Suggested change
<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',
Copy link
Contributor Author

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"

Suggested change
'SAVE_PEERS_GROUPS_FAILURE',
"SAVE_PEERS_GROUPS_FAILURE"

}

export interface PeerToSave extends Peer {
groupsToSave: string[]
Copy link
Contributor Author

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 ;

Suggested change
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 {
Copy link
Contributor Author

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 }));⏎··

Suggested change
return {
}));

spinning: loading,
delay: 1,
size: "large"
}
Copy link
Contributor Author

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 ··};

Suggested change
}
};

groupsNoId: [],
groupsToSave: [],
groupsToRemove: [],
groupsToAdd: []
Copy link
Contributor Author

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:·[],

Suggested change
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 })
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlsmaycon mlsmaycon merged commit 6724e5b into main Jun 15, 2022
@mlsmaycon mlsmaycon deleted the feature/access-control branch June 15, 2022 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants