Skip to content

Commit

Permalink
Merge pull request #1796 from bcgov/redirs
Browse files Browse the repository at this point in the history
redirect migrated pages to the new content
  • Loading branch information
MonicaG authored Jan 27, 2023
2 parents 4847877 + 6cd26d9 commit 9373ca4
Show file tree
Hide file tree
Showing 90 changed files with 574 additions and 980 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,7 @@ web/registry/registry.json
# IntelliJ file
.idea

# VSCode configs
.vscode/

web/cypress/videos
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Devhub

[![Lifecycle:Stable](https://img.shields.io/badge/Lifecycle-Stable-97ca00)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
[![Lifecycle:Dormant](https://img.shields.io/badge/Lifecycle-Dormant-ff7f2a)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)

This is the primary repository for the BC Gov DevHub application. This is a mono repo holding multiple services that are coupled together. More details can be found in the [schematic](./schematic.md)

Expand Down
213 changes: 213 additions & 0 deletions openshift/templates/web/dc.yaml

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@ In Development
* to run test suites: `npm test`
* to run storybook: `npm run storybook`

### Debugging from VSCode

[Launch.json](https://code.visualstudio.com/Docs/editor/debugging#_launch-configurations) configuration file for VSCode.
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Gatsby develop",
"type": "node",
"runtimeVersion": "10.24.1",
"request": "launch",
"cwd": "${workspaceFolder}/web/",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "dev"],
"console": "integratedTerminal"
}
]
}
```

## Deployment (Docker Compose for Local Development)

* Requires **Docker** & **Docker Compose** (and for Windows users. some `bash` compatible environment)
Expand Down Expand Up @@ -162,6 +183,29 @@ At this point, you can modify contents of the `registry` directory (adding resou
}
}
```

## Troubleshooting

### Invalid token

```
Error in "/devhub-app-web/web/node_modulesgatsby-plugin-algolia/gatsby-node.js": Invalid or unexpected token

Error: /devhub-app-web/web/node_modules/gatsby-plugin-algolia/gatsby-node.js: 47
const client = algoliasearch(appId, apiKey, { timeout: 30_000});
^^

SyntaxError: Invalid or unexpected token
```
Change the line to (note the underscore removed from the number):
```
const client = algoliasearch(appId, apiKey, { timeout: 30000});
```
### Changes not picked up when running locally
Try deleting the `devhub-app-web/web/.cache/` directory.
## Getting Help or Reporting an Issue
To report bugs/issues/feature requests, please file an [issue](https://github.com/bcgov/devhub-app-web/issues/).
Expand Down
20 changes: 16 additions & 4 deletions web/gatsby/resolvers/devhubTopic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
Created by Patrick Simonian
*/
const { nodeBelongsToTopic } = require('../utils/validators');
const { uniqWith, isEqual } = require('lodash');
const { uniqWith } = require('lodash');

const resolveDevhubTopicConnections = (source, args, context) => {
// cache devhub topic connectsWith resolutions for speed purposes
Expand All @@ -31,9 +31,14 @@ const resolveDevhubTopicConnections = (source, args, context) => {
type: 'DevhubSiphon',
})
.filter(n => {
return n.source.type === 'web' && nodeBelongsToTopic(source.name, n);
return n.source.type === 'web' && n.name === source.name;
})
.map(n => ({ fields: { ...n.fields }, id: n.id, path: n.resource.path }));
.map(n => ({
fields: { ...n.fields },
id: n.id,
path: n.resource.path,
title: n.fields.title,
}));

let ghNodes = context.nodeModel.getAllNodes({
type: 'GithubRaw',
Expand All @@ -48,7 +53,14 @@ const resolveDevhubTopicConnections = (source, args, context) => {
// });

// siphon nodes produce multiples of the same type which we need to filter out
webNodes = uniqWith(webNodes, isEqual);
// Note: When content was pulled from DevHub to https://docs.developer.gov.bc.ca/ some of the new content
// was merged into one page. We want to point multiple DevHub pages to the new page. In this case we want
// to allow duplicate urls where the titles are unique. A comparison cannot be done on the object because the
// ids are different between duplicate nodes. So, comparison is just done on path and title.
webNodes = uniqWith(
webNodes,
(nodeA, nodeB) => nodeA.path === nodeB.path && nodeA.title === nodeB.title,
);

ghNodes = ghNodes
.filter(n => nodeBelongsToTopic(source.name, n) && !n.fields.disabled)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions web/src/assets/migrated-pages/Community-and-Events/events.md

This file was deleted.

Loading

0 comments on commit 9373ca4

Please sign in to comment.