-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6450 from Turbo87/token-display
settings/tokens: Display endpoint/crate scopes if they exist
- Loading branch information
Showing
8 changed files
with
118 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { htmlSafe } from '@ember/template'; | ||
|
||
const DESCRIPTIONS = { | ||
'change-owners': 'Invite new crate owners or remove existing ones', | ||
'publish-new': 'Publish new crates', | ||
'publish-update': 'Publish new versions of existing crates', | ||
yank: 'Yank and unyank crate versions', | ||
}; | ||
|
||
export function scopeDescription(scope) { | ||
return DESCRIPTIONS[scope]; | ||
} | ||
|
||
export function patternDescription(pattern) { | ||
if (pattern === '*') { | ||
return 'Matches all crates on crates.io'; | ||
} else if (pattern.endsWith('*')) { | ||
return htmlSafe(`Matches all crates starting with <strong>${pattern.slice(0, -1)}</strong>`); | ||
} else { | ||
return htmlSafe(`Matches only the <strong>${pattern}</strong> crate`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters