mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
Repository export read-only lock (#1519)
* Lock repository for read-only access only while exporting * Create read-only check api Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
This commit is contained in:
@@ -48475,7 +48475,7 @@ exports[`Storyshots RepositoryEntry Archived 1`] = `
|
||||
</strong>
|
||||
|
||||
<span
|
||||
className="RepositoryEntry__ArchiveTag-sc-6jys82-0 lgBbpU"
|
||||
className="RepositoryEntry__RepositoryTag-sc-6jys82-0 cFBCjw"
|
||||
title="archive.tooltip"
|
||||
>
|
||||
repository.archived
|
||||
@@ -49023,6 +49023,314 @@ exports[`Storyshots RepositoryEntry Default 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Storyshots RepositoryEntry Exporting 1`] = `
|
||||
<div
|
||||
className="RepositoryEntrystories__Spacing-toppdg-0 iIzVNZ box box-link-shadow"
|
||||
>
|
||||
<a
|
||||
className="overlay-column"
|
||||
href="/repo/hitchhiker/heartOfGold"
|
||||
onClick={[Function]}
|
||||
/>
|
||||
<article
|
||||
className="CardColumn__NoEventWrapper-sc-1w6lsih-0 eUWboI media"
|
||||
>
|
||||
<figure
|
||||
className="CardColumn__AvatarWrapper-sc-1w6lsih-1 lhzEPm media-left"
|
||||
>
|
||||
<p
|
||||
className="image is-64x64"
|
||||
>
|
||||
<img
|
||||
alt="Logo"
|
||||
src="test-file-stub"
|
||||
/>
|
||||
</p>
|
||||
</figure>
|
||||
<div
|
||||
className="CardColumn__FlexFullHeight-sc-1w6lsih-2 hWRPir media-content text-box is-flex"
|
||||
>
|
||||
<div
|
||||
className="is-flex"
|
||||
>
|
||||
<div
|
||||
className="CardColumn__ContentLeft-sc-1w6lsih-4 iRVRBC content"
|
||||
>
|
||||
<p
|
||||
className="shorten-text is-marginless"
|
||||
>
|
||||
<strong>
|
||||
heartOfGold
|
||||
</strong>
|
||||
|
||||
<span
|
||||
className="RepositoryEntry__RepositoryTag-sc-6jys82-0 cFBCjw"
|
||||
title="exporting.tooltip"
|
||||
>
|
||||
repository.exporting
|
||||
</span>
|
||||
</p>
|
||||
<p
|
||||
className="shorten-text"
|
||||
>
|
||||
The starship Heart of Gold was the first spacecraft to make use of the Infinite Improbability Drive
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="CardColumn__FooterWrapper-sc-1w6lsih-3 hzknmV level is-flex"
|
||||
>
|
||||
<div
|
||||
className="CardColumn__RightMarginDiv-sc-1w6lsih-6 bnJfDV level-left is-hidden-mobile"
|
||||
>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/branches/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.branches"
|
||||
>
|
||||
<i
|
||||
className="fas fa-code-branch has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/tags/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.tags"
|
||||
>
|
||||
<i
|
||||
className="fas fa-tags has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/code/changesets/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.commits"
|
||||
>
|
||||
<i
|
||||
className="fas fa-exchange-alt has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/code/sources/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.sources"
|
||||
>
|
||||
<i
|
||||
className="fas fa-code has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/settings/general"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.settings"
|
||||
>
|
||||
<i
|
||||
className="fas fa-cog has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
className="CardColumn__InheritFlexShrinkDiv-sc-1w6lsih-7 kdhCxo level-right is-block is-mobile is-marginless shorten-text"
|
||||
>
|
||||
<small
|
||||
className="level-item"
|
||||
>
|
||||
<time
|
||||
className="DateElement-sc-1schp8c-0 gkptML"
|
||||
title="2020-03-23 09:26:01"
|
||||
>
|
||||
3 days ago
|
||||
</time>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Storyshots RepositoryEntry MultiRepositoryTags 1`] = `
|
||||
<div
|
||||
className="RepositoryEntrystories__Spacing-toppdg-0 iIzVNZ box box-link-shadow"
|
||||
>
|
||||
<a
|
||||
className="overlay-column"
|
||||
href="/repo/hitchhiker/heartOfGold"
|
||||
onClick={[Function]}
|
||||
/>
|
||||
<article
|
||||
className="CardColumn__NoEventWrapper-sc-1w6lsih-0 eUWboI media"
|
||||
>
|
||||
<figure
|
||||
className="CardColumn__AvatarWrapper-sc-1w6lsih-1 lhzEPm media-left"
|
||||
>
|
||||
<p
|
||||
className="image is-64x64"
|
||||
>
|
||||
<img
|
||||
alt="Logo"
|
||||
src="test-file-stub"
|
||||
/>
|
||||
</p>
|
||||
</figure>
|
||||
<div
|
||||
className="CardColumn__FlexFullHeight-sc-1w6lsih-2 hWRPir media-content text-box is-flex"
|
||||
>
|
||||
<div
|
||||
className="is-flex"
|
||||
>
|
||||
<div
|
||||
className="CardColumn__ContentLeft-sc-1w6lsih-4 iRVRBC content"
|
||||
>
|
||||
<p
|
||||
className="shorten-text is-marginless"
|
||||
>
|
||||
<strong>
|
||||
heartOfGold
|
||||
</strong>
|
||||
|
||||
<span
|
||||
className="RepositoryEntry__RepositoryTag-sc-6jys82-0 cFBCjw"
|
||||
title="archive.tooltip"
|
||||
>
|
||||
repository.archived
|
||||
</span>
|
||||
<span
|
||||
className="RepositoryEntry__RepositoryTag-sc-6jys82-0 cFBCjw"
|
||||
title="exporting.tooltip"
|
||||
>
|
||||
repository.exporting
|
||||
</span>
|
||||
</p>
|
||||
<p
|
||||
className="shorten-text"
|
||||
>
|
||||
The starship Heart of Gold was the first spacecraft to make use of the Infinite Improbability Drive
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="CardColumn__FooterWrapper-sc-1w6lsih-3 hzknmV level is-flex"
|
||||
>
|
||||
<div
|
||||
className="CardColumn__RightMarginDiv-sc-1w6lsih-6 bnJfDV level-left is-hidden-mobile"
|
||||
>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/branches/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.branches"
|
||||
>
|
||||
<i
|
||||
className="fas fa-code-branch has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/tags/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.tags"
|
||||
>
|
||||
<i
|
||||
className="fas fa-tags has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/code/changesets/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.commits"
|
||||
>
|
||||
<i
|
||||
className="fas fa-exchange-alt has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/code/sources/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.sources"
|
||||
>
|
||||
<i
|
||||
className="fas fa-code has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 iZuqoP level-item"
|
||||
href="/repo/hitchhiker/heartOfGold/settings/general"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<span
|
||||
className="tooltip has-tooltip-top"
|
||||
data-tooltip="repositoryRoot.tooltip.settings"
|
||||
>
|
||||
<i
|
||||
className="fas fa-cog has-text-inherit fa-lg"
|
||||
/>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
className="CardColumn__InheritFlexShrinkDiv-sc-1w6lsih-7 kdhCxo level-right is-block is-mobile is-marginless shorten-text"
|
||||
>
|
||||
<small
|
||||
className="level-item"
|
||||
>
|
||||
<time
|
||||
className="DateElement-sc-1schp8c-0 gkptML"
|
||||
title="2020-03-23 09:26:01"
|
||||
>
|
||||
3 days ago
|
||||
</time>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Storyshots RepositoryEntry Quick Link EP 1`] = `
|
||||
<div
|
||||
className="RepositoryEntrystories__Spacing-toppdg-0 iIzVNZ box box-link-shadow"
|
||||
|
||||
@@ -75,6 +75,8 @@ const QuickLink = (
|
||||
);
|
||||
|
||||
const archivedRepository = { ...repository, archived: true };
|
||||
const exportingRepository = { ...repository, exporting: true };
|
||||
const archivedExportingRepository = { ...repository, archived: true, exporting: true };
|
||||
|
||||
storiesOf("RepositoryEntry", module)
|
||||
.addDecorator((story) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
|
||||
@@ -101,4 +103,14 @@ storiesOf("RepositoryEntry", module)
|
||||
const binder = new Binder("title");
|
||||
bindAvatar(binder, Git);
|
||||
return withBinder(binder, archivedRepository);
|
||||
})
|
||||
.add("Exporting", () => {
|
||||
const binder = new Binder("title");
|
||||
bindAvatar(binder, Git);
|
||||
return withBinder(binder, exportingRepository);
|
||||
})
|
||||
.add("MultiRepositoryTags", () => {
|
||||
const binder = new Binder("title");
|
||||
bindAvatar(binder, Git);
|
||||
return withBinder(binder, archivedExportingRepository);
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ type Props = WithTranslation & {
|
||||
baseDate?: DateProp;
|
||||
};
|
||||
|
||||
const ArchiveTag = styled.span`
|
||||
const RepositoryTag = styled.span`
|
||||
margin-left: 0.2rem;
|
||||
background-color: #9a9a9a;
|
||||
padding: 0.25rem;
|
||||
@@ -145,13 +145,19 @@ class RepositoryEntry extends React.Component<Props> {
|
||||
|
||||
createTitle = () => {
|
||||
const { repository, t } = this.props;
|
||||
const archivedFlag = repository.archived && (
|
||||
<ArchiveTag title={t("archive.tooltip")}>{t("repository.archived")}</ArchiveTag>
|
||||
);
|
||||
const repositoryFlags = [];
|
||||
if (repository.archived) {
|
||||
repositoryFlags.push(<RepositoryTag title={t("archive.tooltip")}>{t("repository.archived")}</RepositoryTag>);
|
||||
}
|
||||
|
||||
if (repository.exporting) {
|
||||
repositoryFlags.push(<RepositoryTag title={t("exporting.tooltip")}>{t("repository.exporting")}</RepositoryTag>);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ExtensionPoint name="repository.card.beforeTitle" props={{ repository }} />
|
||||
<strong>{repository.name}</strong> {archivedFlag}
|
||||
<strong>{repository.name}</strong> {repositoryFlags.map(flag => flag)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user