This project is no longer maintained.
- Angular version 10 - may work with older versions but has not been tested
-
Install the component library
npm i --save @ordercloud/angular-cms-components@beta -
Install the required peer dependencies
npm i --save bootstrap @ng-bootstrap/ng-bootstrap tinymce @tinymce/tinymce-angular axios case jquery @ordercloud/headstart-sdk ordercloud-javascript-sdk ngx-spinner -
In your module import either
CmsAdminModulefor access to admin/buyer components orCmsBuyerModulefor just the buyer components. Here we're registeringCmsAdminModulefor access to all componentsimport { CmsAdminModule, Configuration } from '@ordercloud/angular-cms-components'; @NgModule({ declarations: [...], imports: [ CmsAdminModule, ... ], providers: [...], bootstrap: [AppComponent] }) export class AppModule {}
If your app uses the shared module pattern you'll want to import it in your shared module instead (don't forget to export it as well)
import { CmsAdminModule, Configuration } from '@ordercloud/angular-cms-components'; @NgModule({ declarations: [...], imports: [ CmsAdminModule, ... ], exports: [ CmsAdminModule, ... ], providers: [...], }) export class SharedModule {}
-
In angular.json add an entry to the assets array
{"glob": "**/*","input": "node_modules/tinymce","output": "/tinymce/"}
-
In the root of your app import tinymce and the ordercloud plugin for tinymce
-
import 'tinymce/tinymce'; import '@ordercloud/angular-cms-components/plugin.min.js';
-
Now you can use any of the components in your application
Assuming you are a maintainer you can follow these instructions to release a new version of the library.
- Add and commit your changes
- Run
npm run buildto build docs - Verify the version has been bumped and adheres to semantic versioning.
- Version should be updated in both package.json and projects/lib/package.json.
- Version update should be its own commit
- Use following format for the commmit:
:bookmark: {VERSION}
- Push changes to master
- Create and publish a new release on github
- Publish on npm by running
npm run publish-please- Defaults to pre-release. It is recommended to do a pre-release first to vet changes
- For normal releases update the
publishTagin.publishrctolatestand then runnpm run publish-please
- Have a beer!
If you need to override publish-please and just use npm publish you can do so by first removing "prepublishOnly": "publish-please guard" from package.json and then running npm publish
- To start, clone the repo.
- Next, you need to set the token, manually. Login to OC Portal and impersonate the user whose context you are using for development.
- With the
Networktab open, send a/merequest and view theAuthorizationfield within the Headers section. - Copy the token after "Bearer".
- Now navigate to line 10 in storybook-base-configuration.ts and replace the existing token. Keep in mind: this token will expire, so you will need to repeat this process.