Skip to content

Commit

Permalink
No Jira Rename tools to content and update the readme (#705)
Browse files Browse the repository at this point in the history
Rename tools to content and update the readme
  • Loading branch information
caleballdrin authored Mar 1, 2024
1 parent 285c823 commit 45becd0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# MobileContentAdmin [![Build Status](https://travis-ci.org/CruGlobal/mobile-content-admin.svg?branch=master)](https://travis-ci.org/CruGlobal/mobile-content-admin) [![codecov](https://codecov.io/gh/CruGlobal/mobile-content-admin/branch/master/graph/badge.svg)](https://codecov.io/gh/CruGlobal/mobile-content-admin)


This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.2.7.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
Run `yarn start` for a dev server. Navigate to `http://localhost:8080/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
Run `yarn build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
Run `yarn test` to execute the unit tests via [Karma](https://karma-runner.github.io).
If you want to only run a single test on a file, change the file's root `describe` to `fdescribe` and Jamsine will only test that file.

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Run `yarn e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Further help
Expand Down
14 changes: 7 additions & 7 deletions src/app/components/resources/resources.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="card mb-2">
<div class="card-header">
<span class="h3">Tools</span>
<span class="h3">Content</span>
<div class="float-right">
<button (click)="openCreateModal()" class="btn btn-secondary mx-1">
<i class="fa fa-plus"></i> Add New Tool
<i class="fa fa-plus"></i> Add New Content
</button>
<button
type="button"
Expand Down Expand Up @@ -160,7 +160,7 @@ <h6 class="dropdown-header">OTHER</h6>
ngbDropdownToggle
style="font-style: italic"
>
{{ sortOrder == 'tool' ? 'Tool Order' : 'Alphabetical' }}
{{ sortOrder == 'content' ? 'Content Order' : 'Alphabetical' }}
</button>
<div
class="dropdown-menu"
Expand All @@ -170,16 +170,16 @@ <h6 class="dropdown-header">OTHER</h6>
<button
(click)="updateSort('alphabetical')"
class="filter-dropdown-button btn-sm"
[ngClass]="sortOrder != 'tool' ? 'bg-secondary text-light' : ''"
[ngClass]="sortOrder != 'content' ? 'bg-secondary text-light' : ''"
>
Alphabetical
</button>
<button
(click)="updateSort('tool')"
(click)="updateSort('content')"
class="filter-dropdown-button"
[ngClass]="sortOrder == 'tool' ? 'bg-secondary text-light' : ''"
[ngClass]="sortOrder == 'content' ? 'bg-secondary text-light' : ''"
>
Tool Order
Content Order
</button>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/resources/resources.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ describe('ResourcesComponent', () => {
done();
});
});
it('should sort by tool order', (done) => {
it('should sort by content order', (done) => {
comp.unfilteredResources = unfilteredResources;
comp.updateSort('tool');
comp.updateSort('content');

setTimeout(() => {
expect(comp.resources[0].name).toEqual(
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/resources/resources.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ export class ResourcesComponent implements OnInit {
})
: this.unfilteredResources;

if (this.sortOrder === 'tool') {
if (this.sortOrder === 'content') {
this.resources.sort(
(a, b) =>
(a['attr-default-order'] || 100) - (b['attr-default-order'] || 100),
(a['attr-default-order'] || 1000) - (b['attr-default-order'] || 1000),
);
}
}
Expand Down

0 comments on commit 45becd0

Please sign in to comment.