Skip to content

User team (add, update and remove) implementation#152

Open
ukumar-ks wants to merge 1 commit into
user-team-add-removefrom
user-team-add-remove-int
Open

User team (add, update and remove) implementation#152
ukumar-ks wants to merge 1 commit into
user-team-add-removefrom
user-team-add-remove-int

Conversation

@ukumar-ks
Copy link
Copy Markdown
Contributor

No description provided.

logger.info(renderTeamUserAsciiTable(table))
logger.info('')
logger.info(
`Result: ${result.success ? 'success' : 'partial/failed'} ` +
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

for partial / failed, priting separately would be better, if success = 0 and failed != 0, failed, iff success !=0 and failed != 0, partial

createMessage(
data,
'enterprise/teams_enterprise_users_add',
'teams/teams_enterprise_users_add',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is this a valid change from enterprise to team

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

teams_enterprise_users_add

is this related to the change this API that was previously mentioned ?

FormattedTeamUserTable,
}

const SUCCESS_RESULT = 'success'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

don't use constant for simple english words

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is probably a result state. Adding an enum for the result type might be a better idea across all returns when dealing with states

type VaultHandle = Awaited<ReturnType<typeof login>>

const OP_ADD = '1'
const OP_REMOVE = '2'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These types are constants are what fit into enum

Comment on lines +26 to +29
const USERS_PROMPT = 'User email(s) or ID(s) (comma-separated): '
const TEAMS_PROMPT = 'Team name(s) or UID(s) (comma-separated): '
const HIDE_SHARED_FOLDERS_PROMPT = 'Hide shared folders? [on/off/skip]: '
const OPERATION_INPUT_PROMPT = `Operation [${OP_ADD}-${OP_REMOVE}]: `
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

probably need not be assigned to constants

async function executeOperation(vault: VaultHandle, input: OperationInput): Promise<TeamUserResult> {
const restore = suppressLogs()
try {
return input.kind === 'add'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

there is string comparison here

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