Skip to content

Commit

Permalink
Merge pull request #4890 from google/followup/4514-idea-hub
Browse files Browse the repository at this point in the history
Revert making the Idea Hub widget notification full width.
  • Loading branch information
tofumatt authored Feb 25, 2022
2 parents 8e0a127 + 9ae021c commit 58d30dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
20 changes: 0 additions & 20 deletions assets/js/googlesitekit/widgets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
WIDGET_WIDTHS,
WIDGET_AREA_STYLES,
} from './datastore/constants';
import { CORE_MODULES } from '../modules/datastore/constants';

export { registerStore } from './datastore';
export { registerDefaults as registerWidgets } from './register-defaults';
Expand Down Expand Up @@ -155,25 +154,6 @@ export function createWidgets( registry ) {
isWidgetRegistered( slug ) {
return select( CORE_WIDGETS ).isWidgetRegistered( slug );
},

/**
* Checks if a module is connected.
*
* Returns `true` if the module is connected.
* Returns `false` if the module is NOT connected.
*
* @since 1.69.0
*
* @param {string} slug Module's slug.
* @return {boolean} `true`/`false` based on whether module is connected.
*/
async experimentalIsModuleConnected( slug ) {
await registry
.__experimentalResolveSelect( CORE_MODULES )
.getModules();

return select( CORE_MODULES ).isModuleConnected( slug );
},
};
return Widgets;
}
11 changes: 2 additions & 9 deletions assets/js/modules/idea-hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,12 @@ export const registerWidgets = ifIdeaHubIsEnabled( async ( widgets ) => {
return;
}

const ideaHubModuleConnected = await widgets.experimentalIsModuleConnected(
'idea-hub'
);
const ideaHubWidgetWidth = ideaHubModuleConnected
? widgets.WIDGET_WIDTHS.HALF
: widgets.WIDGET_WIDTHS.FULL;

if ( ! isFeatureEnabled( 'unifiedDashboard' ) ) {
widgets.registerWidget(
'ideaHubIdeas',
{
Component: DashboardIdeasWidget,
width: ideaHubWidgetWidth,
width: widgets.WIDGET_WIDTHS.HALF,
priority: 2,
wrapWidget: false,
},
Expand All @@ -106,7 +99,7 @@ export const registerWidgets = ifIdeaHubIsEnabled( async ( widgets ) => {
'ideaHubIdeas',
{
Component: DashboardIdeasWidget,
width: ideaHubWidgetWidth,
width: widgets.WIDGET_WIDTHS.HALF,
priority: 2,
wrapWidget: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
display: flex;
flex-direction: column;
height: 100%;
justify-content: space-between;
justify-content: flex-start;

.googlesitekit-heading-4,
p {
Expand All @@ -45,6 +45,7 @@
svg {
margin-bottom: -12px;
max-width: 100%;
min-width: 90%;
}
}

Expand Down

0 comments on commit 58d30dd

Please sign in to comment.