Skip to content

Conversation

@shivani170
Copy link
Contributor

Description

Allow users to generate API tokens with the desired access:

Fixes devtron-labs/devtron#1810

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

close: () => void
setShowRegeneratedModal: React.Dispatch<React.SetStateAction<boolean>>
editData: EditDataType
customDate
Copy link
Contributor

Choose a reason for hiding this comment

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

please provide type


export const getSelectedEnvironments = (permission) => {
if (permission.accessType === ACCESS_TYPE_MAP.DEVTRON_APPS) {
return permission.environment.find((env) => env.value === '*')
Copy link
Contributor

Choose a reason for hiding this comment

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

We can change this implementation to single for loop

action: permission.action.value,
team: permission.team.value,
environment: getSelectedEnvironments(permission),
entityName: permission.entityName.find((entity) => entity.value === '*')
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

}
}

interface SinglrDatePickerProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix typo

placeholder="Enter a description to remember where you have used this token"
className="form__textarea"
value={editData.description}
onChange={(e) => onChangeEditData(e, 'description')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can add name here to remove inliune function

/>
<div className="icon-dim-16 ml-8">
<Clipboard
onClick={(e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

inline function can be removed

>
<Clipboard className="icon-dim-16" />&nbsp;
Copy token
<button className="flex cta mt-20 mb-20" onClick={(e) => handleCopyToClipboard(e)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

remove inline function change it to {handleCopyToClipboard}

@vivek-devtron vivek-devtron merged commit 68c565e into main Jun 28, 2022
@vivek-devtron vivek-devtron deleted the api_token_1834 branch June 28, 2022 09:28
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.

API token access

4 participants