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

Feat: Make automation token UI conform to figma #5208

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

vbustamante
Copy link
Contributor

image image

Signed-off-by: Victor Bustamante <[email protected]>
@vbustamante vbustamante requested a review from jkeiser January 6, 2025 19:32
Copy link

github-actions bot commented Jan 6, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@@ -55,6 +68,16 @@ const revoke = useAsyncState(
{ immediate: false },
);

const createdAt = computed(() =>
new Date(props.authToken.createdAt).toLocaleString(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Personal preference, but maybe something we should consider more broadly: for small snippets we don't reuse, it's probably better not to put this stuff in <script setup>, just so we can see the dependency flow more easily (not have to travel up and down between and <script setup> to understand what something is).

Vue will make the {{ new Date(props.authToken.createdAt).toLocaleString() }} completely reactive (anything in the template is), so they'll have the same effect.

(Not blocking in the least. Intended for discussion.)

/>
</tbody>
</table>
</Stack>
</div>
</Stack>
</div>
<Modal ref="tokenDisplayModalRef" size="lg" title="Token Generated">
<ErrorMessage
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice touch making it red until you copy!

... though is there a SuccessMessage or something one could use for the happy case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the move here would be to have make this into a statusMessage or messageBox component eventually, since we don't have anything else

import { useWorkspacesStore, WorkspaceId } from "@/store/workspaces.store";
import WorkspacePageHeader from "@/components/WorkspacePageHeader.vue";
import { useAuthTokensApi } from "@/store/authTokens.store";
import AuthTokenListItem from "@/components/AuthTokenListItem.vue";

useHead({ title: "Automation Tokens" });
Copy link
Contributor

Choose a reason for hiding this comment

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

Should I be doing this on all pages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkeiser This can be done on the router too, but on the auth portal we've been using this pattern. I'd say useHead on the auth portal, the router title on the webapp

if (createAuthToken.state.value) {
await navigator.clipboard?.writeText(createAuthToken.state.value);
}
tokenCopied.value = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems unlikely to trigger as a bug, but this should probably be inside that if

@@ -175,8 +199,14 @@ const createAuthToken = useAsyncState(
/** Name of token to create */
const createAuthTokenName = ref("");

/** Token modal */
const tokenDisplayModalRef = ref<InstanceType<typeof Modal> | null>(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const tokenDisplayModalRef = ref<InstanceType<typeof Modal> | null>(null);
const tokenDisplayModalRef = ref<InstanceType<typeof Modal>>();

Other places in the codebase do this too. It's DEFINITELY just a nit.

@vbustamante vbustamante added this pull request to the merge queue Jan 6, 2025
Merged via the queue into main with commit 301be99 Jan 6, 2025
9 checks passed
@vbustamante vbustamante deleted the victor/eng-2890-make-ui-good-grunt branch January 6, 2025 20:47
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