Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 4a3686e

Browse files
authored
Merge pull request #210 from kontent-ai/migration
Migration
2 parents 4980eec + a4630df commit 4a3686e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+5144
-1588
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths.
22
# See https://help.github.com/articles/about-code-owners/
33

4-
* @Kentico/developer-relations
4+
* @Kontent-ai/developer-relations

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
3434

3535
## Enforcement
3636

37-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at DevelopersCommunity@kentico.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at devrel@konten.ai. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
3838

3939
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
4040

@@ -44,5 +44,3 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi
4444

4545
[homepage]: https://contributor-covenant.org
4646
[version]: https://contributor-covenant.org/version/1/4/
47-
48-
![Analytics](https://kentico-ga-beacon.azurewebsites.net/api/UA-69014260-4/Kentico/Home/master/CODE_OF_CONDUCT.md?pixel)

CONTRIBUTING.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ There are many different ways in which you can contribute. One of the easiest wa
88

99
Please note that **level of provided support is always determined by the [LICENSE](LICENSE.md)** of a given open-source project. Also, always make sure you use the **[latest version](../../releases)** of any given OS project. We can't provide any help for older versions. We don't want to make things complicated so we try to take the same approach in all our repositories.
1010

11-
### I found a bug in a Kentico's open-source project
11+
### I found a bug in a Kontent.ai open-source project
1212

1313
<img align="right" width="100" height="100" src="https://i.imgur.com/TYIQdpv.png">
1414

@@ -20,16 +20,15 @@ Sorry to hear that. Just log a new [GitHub issue](../../issues) and someone will
2020

2121
To get help with coding and structuring your projects, use [StackOverflow](https://stackoverflow.com/) to ask questions with one of the following tags:
2222

23-
- [`kentico-kontent`](https://stackoverflow.com/questions/tagged/kentico-kontent)
24-
- [`kentico`](https://stackoverflow.com/questions/tagged/kentico)
23+
- [`kontent.ai`](https://stackoverflow.com/questions/tagged/kontent.ai)
2524

2625
Our team members and the community monitor these channels on a regular basis.
2726

2827
### I want to report a security bug
2928

3029
<img align="right" width="100" height="100" src="https://i.imgur.com/z82nnJB.png">
3130

32-
Security issues and bugs should be reported privately, via email, to the Kentico Developer Community Team developerscommunity@kentico.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
31+
Security issues and bugs should be reported privately, via email, to the Kontent.ai Developer Community Team devrel@kontent.ai. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
3332

3433
### I have an idea for a new feature (or feedback on existing functionality)
3534

@@ -42,7 +41,7 @@ Everybody loves new features! You can submit a new [feature request](../../issue
4241
<img align="right" width="100" height="100" src="https://i.imgur.com/aSeiliy.png">
4342

4443
Unless you're fixing a typo, it's usually a good idea to discuss the feature before you submit a pull request with code changes, so let's start with submitting a new [GitHub issue](../../issues) and discussing the whether it fits the vision of a given project.
45-
You might also read these two blogs posts on contributing code: [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik. Note that all code submissions will be rigorously reviewed and tested by the Kentico Maintainers teams, and only those that meet an high bar for both quality and design/roadmap appropriateness will be merged into the source.
44+
You might also read these two blogs posts on contributing code: [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik. Note that all code submissions will be rigorously reviewed and tested by the Kontent.ai Maintainers teams, and only those that meet an high bar for both quality and design/roadmap appropriateness will be merged into the source.
4645

4746
### Example - process of contribution
4847

@@ -68,12 +67,10 @@ To start with coding, fork the repository you want to contribute to, create a ne
6867

6968
<img align="right" width="100" height="100" src="https://i.imgur.com/ZQfNzJJ.png">
7069

71-
Your pull request will now go through extensive checks by the subject matter experts on our team. Please be patient. Update your pull request according to feedback until it is approved by one of the Kentico maintainers. After that, one of our team members may adjust the branch you merge into based on the expected release schedule.
70+
Your pull request will now go through extensive checks by the subject matter experts on our team. Please be patient. Update your pull request according to feedback until it is approved by one of the Kontent.ai maintainers. After that, one of our team members may adjust the branch you merge into based on the expected release schedule.
7271

7372
## Code of Conduct
7473

7574
<img align="right" width="100" height="100" src="https://i.imgur.com/cObdKQy.png">
7675

77-
The Kentico team is committed to fostering a welcoming community, therefore this project has adopted the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). If you have any additional questions or comments, you can contact us directly at developerscommunity@kentico.com.
78-
79-
![Analytics](https://kentico-ga-beacon.azurewebsites.net/api/UA-69014260-4/Kentico/Home/master/CONTRIBUTING.md?pixel)
76+
The Kotent.ai team is committed to fostering a welcoming community, therefore this project has adopted the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). If you have any additional questions or comments, you can contact us directly at devrel@kontent.ai

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Kentico
3+
Copyright (c) 2022 Kontent s.r.o.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Kontent sample React single-page application
1+
# Kontent.ai sample React single-page application
22

33
[![Netlify Status](https://api.netlify.com/api/v1/badges/5018e8db-b76e-4f19-8ad2-7fd9da21a2ee/deploy-status)](https://app.netlify.com/sites/kontent-sample-app-react/deploys)
44
[![Live Demo](https://img.shields.io/badge/live-demo-brightgreen.svg)](https://kontent-sample-app-react.netlify.app/)
5-
[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-ASK%20NOW-FE7A16.svg?logo=stackoverflow&logoColor=white)](https://stackoverflow.com/tags/kentico-kontent)
5+
[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-ASK%20NOW-FE7A16.svg?logo=stackoverflow&logoColor=white)](https://stackoverflow.com/tags/kontent-ai)
66

7-
This is a sample website written in Typescript utilizing the Kontent Delivery API to retrieve content from Kontent by Kentico. You can register your developer account at <https://app.kontent.ai>. For a brief walkthrough, check out [Running the React sample app](https://kontent.ai/learn/tutorials/develop-apps/get-started/run-the-react-sample-app) at Kontent Learn.
7+
This is a sample website written in Typescript utilizing the Kontent.ai Delivery API to retrieve content from Kontent.ai. You can register your developer account at <https://app.kontent.ai>. For a brief walkthrough, check out [Running the React sample app](https://kontent.ai/learn/tutorials/develop-apps/get-started/run-the-react-sample-app) at Kontent.ai Learn.
88

99
## Application setup
1010

@@ -17,15 +17,15 @@ This is a sample website written in Typescript utilizing the Kontent Delivery AP
1717

1818
### Connecting to your sample project
1919

20-
At the first run of the app, you'll be presented with a configuration page. It will allow you to connect the app to your Kontent project or create a new one. You'll also be able to start a trial and convert to a free plan when the trial expires.
20+
At the first run of the app, you'll be presented with a configuration page. It will allow you to connect the app to your Kontent.ai project or create a new one. You'll also be able to start a trial and convert to a free plan when the trial expires.
2121

2222
Alternatively, you can connect your project manually as per the chapter below.
2323

2424
#### Connecting to your project manually
2525

26-
If you want to change the source Kontent project, follow these steps:
26+
If you want to change the source Kontent.ai project, follow these steps:
2727

28-
1. In Kontent, choose Project settings from the app menu.
28+
1. In Kontent.ai, choose Project settings from the app menu.
2929
2. Under Development, choose API keys.
3030
3. Copy your Project ID.
3131
4. Open `.env.example` in the root directory.
@@ -38,17 +38,17 @@ When you now run the sample application, the application retrieves content from
3838

3939
Deploy, explore and change the app directly in the browser.
4040

41-
[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/Kentico/kontent-sample-app-react)
41+
[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/kontent-ai/sample-app-react)
4242

43-
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/Kentico/kontent-sample-app-react)
43+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/kontent-ai/sample-app-react)
4444

4545
## Previewing content from your project
4646

47-
If you already have a Kontent account and you want to connect the sample application to a project of your own, you need to provide your Project ID and your Preview API key to authorize requests to the Delivery Preview API. For example, you can connect the application to your modified version of the sample project.
47+
If you already have a Kontent.ai account and you want to connect the sample application to a project of your own, you need to provide your Project ID and your Preview API key to authorize requests to the Delivery Preview API. For example, you can connect the application to your modified version of the sample project.
4848

4949
To preview content in the sample application, follow these steps:
5050

51-
1. In Kontent, choose Project settings from the app menu.
51+
1. In Kontent.ai, choose Project settings from the app menu.
5252
2. Under Development, choose API keys.
5353
3. Copy your Project ID and Preview API key.
5454
4. Open `.env.example` in the root directory .
@@ -63,18 +63,18 @@ When you now run the application, you will see all project content including the
6363
2. Sign in with your credentials.
6464
3. Manage content in the content administration interface of your sample project.
6565

66-
You can learn more about content editing in our tutorials at [Kontent Learn](https://kontent.ai/learn/tutorials/write-and-collaborate/create-content/introducing-content-items).
66+
You can learn more about content editing in our tutorials at [Kontent.ai Learn](https://kontent.ai/learn/tutorials/write-and-collaborate/create-content/introducing-content-items).
6767

6868
## Content delivery
6969

70-
You can retrieve content either through the Kontent Delivery SDKs or the Kontent Delivery API:
70+
You can retrieve content either through the Kontent.ai Delivery SDKs or the Kontent.ai Delivery API:
7171

7272
- For published content, use `https://deliver.kontent.ai/PROJECT_ID/items`.
7373
- For unpublished content, use `https://preview-deliver.kontent.ai/PROJECT_ID/items`.
7474

7575
For more info about the API, see the [API reference](https://kontent.ai/learn/reference).
7676

77-
You can find the Delivery and other SDKs at <https://github.com/Kentico>.
77+
You can find the Delivery and other SDKs at <https://github.com/kontent-ai>.
7878

7979
## Used toolchain
8080

@@ -86,15 +86,15 @@ There are two types of model mapping in this application:
8686

8787
### content type -> DTO -> component
8888

89-
Content type definitions are being generated from content types via [Kontent.ai model generator](https://github.com/Kentico/kontent-model-generator-js) tool. All generated types can be found in `src/Models` folder. The `_project.ts` contains information about the project structure such as project languages as well as other structure information like codenames about content types.
89+
Content type definitions are being generated from content types via [Kontent.ai model generator](https://github.com/kontent-ai/model-generator-js) tool. All generated types can be found in `src/Models` folder. The `_project.ts` contains information about the project structure such as project languages as well as other structure information like codenames about content types.
9090

9191
### content type -> DTO -> view model -> component
9292

9393
Some models displayed in views might require an adjustment from content types. For example, the `Cafe` content type contains fields for `city` and `street` and we would like to have a model containing an address in the format `city, street`. An example of such a view model is in `CafeModel.tsx` that can be found in the `src/ViewModels` folder. To convert `Cafe` into `CafeModel` the function located in `src/Utilities/CafeListing.ts` can be used.
9494

9595
### Data fetching
9696

97-
This solution fetches data using the [Delivery client](https://github.com/Kentico/kontent-delivery-sdk-js). For more implementation detail to set up the client see `src/Client.ts`. The data are fetched and stored in a `container` component directly in its state. Then they are passed to the `presentation` component. For a better understanding see the code example below. However, depending on your needs, you can use other technologies for managing application states such as:
97+
This solution fetches data using the [Delivery client](https://github.com/kontent-ai/delivery-sdk-js). For more implementation detail to set up the client see `src/Client.ts`. The data are fetched and stored in a `container` component directly in its state. Then they are passed to the `presentation` component. For a better understanding see the code example below. However, depending on your needs, you can use other technologies for managing application states such as:
9898

9999
- [Context](https://reactjs.org/docs/context.html)
100100
- [Redux](https://react-redux.js.org/)
@@ -188,7 +188,7 @@ const Container: React.FC = () => {
188188

189189
## Localization
190190

191-
In Kontent each language is identified by codename, in case of this project, it is `en-US` and `es-ES`.
191+
In Kontent.ai each language is identified by codename, in case of this project, it is `en-US` and `es-ES`.
192192

193193
### Resource strings
194194

@@ -229,7 +229,21 @@ const Component: React.FC = () => {
229229
230230
You might want to request items based on the URL slugs. For more information check out [Kontent.ai/learn tutorial](https://kontent.ai/learn/tutorials/develop-apps/get-content/localized-content-items/#a-get-items-by-localized-url-slug). An example in this application for this is provided in `src/Pages/About.tsx` page.
231231
232-
> The showcase is not ideal, because it is using a combination of the language prefix and localizable solution is not ideal. You should try to stick with one of the approaches. Because it is hard to define the behavior for language setting clash i.e. `/<EN-PREFIX>/articles/<ES-URL-SLUG>`.
232+
> The showcase is not ideal, because it is using a combination of the language prefixes and localizable routes. You should try to stick with one of the approaches. Because it is hard to define the behavior (priority) for language setting clashes like `/<EN-PREFIX>/articles/<ES-URL-SLUG>.
233+
234+
### Language fallbacks
235+
236+
To deal with content that is not available in current language, this project uses method called language fallbacks. It will fetch the content in the language which set as fallback language in the Kontent.ai project and redirect the website to the URL with prefix of the given language. However, it is possible to disable language fallbacks by adding a filter of `system.language` to your query. For more information about getting localized content check this [`link.`](https://kontent.ai/learn/tutorials/develop-apps/get-content/localized-content-items/?tech=javascript)
237+
238+
```js
239+
var query = Client.items<AboutUs>().type(contentTypes.about_us.codename);
240+
241+
if (this.language) {
242+
query
243+
.languageParameter(this.language)
244+
.equalsFilter('system.language', 'es-ES');
245+
}
246+
```
233247

234248
## Handling 404
235249

@@ -245,4 +259,4 @@ We would like to express our thanks to the following people who contributed and
245259

246260
- [Bee Martinez](https://github.com/beemtz)
247261

248-
Would you like to become a hero too? Pick an [issue](https://github.com/Kentico/kontent-sample-app-react/issues) and send us a pull request!
262+
Would you like to become a hero too? Pick an [issue](https://github.com/kontent-ai/delivery-sdk-js/issues) and send us a pull request!

0 commit comments

Comments
 (0)