@capillarytech/creatives-library 7.17.165 → 7.17.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -61,7 +61,7 @@ export class NavigationBar extends React.Component {
|
|
|
61
61
|
key: 'settings',
|
|
62
62
|
placement: 'bottomRight',
|
|
63
63
|
className: 'navigation-setting-icon',
|
|
64
|
-
toolTip: formatMessage(messages.
|
|
64
|
+
toolTip: formatMessage(messages.loyaltyCreativeSettings),
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
67
|
default:
|
|
@@ -140,6 +140,19 @@ export class NavigationBar extends React.Component {
|
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
+
productSelection = () => {
|
|
144
|
+
const { location, intl: { formatMessage } } = this.props;
|
|
145
|
+
const { pathname } = location;
|
|
146
|
+
const parentModule = pathname.substring(pathname.lastIndexOf('/') + 1);
|
|
147
|
+
switch (parentModule) {
|
|
148
|
+
case LOYALTY:
|
|
149
|
+
return formatMessage(messages.loyaltyProgram);
|
|
150
|
+
default:
|
|
151
|
+
return formatMessage(messages.selectedProductDefault)
|
|
152
|
+
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
143
156
|
render() {
|
|
144
157
|
const {
|
|
145
158
|
topbarMenuData,
|
|
@@ -178,7 +191,7 @@ export class NavigationBar extends React.Component {
|
|
|
178
191
|
topbarIcons={topbarIcons}
|
|
179
192
|
sidebarMenuData={[]}
|
|
180
193
|
sidebarMenuItemsPosition={null}
|
|
181
|
-
defaultSelectedProduct={
|
|
194
|
+
defaultSelectedProduct={this.productSelection()}
|
|
182
195
|
skipStateForStorage
|
|
183
196
|
selectOrganization={intl.formatMessage(messages.selectOrganization)}
|
|
184
197
|
isLatestLeftNavigationEnabled={isLatestLeftNavigationEnabled}
|
|
@@ -199,6 +212,7 @@ export class NavigationBar extends React.Component {
|
|
|
199
212
|
</CapWrapper>
|
|
200
213
|
</div>
|
|
201
214
|
</CapNavigation>
|
|
215
|
+
|
|
202
216
|
);
|
|
203
217
|
}
|
|
204
218
|
}
|
|
@@ -66,4 +66,8 @@ export default defineMessages({
|
|
|
66
66
|
id: `${scope}.selectOrganization`,
|
|
67
67
|
defaultMessage: 'Select organization',
|
|
68
68
|
},
|
|
69
|
+
"loyaltyCreativeSettings": {
|
|
70
|
+
id: `${scope}.loyaltyCreativeSettings`,
|
|
71
|
+
defaultMessage: 'There are no settings for creatives within Loyalty+. Channel-related settings are available within organisation settings',
|
|
72
|
+
}
|
|
69
73
|
});
|
|
@@ -62,4 +62,11 @@ describe('NavigationBar', () => {
|
|
|
62
62
|
const topVaerticalBar = document.querySelector('.cap-top-bar-vertical');
|
|
63
63
|
expect(topVaerticalBar).toBeInTheDocument();
|
|
64
64
|
});
|
|
65
|
+
it('Should have loyalty product selected', () => {
|
|
66
|
+
const updatedProps = {...props};
|
|
67
|
+
updatedProps.location.pathname = '/creatives/ui/v2/loyalty';
|
|
68
|
+
renderComponent(updatedProps);
|
|
69
|
+
const loyaltyProduct = screen.getByText('Loyalty+');
|
|
70
|
+
expect(loyaltyProduct).toBeInTheDocument();
|
|
71
|
+
});
|
|
65
72
|
});
|
|
@@ -20,12 +20,11 @@ export const getLoyaltyTopbarMenuDataValue = () => [
|
|
|
20
20
|
link: 'loyalty/ui/',
|
|
21
21
|
key: 'programs',
|
|
22
22
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// },
|
|
23
|
+
{
|
|
24
|
+
label: <FormattedMessage {...globalMessages.promotions} />,
|
|
25
|
+
link: 'loyalty/ui/promotions/list',
|
|
26
|
+
key: 'promotions',
|
|
27
|
+
},
|
|
29
28
|
{
|
|
30
29
|
label: <FormattedMessage {...globalMessages.creatives} />,
|
|
31
30
|
link: '/creatives/ui/v2/loyalty',
|