Skip to content

Commit

Permalink
Merge branch 'develop' into search-deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda authored Oct 23, 2023
2 parents 53e2a9d + e41d1ad commit 048a8cb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/settings/tokens/-components/edit-form/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export default class TokenForm extends Component {
@action
async deleteToken() {
try {
await this.token!.destroyRecord();
this.token!.deleteRecord();
await this.token.save();
this.toast.success(this.intl.t('settings.tokens.deleted'));
this.router.transitionTo('settings.tokens');
} catch {
Expand Down
2 changes: 1 addition & 1 deletion app/settings/tokens/edit/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class SettingsTokensEditController extends Controller {
token?: Token;

@action
refresh() {
refreshToken() {
this.clearTokenValue();

// Send action to route
Expand Down
10 changes: 6 additions & 4 deletions app/settings/tokens/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@
{{t 'settings.tokens.createSuccess.instructions'}}
</p>
<Button
{{on 'click' (action this.refresh)}}
{{on 'click' (action this.refreshToken)}}
>
{{t 'settings.tokens.createSuccess.editScopes'}}
</Button>
{{else}}
<h4>{{t 'settings.tokens.editToken'}}</h4>

{{#if this.model.taskInstance.isError}}
{{this.model.taskInstance.error}}
{{else}}
{{#if this.model.taskInstance.isRunning}}
<LoadingIndicator @dark={{true}} />
{{else if this.model.taskInstance.isSuccessful}}
<Settings::Tokens::-Components::EditForm
@token={{this.token}}
/>
{{else}}
{{this.model.taskInstance.error}}
{{/if}}
{{/if}}
</div>
4 changes: 3 additions & 1 deletion lib/osf-components/addon/components/search-page/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ interface ResourceTypeOption {
value?: ResourceTypeFilterValue | null;
}

export const CARD_SEARCH_TEXT_PARAM = 'cardSearchText[*,creator.name,isContainedBy.creator.name]';

export enum ResourceTypeFilterValue {
Registrations = 'Registration,RegistrationComponent',
Projects = 'Project,ProjectComponent',
Expand Down Expand Up @@ -237,7 +239,7 @@ export default class SearchPage extends Component<SearchArgs> {
}
this.filterQueryObject = filterQueryObject;
const searchResult = await this.store.queryRecord('index-card-search', {
'cardSearchText[*,creator.name,isContainedBy.creator.name]': cardSearchText,
[CARD_SEARCH_TEXT_PARAM]: cardSearchText,
'page[cursor]': page,
sort,
cardSearchFilter: filterQueryObject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import RelatedPropertyPathModel from 'ember-osf-web/models/related-property-path

import SearchResultModel from 'ember-osf-web/models/search-result';

import { Filter } from '../component';
import { Filter, CARD_SEARCH_TEXT_PARAM } from '../component';

interface FakeIndexCard {
resourceId: string;
Expand Down Expand Up @@ -123,7 +123,7 @@ export default class FilterFacet extends Component<FilterFacetArgs> {
return; // skip fetching
}
const valueSearch = await this.store.queryRecord('index-value-search', {
cardSearchText,
[CARD_SEARCH_TEXT_PARAM]: cardSearchText,
cardSearchFilter,
valueSearchPropertyPath: property.propertyPathKey,
valueSearchText: filterString || '',
Expand Down

0 comments on commit 048a8cb

Please sign in to comment.