Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/app/features/project/settings/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export { ProjectSettingNotificationsComponent } from './project-setting-notifica
export { SettingsAccessRequestsCardComponent } from './settings-access-requests-card/settings-access-requests-card.component';
export { SettingsProjectAffiliationComponent } from './settings-project-affiliation/settings-project-affiliation.component';
export { SettingsProjectFormCardComponent } from './settings-project-form-card/settings-project-form-card.component';
export { SettingsRedirectLinkComponent } from './settings-redirect-link/settings-redirect-link.component';
export { SettingsStorageLocationCardComponent } from './settings-storage-location-card/settings-storage-location-card.component';
export { SettingsViewOnlyLinksCardComponent } from './settings-view-only-links-card/settings-view-only-links-card.component';
export { SettingsWikiCardComponent } from './settings-wiki-card/settings-wiki-card.component';

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/app/features/project/settings/mappers/settings.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export class SettingsMapper {
accessRequestsEnabled: result.attributes.access_requests_enabled,
anyoneCanComment: result.attributes.anyone_can_comment,
anyoneCanEditWiki: result.attributes.anyone_can_edit_wiki,
redirectLinkEnabled: result.attributes.redirect_link_enabled,
redirectLinkLabel: result.attributes.redirect_link_label,
redirectLinkUrl: result.attributes.redirect_link_url,
wikiEnabled: result.attributes.wiki_enabled,
},
} as ProjectSettingsModel;
Expand Down
2 changes: 0 additions & 2 deletions src/app/features/project/settings/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ export * from './project-details.model';
export * from './project-details-json-api.model';
export * from './project-settings.model';
export * from './project-settings-response.model';
export * from './redirect-link-data.model';
export * from './redirect-link-form.model';
export * from './right-control.model';
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ export interface ProjectSettingsAttributes {
anyone_can_comment: boolean;
anyone_can_edit_wiki: boolean;
wiki_enabled: boolean;
redirect_link_enabled: boolean;
redirect_link_url: string;
redirect_link_label: string;
}

export interface RelatedLink {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ export interface ProjectSettingsModel {
accessRequestsEnabled: boolean;
anyoneCanComment: boolean;
anyoneCanEditWiki: boolean;
redirectLinkEnabled: boolean;
redirectLinkLabel: string;
redirectLinkUrl: string;
wikiEnabled: boolean;
};
lastFetched?: number;
Expand Down

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions src/app/features/project/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
[notifications]="notifications()"
/>

<osf-settings-redirect-link
(redirectUrlDataChange)="onRedirectUrlDataRequestChange($event)"
[redirectUrlDataInput]="redirectUrlData()"
/>

<osf-settings-project-affiliation
[affiliations]="projectDetails().affiliatedInstitutions"
(removed)="removeAffiliation($event)"
Expand Down
26 changes: 2 additions & 24 deletions src/app/features/project/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ import {
SettingsAccessRequestsCardComponent,
SettingsProjectAffiliationComponent,
SettingsProjectFormCardComponent,
SettingsRedirectLinkComponent,
SettingsStorageLocationCardComponent,
SettingsViewOnlyLinksCardComponent,
SettingsWikiCardComponent,
} from './components';
import { ProjectDetailsModel, ProjectSettingsAttributes, ProjectSettingsData, RedirectLinkDataModel } from './models';
import { ProjectDetailsModel, ProjectSettingsAttributes, ProjectSettingsData } from './models';
import {
DeleteInstitution,
DeleteProject,
Expand All @@ -50,7 +49,6 @@ import {
SettingsViewOnlyLinksCardComponent,
SettingsAccessRequestsCardComponent,
SettingsWikiCardComponent,
SettingsRedirectLinkComponent,
SettingsProjectAffiliationComponent,
ProjectSettingNotificationsComponent,
LoadingSpinnerComponent,
Expand Down Expand Up @@ -89,7 +87,6 @@ export class SettingsComponent implements OnInit {
deleteInstitution: DeleteInstitution,
});

redirectUrlData = signal<RedirectLinkDataModel>({ isEnabled: false, url: '', label: '' });
accessRequest = signal(false);
wikiEnabled = signal(false);
anyoneCanEditWiki = signal(false);
Expand Down Expand Up @@ -146,11 +143,6 @@ export class SettingsComponent implements OnInit {
this.syncSettingsChanges('anyone_can_edit_wiki', newValue);
}

onRedirectUrlDataRequestChange(data: RedirectLinkDataModel): void {
this.redirectUrlData.set(data);
this.syncSettingsChanges('redirectUrl', data);
}

onNotificationRequestChange(data: { event: SubscriptionEvent; frequency: SubscriptionFrequency }): void {
const id = `${this.projectId()}_${data.event}`;
const frequency = data.frequency;
Expand Down Expand Up @@ -208,24 +200,16 @@ export class SettingsComponent implements OnInit {
});
}

private syncSettingsChanges(changedField: string, value: boolean | RedirectLinkDataModel): void {
private syncSettingsChanges(changedField: string, value: boolean): void {
const payload: Partial<ProjectSettingsAttributes> = {};

switch (changedField) {
case 'access_requests_enabled':
case 'wiki_enabled':
case 'redirect_link_enabled':
case 'anyone_can_edit_wiki':
case 'anyone_can_comment':
payload[changedField] = value as boolean;
break;
case 'redirectUrl':
if (typeof value === 'object') {
payload['redirect_link_enabled'] = value.isEnabled;
payload['redirect_link_url'] = value.isEnabled ? value.url : undefined;
payload['redirect_link_label'] = value.isEnabled ? value.label : undefined;
}
break;
}

const model = {
Expand All @@ -251,12 +235,6 @@ export class SettingsComponent implements OnInit {
this.wikiEnabled.set(settings.attributes.wikiEnabled);
this.anyoneCanEditWiki.set(settings.attributes.anyoneCanEditWiki);
this.anyoneCanComment.set(settings.attributes.anyoneCanComment);

this.redirectUrlData.set({
isEnabled: settings.attributes.redirectLinkEnabled,
url: settings.attributes.redirectLinkUrl,
label: settings.attributes.redirectLinkLabel,
});
}
});

Expand Down
3 changes: 0 additions & 3 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,6 @@
"wikiConfigureText": "Create a link to share this project so those who have the link can view—but not edit—the project.",
"emailNotifications": "Email Notifications",
"emailNotificationsText": "These notification settings only apply to you. They do NOT affect any other contributor on this project.",
"redirectLink": "Redirect Link",
"redirectLinkText": "Redirect visitors from your project page to an external webpage",
"projectAffiliation": "Project Affiliation / Branding",
"projectsCanBeAffiliated": "Projects can be affiliated with institutions that have created OSF for Institutions accounts. This allows:",
"institutionalLogos": "institutional logos to be displayed on public projects",
Expand All @@ -422,7 +420,6 @@
"url": "URL",
"label": "Label",
"storageLocationMessage": "Storage location cannot be changed after project is created.",
"redirectUrlPlaceholder": "Send people who visit your OSF project page to this link instead",
"invalidUrl": "Please enter a valid URL, such as: https://example.com",
"disabledForWiki": "This feature is disabled for wikis of private projects.",
"enabledForWiki": "This feature is enabled for wikis of private projects.",
Expand Down
Loading