Skip to content

Commit

Permalink
Merge pull request #199 from bcgov/dev
Browse files Browse the repository at this point in the history
Theme and Consumer Fix
  • Loading branch information
ikethecoder authored Sep 14, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 34bc2de + 5bcf039 commit b15c624
Showing 13 changed files with 446 additions and 74 deletions.
4 changes: 2 additions & 2 deletions src/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@ module.exports = {
},
stories: [
'../stories/**/*.stories.mdx',
'../stories/**/*.stories.@(js|jsx|ts|tsx)',
'../nextapp/components/**/*.stories.@(js|jsx|ts|tsx)',
'../stories/**/*.stories.@(js|jsx|ts|tsx|mdx)',
'../nextapp/components/**/*.stories.@(js|jsx|ts|tsx|mdx)',
],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
webpackFinal: async (config) => {
4 changes: 4 additions & 0 deletions src/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -2,4 +2,8 @@
body {
background: white !important;
}

div[dir] {
min-height: auto !important;
}
</style>
5 changes: 5 additions & 0 deletions src/authz/whitelist.json
Original file line number Diff line number Diff line change
@@ -890,5 +890,10 @@
"referer": "http://localhost:4180/devportal/requests/new/61208533a343b51df6d5d066",
"query": "\n mutation Add($name: String!, $description: String) {\n createApplication(data: { name: $name, description: $description }) {\n id\n appId\n name\n }\n }\n",
"added": "2021-08-22T16:36:21.234Z"
},
"4f72a18c241e589f691cecbbcaa6d0ee": {
"referer": "http://localhost:4180/manager/consumers",
"query": "\n query GetConsumer($id: ID!) {\n getGatewayConsumerPlugins(id: $id) {\n id\n username\n aclGroups\n customId\n extForeignKey\n namespace\n plugins {\n id\n name\n extForeignKey\n config\n service {\n id\n name\n extForeignKey\n }\n route {\n id\n name\n extForeignKey\n }\n }\n tags\n createdAt\n }\n\n allServiceAccesses(where: { consumer: { id: $id } }) {\n name\n consumerType\n application {\n appId\n name\n owner {\n name\n username\n email\n }\n }\n }\n\n allProductsByNamespace {\n id\n name\n environments {\n id\n appId\n name\n active\n flow\n credentialIssuer {\n id\n availableScopes\n clientRoles\n }\n services {\n name\n routes {\n name\n }\n }\n }\n }\n }\n",
"added": "2021-09-14T20:01:21.445Z"
}
}
4 changes: 3 additions & 1 deletion src/nextapp/components/services-list/metric-graph.tsx
Original file line number Diff line number Diff line change
@@ -179,7 +179,9 @@ const MetricGraph: React.FC<MetricGraphProps> = ({
</Stat>
<Stat flex="1 1 50%">
<StatLabel {...labelProps}>Peak Daily</StatLabel>
<StatNumber>{numeral(peakDay.total).format('0.0a')}</StatNumber>
<StatNumber>
{numeral(peakDay?.total ?? 0).format('0.0a')}
</StatNumber>
</Stat>
<Stat flex="1 1 50%">
<StatLabel {...labelProps}>Peak Day</StatLabel>
111 changes: 107 additions & 4 deletions src/nextapp/shared/theme.ts
Original file line number Diff line number Diff line change
@@ -7,13 +7,41 @@ const colors = {
'bc-component': '#606060',
'bc-link': '#1A5A96',
'bc-blue-alt': '#38598A',
'bc-light-blue': '#77ACF1',
'bc-gray': '#f2f2f2',
'bc-border-focus': '#3B99FC',
'bc-error': '#D8292F',
'bc-success': '#2E8540',
ui: {
500: '#606060',
},
primary: {
500: '#003366',
},
green: {
'50': '#ECF8EF',
'100': '#CAEDD1',
'200': '#A8E1B4',
'300': '#86D596',
'400': '#64C979',
'500': '#42BD5B',
'600': '#349849',
'700': '#277237',
'800': '#1A4C24',
'900': '#0D2612',
},
red: {
'50': '#FBE9EA',
'100': '#F4C3C4',
'200': '#ED9C9F',
'300': '#E67579',
'400': '#DF4E53',
'500': '#D8272D',
'600': '#AD1F24',
'700': '#81181B',
'800': '#561012',
'900': '#2B0809',
},
};
const _focus = {
outline: '4px solid',
@@ -136,13 +164,13 @@ const theme = extendTheme(
},
defaultProps: {
size: 'lg',
colorScheme: 'ui',
colorScheme: 'primary',
},
},
Radio: {
defaultProps: {
size: 'lg',
colorScheme: 'ui',
colorScheme: 'primary',
},
},
Input: {
@@ -205,14 +233,89 @@ const theme = extendTheme(
},
Switch: {
defaultProps: {
colorScheme: 'ui',
colorScheme: 'primary',
},
},
Table: {
sizes: {
sm: { th: { fontSize: 'sm' } },
md: { th: { fontSize: 'md' } },
lg: { th: { fontSize: 'lg' } },
},
variants: {
simple: {
th: {
borderBottom: '2px solid',
borderColor: 'bc-yellow',
textTransform: 'none',
},
},
},
},
Tabs: {
variants: {
line: {
tab: {
color: 'bc-component',
_selected: {
fontWeight: 'bold',
color: 'bc-blue',
},
},
},
},
},
Tag: {
baseStyle: {
label: {
lineHeight: '1.4',
},
},
variants: {
'bc-input': {
container: {
borderRadius: 4,
color: 'white',
fontWeight: 'bold',
px: 4,
backgroundColor: 'bc-light-blue',
},
},
outline: {
container: {
borderRadius: 4,
backgroundColor: '#E9F0F8',
borderColor: 'rgba(142, 142, 142, 0.35)',
color: 'text',
},
},
drag: {
container: {
borderRadius: 4,
backgroundColor: 'white',
border: '1px solid',
borderColor: 'bc-gray',
color: 'text',
fontSize: 'xs',
},
icon: {
color: 'bc-component',
},
},
},
},
},
},
withDefaultVariant({
variant: 'bc-input',
components: ['Checkbox', 'Input', 'FormErrorMessage', 'Select', 'Textarea'],
components: [
'Checkbox',
'Input',
'FormErrorMessage',
'Select',
'Textarea',
'Tag',
],
})
);

3 changes: 2 additions & 1 deletion src/nextapp/shared/types/query.types.ts
Original file line number Diff line number Diff line change
@@ -5877,7 +5877,7 @@ export type NamespaceInput = {

export type UserContact = {
__typename?: 'UserContact';
id: Scalars['String'];
id: Scalars['ID'];
name: Scalars['String'];
username: Scalars['String'];
email: Scalars['String'];
@@ -6852,6 +6852,7 @@ export type QueryConsumerScopesAndRolesArgs = {

export type QueryUsersByNamespaceArgs = {
namespace: Scalars['String'];
scopeName?: Maybe<Scalars['String']>;
};


2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-error-boundary": "^3.1.0",
"react-icons": "^4.1.0",
"react-icons": "^4.2.0",
"react-intersection-observer": "^8.31.0",
"react-markdown": "^5.0.3",
"react-modal": "^3.12.1",
3 changes: 2 additions & 1 deletion src/services/keystone/types.ts
Original file line number Diff line number Diff line change
@@ -5877,7 +5877,7 @@ export type NamespaceInput = {

export type UserContact = {
__typename?: 'UserContact';
id: Scalars['String'];
id: Scalars['ID'];
name: Scalars['String'];
username: Scalars['String'];
email: Scalars['String'];
@@ -6852,6 +6852,7 @@ export type QueryConsumerScopesAndRolesArgs = {

export type QueryUsersByNamespaceArgs = {
namespace: Scalars['String'];
scopeName?: Maybe<Scalars['String']>;
};


64 changes: 0 additions & 64 deletions src/stories/Button.stories.tsx

This file was deleted.

Loading

0 comments on commit b15c624

Please sign in to comment.