Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[v2] Migrating terra-application-navigation from terra-framework #87

Merged
merged 11 commits into from
Oct 2, 2020

Conversation

tbiethman
Copy link
Contributor

Summary

The ApplicationNavigation component is being migrated into terra-application to prepare for its alignment with v2's new architecture. This PR is a port of the previous component package's implementation and jest tests. The only changes include updates to the theme variable names to make them differ from those in the existing package, and the addition of dependencies for the migrated code. Wdio tests were not ported, as they will likely be rewritten as the component changes.

@tbiethman tbiethman added the V3 label Sep 16, 2020
@tbiethman tbiethman self-assigned this Sep 16, 2020
@mjhenkes mjhenkes temporarily deployed to terra-applic-v2-migrate-aepe02 September 16, 2020 04:40 Inactive
@mjhenkes mjhenkes temporarily deployed to terra-applic-v2-migrate-aepe02 September 16, 2020 04:48 Inactive
import TerraApplicationNavigation from './terra-application-navigation/ApplicationNavigation';
import {
titleConfigPropType, navigationItemsPropType, extensionItemsPropType, utilityItemsPropType, userConfigPropType,
} from './terra-application-navigation/utils/propTypes';
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the terra namespace be dropped? Looking at the styles, they are weird seeing terra-application-application

I was also wondering if the structure should be flattened to move the terra-application-navigation contents up a dir level?

src/
    application-navigation/
        ApplicationNavigation.jsx
        index.js
        NavigationLayout (instead of terra-application-navigation/ApplicationNavigation)

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 will move things around quite a bit with the introduction of the ApplicationContainer in my next PR. I wanted to get this code landed here first because there's so much of it. A bit of a half-step I know, but I think it'll make more sense to reorganize this in a followup.

I believe we need the --terra-application prefix to align with the naming rules, but I agree that seeing application twice in there is awkward. I can update these again when I come up with a better name for this thing.

@@ -0,0 +1,84 @@
@import '../../breakpoints/media-queries';

Copy link
Contributor

@emilyrohrbough emilyrohrbough Sep 16, 2020

Choose a reason for hiding this comment

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

Does the terra-application-navigation have themes imports for all of the scss files?

role: 'listbox',
};

const PopupMenu = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is a migration from terra-framework, but I'm wondering if we should add a high level explanation on more complicated packages that have multiple sub-components in it's implementation

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 do believe this would be helpful. I can take a stab at this when I make my changes to the Navigation component to support our new architecture.

if (isRollup) {
validatedValue = intl.formatMessage({ id: 'Terra.applicationNavigation.notifications.new' });
} else if (value >= 999) {
validatedValue = '99+';
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm this definitely feels off, but I'm not sure whether we should update the check or update the string. @dkasper-was-taken do you remember?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the if check portion is likely what is off. A navigation tab has a width restriction for fitting 99+. I feel like we fixed this elsewhere, but may have missed this one.

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 updated this, and fixing in terra-framework with cerner/terra-framework#1259

@@ -0,0 +1,156 @@
:global {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be converted or will there be a follow up pr to convert these to be theme imports?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there's any modernizing to do for terra-application-navigation, I'd prefer to come back around with a follow-up PR.

mjhenkes and others added 5 commits September 23, 2020 09:56
* Added global styles and inserted empty link to the head

* Updated changelog

* Updated changelog and contributors list

* comments

* updated application-base to initialize inert

* minor change

* minor change to imports

* Updated changelog
@mjhenkes mjhenkes temporarily deployed to terra-applic-v2-migrate-aepe02 September 23, 2020 20:15 Inactive
Copy link
Contributor

@emilyrohrbough emilyrohrbough left a comment

Choose a reason for hiding this comment

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

Can this be linked to #63?

@tbiethman tbiethman linked an issue Sep 24, 2020 that may be closed by this pull request
height: 100%;
position: relative;
top: 0;
width: var(--terra-application-application-navigation-drawer-default-width, calc(100% - 3.571rem));
Copy link
Contributor

Choose a reason for hiding this comment

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

i believe this theme variables name be updated later.

@mjhenkes mjhenkes temporarily deployed to terra-applic-v2-migrate-aepe02 October 2, 2020 14:38 Inactive
@mjhenkes mjhenkes temporarily deployed to terra-applic-v2-migrate-aepe02 October 2, 2020 15:27 Inactive
@tbiethman tbiethman merged commit 2991517 into terra-application-v2 Oct 2, 2020
@tbiethman tbiethman deleted the v2-migrate-application-navigation branch October 2, 2020 20:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants