;
- public showCopyLinkHintTimeout?: ReturnType;
public form: FormGroup | null = null;
public model$ = this.state.select();
public project$ = this.store.select(selectCurrentProject);
- public get getCurrentViewTranslation() {
- const index = this.storyViewOptions.findIndex(
- (it) => it.id === this.state.get('selectedStoryView')
- );
-
- if (index !== -1) {
- return this.storyViewOptions[index].translation;
- }
-
- return '';
- }
-
constructor(
private cd: ChangeDetectorRef,
private store: Store,
- private clipboard: Clipboard,
private location: Location,
private permissionService: PermissionsService,
private wsService: WsService,
@@ -463,87 +421,6 @@ export class StoryDetailComponent {
}
}
- public trackByIndex(index: number) {
- return index;
- }
-
- public selectStoryView(id: StoryView) {
- this.dropdownState = false;
- this.store.dispatch(
- StoryDetailActions.updateStoryViewMode({
- storyView: id,
- previousStoryView: this.state.get('selectedStoryView'),
- })
- );
-
- // reset state to prevent focus on navigation arrows
- this.location.replaceState(this.location.path(), undefined, {});
- }
-
- public displayHint() {
- this.showCopyLinkHintTimeout = setTimeout(() => {
- this.hintShown = true;
- this.cd.detectChanges();
- }, 200);
- }
-
- public getStoryLink() {
- this.clipboard.copy(window.location.href);
-
- this.linkCopied = true;
- }
-
- public resetCopyLink(type: 'fast' | 'slow') {
- if (this.showCopyLinkHintTimeout) {
- clearTimeout(this.showCopyLinkHintTimeout);
- }
-
- if (this.linkCopied) {
- const time = type === 'fast' ? 200 : 4000;
- this.resetCopyLinkTimeout = setTimeout(() => {
- this.hintShown = false;
- this.linkCopied = false;
- this.cd.detectChanges();
- }, time);
- } else {
- this.hintShown = false;
- }
- }
-
- public navigateToNextStory(ref: number) {
- void this.router.navigate(
- [
- 'project',
- this.state.get('project').id,
- this.state.get('project').slug,
- 'stories',
- ref,
- ],
- {
- state: {
- nextStoryNavigation: true,
- },
- }
- );
- }
-
- public navigateToPreviousStory(ref: number) {
- void this.router.navigate(
- [
- 'project',
- this.state.get('project').id,
- this.state.get('project').slug,
- 'stories',
- ref,
- ],
- {
- state: {
- previousStoryNavigation: true,
- },
- }
- );
- }
-
public closeStory() {
const ref = this.state.get('story').ref;
@@ -585,8 +462,7 @@ export class StoryDetailComponent {
this.showDeleteStoryConfirm = false;
}
- public deleteStoryConfirmModal() {
- this.storyOptionsState = false;
+ public showDeleteConfirm() {
this.showDeleteStoryConfirm = true;
}