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

render link to cabinet details as menu button #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

johnclary
Copy link
Member

@johnclary johnclary commented Dec 21, 2021

Related to cityofaustin/atd-data-tech#8032. Renders the cabinet details link as a menu button (instead of the cabinet ID)

Screen Shot 2021-12-21 at 4 08 39 PM

@johnclary
Copy link
Member Author

@dianamartin @ChrispinP this only change is at the bottom of the file.

@johnclary johnclary changed the title update text when rendering link to cabinet details render link to cabinet details as menu button Dec 21, 2021
@@ -873,3 +912,16 @@ $(document).on("knack-view-render.view_1252", function (event, page) {
////////////////////////////////////////////
/// End Technician Time Log Validation ///
////////////////////////////////////////////

//// Update link text to cabinet details page from signal detals
Copy link
Member

Choose a reason for hiding this comment

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

Instead of JS, use this Trigger Button article styling the button with CSS and calling it with the HTML whenever you need it.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, that's a cool trick! TIL. those docs are excellent!

in this case i'm styling a details link from a connection field, so i don't have control in the builder over what html is rendered by Knack. without this custom code, the link text would simply be the display field on the cabinets record.

for the CSS, i'm just using the same classes that knack uses on their menu buttons. that actually might be a nice improvement in your docs. you might not need to write any custom CSS if you can get by with the knack classes.

});
$coacdButton.appendTo("#" + viewId);

// Append Big SSO Login button and non-SSO Login button
bigButton("coacd-big-button", "coacd-button-login", url, "sign-in", "Sign-In")
bigButton(
Copy link
Member

Choose a reason for hiding this comment

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

Curious on the reasoning of re-expanding the SSO code to take up more lines?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is the default formatting behavior of Prettier. i actually was surprised it picked up more linting, since i linted this code the last time i edited it a few months ago. it makes me wonder if knack does some kind of linting automatically, or if my linter settings changed somehow.

i'm happy to defer to the linter's opinions, which aim for more readable code over being concise. in the past we've talked about standardizing these settings and making sure we use them globally, basically the standard right now it prettier's default.

startField,
endField
)}`;
errorMsgs = `${errorMsgs}${formatErrorMessage(startField, endField)}`;
Copy link
Member

Choose a reason for hiding this comment

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

This looks good condensed.

formDiv,
errorMsgs
);
// show red error banner
Copy link
Member

Choose a reason for hiding this comment

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

This looks good condensed.

Copy link
Member

@ChrispinP ChrispinP left a comment

Choose a reason for hiding this comment

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

Left my comments inline :)

@ChrispinP
Copy link
Member

@johnclary this ready to merge?

@ChrispinP
Copy link
Member

@johnclary ping

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