mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Changed auth-status model: ssoLoginUrl: string
This commit is contained in:
16
e2e/app.e2e-spec.js
Normal file
16
e2e/app.e2e-spec.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ProtractorPage } from './app.po';
|
||||
describe('protractor App', function () {
|
||||
var page;
|
||||
beforeEach(function () {
|
||||
page = new ProtractorPage();
|
||||
});
|
||||
it('should display translated title "DSpace Angular :: Home"', function () {
|
||||
page.navigateTo();
|
||||
expect(page.getPageTitleText()).toEqual('DSpace Angular :: Home');
|
||||
});
|
||||
it('should contain a news section', function () {
|
||||
page.navigateTo();
|
||||
expect(page.getHomePageNewsText()).toBeDefined();
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=app.e2e-spec.js.map
|
1
e2e/app.e2e-spec.js.map
Normal file
1
e2e/app.e2e-spec.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"app.e2e-spec.js","sourceRoot":"","sources":["app.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,QAAQ,CAAC,gBAAgB,EAAE;IACzB,IAAI,IAAoB,CAAC;IAEzB,UAAU,CAAC;QACT,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE;QAC7D,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE;QAClC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
17
e2e/app.po.js
Normal file
17
e2e/app.po.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { browser, element, by } from 'protractor';
|
||||
var ProtractorPage = /** @class */ (function () {
|
||||
function ProtractorPage() {
|
||||
}
|
||||
ProtractorPage.prototype.navigateTo = function () {
|
||||
return browser.get('/');
|
||||
};
|
||||
ProtractorPage.prototype.getPageTitleText = function () {
|
||||
return browser.getTitle();
|
||||
};
|
||||
ProtractorPage.prototype.getHomePageNewsText = function () {
|
||||
return element(by.xpath('//ds-home-news')).getText();
|
||||
};
|
||||
return ProtractorPage;
|
||||
}());
|
||||
export { ProtractorPage };
|
||||
//# sourceMappingURL=app.po.js.map
|
1
e2e/app.po.js.map
Normal file
1
e2e/app.po.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"app.po.js","sourceRoot":"","sources":["app.po.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAElD;IAAA;IAYA,CAAC;IAXC,mCAAU,GAAV;QACE,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED,yCAAgB,GAAhB;QACE,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;IAED,4CAAmB,GAAnB;QACE,OAAO,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACvD,CAAC;IACH,qBAAC;AAAD,CAAC,AAZD,IAYC"}
|
16
e2e/pagenotfound/pagenotfound.e2e-spec.js
Normal file
16
e2e/pagenotfound/pagenotfound.e2e-spec.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ProtractorPage } from './pagenotfound.po';
|
||||
describe('protractor PageNotFound', function () {
|
||||
var page;
|
||||
beforeEach(function () {
|
||||
page = new ProtractorPage();
|
||||
});
|
||||
it('should contain element ds-pagenotfound when navigating to page that doesnt exist', function () {
|
||||
page.navigateToNonExistingPage();
|
||||
expect(page.elementTagExists('ds-pagenotfound')).toEqual(true);
|
||||
});
|
||||
it('should not contain element ds-pagenotfound when navigating to existing page', function () {
|
||||
page.navigateToExistingPage();
|
||||
expect(page.elementTagExists('ds-pagenotfound')).toEqual(false);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=pagenotfound.e2e-spec.js.map
|
1
e2e/pagenotfound/pagenotfound.e2e-spec.js.map
Normal file
1
e2e/pagenotfound/pagenotfound.e2e-spec.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pagenotfound.e2e-spec.js","sourceRoot":"","sources":["pagenotfound.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,QAAQ,CAAC,yBAAyB,EAAE;IAClC,IAAI,IAAoB,CAAC;IAEzB,UAAU,CAAC;QACT,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kFAAkF,EAAE;QACrF,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,MAAM,CAAM,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6EAA6E,EAAE;QAChF,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,MAAM,CAAM,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
19
e2e/pagenotfound/pagenotfound.po.js
Normal file
19
e2e/pagenotfound/pagenotfound.po.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { browser, element, by } from 'protractor';
|
||||
var ProtractorPage = /** @class */ (function () {
|
||||
function ProtractorPage() {
|
||||
this.HOMEPAGE = '/home';
|
||||
this.NONEXISTINGPAGE = '/e9019a69-d4f1-4773-b6a3-bd362caa46f2';
|
||||
}
|
||||
ProtractorPage.prototype.navigateToNonExistingPage = function () {
|
||||
return browser.get(this.NONEXISTINGPAGE);
|
||||
};
|
||||
ProtractorPage.prototype.navigateToExistingPage = function () {
|
||||
return browser.get(this.HOMEPAGE);
|
||||
};
|
||||
ProtractorPage.prototype.elementTagExists = function (tag) {
|
||||
return element(by.tagName(tag)).isPresent();
|
||||
};
|
||||
return ProtractorPage;
|
||||
}());
|
||||
export { ProtractorPage };
|
||||
//# sourceMappingURL=pagenotfound.po.js.map
|
1
e2e/pagenotfound/pagenotfound.po.js.map
Normal file
1
e2e/pagenotfound/pagenotfound.po.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pagenotfound.po.js","sourceRoot":"","sources":["pagenotfound.po.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAElD;IAAA;QACE,aAAQ,GAAG,OAAO,CAAC;QACnB,oBAAe,GAAG,uCAAuC,CAAC;IAa5D,CAAC;IAXC,kDAAyB,GAAzB;QACE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC3C,CAAC;IACD,+CAAsB,GAAtB;QACE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,yCAAgB,GAAhB,UAAiB,GAAW;QAC1B,OAAO,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IAC9C,CAAC;IAEH,qBAAC;AAAD,CAAC,AAfD,IAeC"}
|
47
e2e/search-page/search-page.e2e-spec.js
Normal file
47
e2e/search-page/search-page.e2e-spec.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import { ProtractorPage } from './search-page.po';
|
||||
import { browser } from 'protractor';
|
||||
describe('protractor SearchPage', function () {
|
||||
var page;
|
||||
beforeEach(function () {
|
||||
page = new ProtractorPage();
|
||||
});
|
||||
it('should contain query value when navigating to page with query parameter', function () {
|
||||
var queryString = 'Interesting query string';
|
||||
page.navigateToSearchWithQueryParameter(queryString);
|
||||
page.getCurrentQuery().then(function (query) {
|
||||
expect(query).toEqual(queryString);
|
||||
});
|
||||
});
|
||||
it('should have right scope selected when navigating to page with scope parameter', function () {
|
||||
var scope = page.getRandomScopeOption();
|
||||
scope.then(function (scopeString) {
|
||||
page.navigateToSearchWithScopeParameter(scopeString);
|
||||
page.getCurrentScope().then(function (s) {
|
||||
expect(s).toEqual(scopeString);
|
||||
});
|
||||
});
|
||||
});
|
||||
it('should redirect to the correct url when scope was set and submit button was triggered', function () {
|
||||
var scope = page.getRandomScopeOption();
|
||||
scope.then(function (scopeString) {
|
||||
page.setCurrentScope(scopeString);
|
||||
page.submitSearchForm();
|
||||
browser.wait(function () {
|
||||
return browser.getCurrentUrl().then(function (url) {
|
||||
return url.indexOf('scope=' + encodeURI(scopeString)) !== -1;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
it('should redirect to the correct url when query was set and submit button was triggered', function () {
|
||||
var queryString = 'Another interesting query string';
|
||||
page.setCurrentQuery(queryString);
|
||||
page.submitSearchForm();
|
||||
browser.wait(function () {
|
||||
return browser.getCurrentUrl().then(function (url) {
|
||||
return url.indexOf('query=' + encodeURI(queryString)) !== -1;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=search-page.e2e-spec.js.map
|
1
e2e/search-page/search-page.e2e-spec.js.map
Normal file
1
e2e/search-page/search-page.e2e-spec.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"search-page.e2e-spec.js","sourceRoot":"","sources":["search-page.e2e-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,YA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AAC,KAAK,CAAC,CAAC,CAAC;gBAC/D,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uFAAuF,EAAE;QAC1F,IAAM,WAAW,GAAG,kCAAkC,CAAC;QACvD,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAClC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,OAAO,CAAC,IAAI,CAAC;YACX,OAAO,OAAO,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,UAAC,GAAW;gBAC9C,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
42
e2e/search-page/search-page.po.js
Normal file
42
e2e/search-page/search-page.po.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import { browser, element, by, protractor } from 'protractor';
|
||||
var ProtractorPage = /** @class */ (function () {
|
||||
function ProtractorPage() {
|
||||
this.SEARCH = '/search';
|
||||
}
|
||||
ProtractorPage.prototype.navigateToSearch = function () {
|
||||
return browser.get(this.SEARCH);
|
||||
};
|
||||
ProtractorPage.prototype.navigateToSearchWithQueryParameter = function (query) {
|
||||
return browser.get(this.SEARCH + '?query=' + query);
|
||||
};
|
||||
ProtractorPage.prototype.navigateToSearchWithScopeParameter = function (scope) {
|
||||
return browser.get(this.SEARCH + '?scope=' + scope);
|
||||
};
|
||||
ProtractorPage.prototype.getCurrentScope = function () {
|
||||
var scopeSelect = element(by.css('#search-form select'));
|
||||
browser.wait(protractor.ExpectedConditions.presenceOf(scopeSelect), 10000);
|
||||
return scopeSelect.getAttribute('value');
|
||||
};
|
||||
ProtractorPage.prototype.getCurrentQuery = function () {
|
||||
return element(by.css('#search-form input')).getAttribute('value');
|
||||
};
|
||||
ProtractorPage.prototype.setCurrentScope = function (scope) {
|
||||
element(by.css('option[value="' + scope + '"]')).click();
|
||||
};
|
||||
ProtractorPage.prototype.setCurrentQuery = function (query) {
|
||||
element(by.css('input[name="query"]')).sendKeys(query);
|
||||
};
|
||||
ProtractorPage.prototype.submitSearchForm = function () {
|
||||
element(by.css('button.search-button')).click();
|
||||
};
|
||||
ProtractorPage.prototype.getRandomScopeOption = function () {
|
||||
var options = element(by.css('select[name="scope"]')).all(by.tagName('option'));
|
||||
return options.count().then(function (c) {
|
||||
var index = Math.floor(Math.random() * (c - 1));
|
||||
return options.get(index + 1).getAttribute('value');
|
||||
});
|
||||
};
|
||||
return ProtractorPage;
|
||||
}());
|
||||
export { ProtractorPage };
|
||||
//# sourceMappingURL=search-page.po.js.map
|
1
e2e/search-page/search-page.po.js.map
Normal file
1
e2e/search-page/search-page.po.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"search-page.po.js","sourceRoot":"","sources":["search-page.po.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG9D;IAAA;QACE,WAAM,GAAG,SAAS,CAAC;IA4CrB,CAAC;IA1CC,yCAAgB,GAAhB;QACE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,2DAAkC,GAAlC,UAAmC,KAAa;QAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,2DAAkC,GAAlC,UAAmC,KAAa;QAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,wCAAe,GAAf;QACE,IAAM,WAAW,GAAG,OAAO,CAAC,EAAE,CAAC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C,CAAC;IACL,CAAC;IAEH,qBAAC;AAAD,CAAC,AA7CD,IA6CC"}
|
@@ -0,0 +1,24 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { MetadataRegistryComponent } from './metadata-registry/metadata-registry.component';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component';
|
||||
import { BitstreamFormatsComponent } from './bitstream-formats/bitstream-formats.component';
|
||||
var AdminRegistriesRoutingModule = /** @class */ (function () {
|
||||
function AdminRegistriesRoutingModule() {
|
||||
}
|
||||
AdminRegistriesRoutingModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: 'metadata', component: MetadataRegistryComponent, data: { title: 'admin.registries.metadata.title' } },
|
||||
{ path: 'metadata/:schemaName', component: MetadataSchemaComponent, data: { title: 'admin.registries.schema.title' } },
|
||||
{ path: 'bitstream-formats', component: BitstreamFormatsComponent, data: { title: 'admin.registries.bitstream-formats.title' } },
|
||||
])
|
||||
]
|
||||
})
|
||||
], AdminRegistriesRoutingModule);
|
||||
return AdminRegistriesRoutingModule;
|
||||
}());
|
||||
export { AdminRegistriesRoutingModule };
|
||||
//# sourceMappingURL=admin-registries-routing.module.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"admin-registries-routing.module.js","sourceRoot":"","sources":["admin-registries-routing.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAW5F;IAAA;IAEA,CAAC;IAFY,4BAA4B;QATxC,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,YAAY,CAAC,QAAQ,CAAC;oBACpB,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,yBAAyB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,iCAAiC,EAAE,EAAE;oBAC9G,EAAE,IAAI,EAAE,sBAAsB,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,+BAA+B,EAAE,EAAE;oBACtH,EAAE,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAE,yBAAyB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,0CAA0C,EAAE,EAAE;iBACjI,CAAC;aACH;SACF,CAAC;OACW,4BAA4B,CAExC;IAAD,mCAAC;CAAA,AAFD,IAEC;SAFY,4BAA4B"}
|
38
src/app/+admin/admin-registries/admin-registries.module.js
Normal file
38
src/app/+admin/admin-registries/admin-registries.module.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MetadataRegistryComponent } from './metadata-registry/metadata-registry.component';
|
||||
import { AdminRegistriesRoutingModule } from './admin-registries-routing.module';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { BitstreamFormatsComponent } from './bitstream-formats/bitstream-formats.component';
|
||||
import { SharedModule } from '../../shared/shared.module';
|
||||
import { MetadataSchemaFormComponent } from './metadata-registry/metadata-schema-form/metadata-schema-form.component';
|
||||
import { MetadataFieldFormComponent } from './metadata-schema/metadata-field-form/metadata-field-form.component';
|
||||
var AdminRegistriesModule = /** @class */ (function () {
|
||||
function AdminRegistriesModule() {
|
||||
}
|
||||
AdminRegistriesModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
RouterModule,
|
||||
TranslateModule,
|
||||
AdminRegistriesRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
MetadataRegistryComponent,
|
||||
MetadataSchemaComponent,
|
||||
BitstreamFormatsComponent,
|
||||
MetadataSchemaFormComponent,
|
||||
MetadataFieldFormComponent
|
||||
],
|
||||
entryComponents: []
|
||||
})
|
||||
], AdminRegistriesModule);
|
||||
return AdminRegistriesModule;
|
||||
}());
|
||||
export { AdminRegistriesModule };
|
||||
//# sourceMappingURL=admin-registries.module.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"admin-registries.module.js","sourceRoot":"","sources":["admin-registries.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yEAAyE,CAAC;AACtH,OAAO,EAAC,0BAA0B,EAAC,MAAM,qEAAqE,CAAC;AAqB/G;IAAA;IAEA,CAAC;IAFY,qBAAqB;QAnBjC,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,YAAY;gBACZ,YAAY;gBACZ,YAAY;gBACZ,eAAe;gBACf,4BAA4B;aAC7B;YACD,YAAY,EAAE;gBACZ,yBAAyB;gBACzB,uBAAuB;gBACvB,yBAAyB;gBACzB,2BAA2B;gBAC3B,0BAA0B;aAC3B;YACD,eAAe,EAAE,EAEhB;SACF,CAAC;OACW,qBAAqB,CAEjC;IAAD,4BAAC;CAAA,AAFD,IAEC;SAFY,qBAAqB"}
|
@@ -0,0 +1,45 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { RegistryService } from '../../../core/registry/registry.service';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
/**
|
||||
* This component renders a list of bitstream formats
|
||||
*/
|
||||
var BitstreamFormatsComponent = /** @class */ (function () {
|
||||
function BitstreamFormatsComponent(registryService) {
|
||||
this.registryService = registryService;
|
||||
/**
|
||||
* The current pagination configuration for the page
|
||||
* Currently simply renders all bitstream formats
|
||||
*/
|
||||
this.config = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'registry-bitstreamformats-pagination',
|
||||
pageSize: 10000
|
||||
});
|
||||
this.updateFormats();
|
||||
}
|
||||
/**
|
||||
* When the page is changed, make sure to update the list of bitstreams to match the new page
|
||||
* @param event The page change event
|
||||
*/
|
||||
BitstreamFormatsComponent.prototype.onPageChange = function (event) {
|
||||
this.config.currentPage = event;
|
||||
this.updateFormats();
|
||||
};
|
||||
/**
|
||||
* Method to update the bitstream formats that are shown
|
||||
*/
|
||||
BitstreamFormatsComponent.prototype.updateFormats = function () {
|
||||
this.bitstreamFormats = this.registryService.getBitstreamFormats(this.config);
|
||||
};
|
||||
BitstreamFormatsComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-bitstream-formats',
|
||||
templateUrl: './bitstream-formats.component.html'
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [RegistryService])
|
||||
], BitstreamFormatsComponent);
|
||||
return BitstreamFormatsComponent;
|
||||
}());
|
||||
export { BitstreamFormatsComponent };
|
||||
//# sourceMappingURL=bitstream-formats.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bitstream-formats.component.js","sourceRoot":"","sources":["bitstream-formats.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAK1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAE3G;;GAEG;AAKH;IAgBE,mCAAoB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;QATpD;;;WAGG;QACH,WAAM,GAA+B,MAAM,CAAC,MAAM,CAAC,IAAI,0BAA0B,EAAE,EAAE;YACnF,EAAE,EAAE,sCAAsC;YAC1C,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;QAGD,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,gDAAY,GAAZ,UAAa,KAAK;QAChB,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACK,iDAAa,GAArB;QACE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChF,CAAC;IAlCU,yBAAyB;QAJrC,SAAS,CAAC;YACT,QAAQ,EAAE,sBAAsB;YAChC,WAAW,EAAE,oCAAoC;SAClD,CAAC;iDAiBqC,eAAe;OAhBzC,yBAAyB,CAmCrC;IAAD,gCAAC;CAAA,AAnCD,IAmCC;SAnCY,yBAAyB"}
|
@@ -0,0 +1,129 @@
|
||||
import { type } from '../../../shared/ngrx/type';
|
||||
/**
|
||||
* For each action type in an action group, make a simple
|
||||
* enum object for all of this group's action types.
|
||||
*
|
||||
* The 'type' utility function coerces strings into string
|
||||
* literal types and runs a simple check to guarantee all
|
||||
* action types in the application are unique.
|
||||
*/
|
||||
export var MetadataRegistryActionTypes = {
|
||||
EDIT_SCHEMA: type('dspace/metadata-registry/EDIT_SCHEMA'),
|
||||
CANCEL_EDIT_SCHEMA: type('dspace/metadata-registry/CANCEL_SCHEMA'),
|
||||
SELECT_SCHEMA: type('dspace/metadata-registry/SELECT_SCHEMA'),
|
||||
DESELECT_SCHEMA: type('dspace/metadata-registry/DESELECT_SCHEMA'),
|
||||
DESELECT_ALL_SCHEMA: type('dspace/metadata-registry/DESELECT_ALL_SCHEMA'),
|
||||
EDIT_FIELD: type('dspace/metadata-registry/EDIT_FIELD'),
|
||||
CANCEL_EDIT_FIELD: type('dspace/metadata-registry/CANCEL_FIELD'),
|
||||
SELECT_FIELD: type('dspace/metadata-registry/SELECT_FIELD'),
|
||||
DESELECT_FIELD: type('dspace/metadata-registry/DESELECT_FIELD'),
|
||||
DESELECT_ALL_FIELD: type('dspace/metadata-registry/DESELECT_ALL_FIELD')
|
||||
};
|
||||
/* tslint:disable:max-classes-per-file */
|
||||
/**
|
||||
* Used to edit a metadata schema in the metadata registry
|
||||
*/
|
||||
var MetadataRegistryEditSchemaAction = /** @class */ (function () {
|
||||
function MetadataRegistryEditSchemaAction(registry) {
|
||||
this.type = MetadataRegistryActionTypes.EDIT_SCHEMA;
|
||||
this.schema = registry;
|
||||
}
|
||||
return MetadataRegistryEditSchemaAction;
|
||||
}());
|
||||
export { MetadataRegistryEditSchemaAction };
|
||||
/**
|
||||
* Used to cancel the editing of a metadata schema in the metadata registry
|
||||
*/
|
||||
var MetadataRegistryCancelSchemaAction = /** @class */ (function () {
|
||||
function MetadataRegistryCancelSchemaAction() {
|
||||
this.type = MetadataRegistryActionTypes.CANCEL_EDIT_SCHEMA;
|
||||
}
|
||||
return MetadataRegistryCancelSchemaAction;
|
||||
}());
|
||||
export { MetadataRegistryCancelSchemaAction };
|
||||
/**
|
||||
* Used to select a single metadata schema in the metadata registry
|
||||
*/
|
||||
var MetadataRegistrySelectSchemaAction = /** @class */ (function () {
|
||||
function MetadataRegistrySelectSchemaAction(registry) {
|
||||
this.type = MetadataRegistryActionTypes.SELECT_SCHEMA;
|
||||
this.schema = registry;
|
||||
}
|
||||
return MetadataRegistrySelectSchemaAction;
|
||||
}());
|
||||
export { MetadataRegistrySelectSchemaAction };
|
||||
/**
|
||||
* Used to deselect a single metadata schema in the metadata registry
|
||||
*/
|
||||
var MetadataRegistryDeselectSchemaAction = /** @class */ (function () {
|
||||
function MetadataRegistryDeselectSchemaAction(registry) {
|
||||
this.type = MetadataRegistryActionTypes.DESELECT_SCHEMA;
|
||||
this.schema = registry;
|
||||
}
|
||||
return MetadataRegistryDeselectSchemaAction;
|
||||
}());
|
||||
export { MetadataRegistryDeselectSchemaAction };
|
||||
/**
|
||||
* Used to deselect all metadata schemas in the metadata registry
|
||||
*/
|
||||
var MetadataRegistryDeselectAllSchemaAction = /** @class */ (function () {
|
||||
function MetadataRegistryDeselectAllSchemaAction() {
|
||||
this.type = MetadataRegistryActionTypes.DESELECT_ALL_SCHEMA;
|
||||
}
|
||||
return MetadataRegistryDeselectAllSchemaAction;
|
||||
}());
|
||||
export { MetadataRegistryDeselectAllSchemaAction };
|
||||
/**
|
||||
* Used to edit a metadata field in the metadata registry
|
||||
*/
|
||||
var MetadataRegistryEditFieldAction = /** @class */ (function () {
|
||||
function MetadataRegistryEditFieldAction(registry) {
|
||||
this.type = MetadataRegistryActionTypes.EDIT_FIELD;
|
||||
this.field = registry;
|
||||
}
|
||||
return MetadataRegistryEditFieldAction;
|
||||
}());
|
||||
export { MetadataRegistryEditFieldAction };
|
||||
/**
|
||||
* Used to cancel the editing of a metadata field in the metadata registry
|
||||
*/
|
||||
var MetadataRegistryCancelFieldAction = /** @class */ (function () {
|
||||
function MetadataRegistryCancelFieldAction() {
|
||||
this.type = MetadataRegistryActionTypes.CANCEL_EDIT_FIELD;
|
||||
}
|
||||
return MetadataRegistryCancelFieldAction;
|
||||
}());
|
||||
export { MetadataRegistryCancelFieldAction };
|
||||
/**
|
||||
* Used to select a single metadata field in the metadata registry
|
||||
*/
|
||||
var MetadataRegistrySelectFieldAction = /** @class */ (function () {
|
||||
function MetadataRegistrySelectFieldAction(registry) {
|
||||
this.type = MetadataRegistryActionTypes.SELECT_FIELD;
|
||||
this.field = registry;
|
||||
}
|
||||
return MetadataRegistrySelectFieldAction;
|
||||
}());
|
||||
export { MetadataRegistrySelectFieldAction };
|
||||
/**
|
||||
* Used to deselect a single metadata field in the metadata registry
|
||||
*/
|
||||
var MetadataRegistryDeselectFieldAction = /** @class */ (function () {
|
||||
function MetadataRegistryDeselectFieldAction(registry) {
|
||||
this.type = MetadataRegistryActionTypes.DESELECT_FIELD;
|
||||
this.field = registry;
|
||||
}
|
||||
return MetadataRegistryDeselectFieldAction;
|
||||
}());
|
||||
export { MetadataRegistryDeselectFieldAction };
|
||||
/**
|
||||
* Used to deselect all metadata fields in the metadata registry
|
||||
*/
|
||||
var MetadataRegistryDeselectAllFieldAction = /** @class */ (function () {
|
||||
function MetadataRegistryDeselectAllFieldAction() {
|
||||
this.type = MetadataRegistryActionTypes.DESELECT_ALL_FIELD;
|
||||
}
|
||||
return MetadataRegistryDeselectAllFieldAction;
|
||||
}());
|
||||
export { MetadataRegistryDeselectAllFieldAction };
|
||||
//# sourceMappingURL=metadata-registry.actions.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metadata-registry.actions.js","sourceRoot":"","sources":["metadata-registry.actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAIjD;;;;;;;GAOG;AACH,MAAM,CAAC,IAAM,2BAA2B,GAAG;IAEzC,WAAW,EAAE,IAAI,CAAC,sCAAsC,CAAC;IACzD,kBAAkB,EAAE,IAAI,CAAC,wCAAwC,CAAC;IAClE,aAAa,EAAE,IAAI,CAAC,wCAAwC,CAAC;IAC7D,eAAe,EAAE,IAAI,CAAC,0CAA0C,CAAC;IACjE,mBAAmB,EAAE,IAAI,CAAC,8CAA8C,CAAC;IAEzE,UAAU,EAAE,IAAI,CAAC,qCAAqC,CAAC;IACvD,iBAAiB,EAAE,IAAI,CAAC,uCAAuC,CAAC;IAChE,YAAY,EAAE,I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AAY,QAAuB;QAJnC,SAAI,GAAG,2BAA2B,CAAC,YAAY,CAAC;QAK9C,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACxB,CAAC;IACH,wCAAC;AAAD,CAAC,AARD,IAQC;;AAED;;GAEG;AACH;IAKE,6CAAY,QAAuB;QAJnC,SAAI,GAAG,2BAA2B,CAAC,cAAc,CAAC;QAKhD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACxB,CAAC;IACH,0CAAC;AAAD,CAAC,AARD,IAQC;;AAED;;GAEG;AACH;IAAA;QACE,SAAI,GAAG,2BAA2B,CAAC,kBAAkB,CAAC;IACxD,CAAC;IAAD,6CAAC;AAAD,CAAC,AAFD,IAEC"}
|
@@ -0,0 +1,161 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { RegistryService } from '../../../core/registry/registry.service';
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import { map, take } from 'rxjs/operators';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { zip } from 'rxjs/internal/observable/zip';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
var MetadataRegistryComponent = /** @class */ (function () {
|
||||
function MetadataRegistryComponent(registryService, notificationsService, router, translateService) {
|
||||
this.registryService = registryService;
|
||||
this.notificationsService = notificationsService;
|
||||
this.router = router;
|
||||
this.translateService = translateService;
|
||||
/**
|
||||
* Pagination config used to display the list of metadata schemas
|
||||
*/
|
||||
this.config = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'registry-metadataschemas-pagination',
|
||||
pageSize: 25
|
||||
});
|
||||
this.updateSchemas();
|
||||
}
|
||||
/**
|
||||
* Event triggered when the user changes page
|
||||
* @param event
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.onPageChange = function (event) {
|
||||
this.config.currentPage = event;
|
||||
this.updateSchemas();
|
||||
};
|
||||
/**
|
||||
* Update the list of schemas by fetching it from the rest api or cache
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.updateSchemas = function () {
|
||||
this.metadataSchemas = this.registryService.getMetadataSchemas(this.config);
|
||||
};
|
||||
/**
|
||||
* Force-update the list of schemas by first clearing the cache related to metadata schemas, then performing
|
||||
* a new REST call
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.forceUpdateSchemas = function () {
|
||||
this.registryService.clearMetadataSchemaRequests().subscribe();
|
||||
this.updateSchemas();
|
||||
};
|
||||
/**
|
||||
* Start editing the selected metadata schema
|
||||
* @param schema
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.editSchema = function (schema) {
|
||||
var _this = this;
|
||||
this.getActiveSchema().pipe(take(1)).subscribe(function (activeSchema) {
|
||||
if (schema === activeSchema) {
|
||||
_this.registryService.cancelEditMetadataSchema();
|
||||
}
|
||||
else {
|
||||
_this.registryService.editMetadataSchema(schema);
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Checks whether the given metadata schema is active (being edited)
|
||||
* @param schema
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.isActive = function (schema) {
|
||||
return this.getActiveSchema().pipe(map(function (activeSchema) { return schema === activeSchema; }));
|
||||
};
|
||||
/**
|
||||
* Gets the active metadata schema (being edited)
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.getActiveSchema = function () {
|
||||
return this.registryService.getActiveMetadataSchema();
|
||||
};
|
||||
/**
|
||||
* Select a metadata schema within the list (checkbox)
|
||||
* @param schema
|
||||
* @param event
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.selectMetadataSchema = function (schema, event) {
|
||||
event.target.checked ?
|
||||
this.registryService.selectMetadataSchema(schema) :
|
||||
this.registryService.deselectMetadataSchema(schema);
|
||||
};
|
||||
/**
|
||||
* Checks whether a given metadata schema is selected in the list (checkbox)
|
||||
* @param schema
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.isSelected = function (schema) {
|
||||
return this.registryService.getSelectedMetadataSchemas().pipe(map(function (schemas) { return schemas.find(function (selectedSchema) { return selectedSchema === schema; }) != null; }));
|
||||
};
|
||||
/**
|
||||
* Delete all the selected metadata schemas
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.deleteSchemas = function () {
|
||||
var _this = this;
|
||||
this.registryService.getSelectedMetadataSchemas().pipe(take(1)).subscribe(function (schemas) {
|
||||
var tasks$ = [];
|
||||
for (var _i = 0, schemas_1 = schemas; _i < schemas_1.length; _i++) {
|
||||
var schema = schemas_1[_i];
|
||||
if (hasValue(schema.id)) {
|
||||
tasks$.push(_this.registryService.deleteMetadataSchema(schema.id));
|
||||
}
|
||||
}
|
||||
zip.apply(void 0, tasks$).subscribe(function (responses) {
|
||||
var successResponses = responses.filter(function (response) { return response.isSuccessful; });
|
||||
var failedResponses = responses.filter(function (response) { return !response.isSuccessful; });
|
||||
if (successResponses.length > 0) {
|
||||
_this.showNotification(true, successResponses.length);
|
||||
}
|
||||
if (failedResponses.length > 0) {
|
||||
_this.showNotification(false, failedResponses.length);
|
||||
}
|
||||
_this.registryService.deselectAllMetadataSchema();
|
||||
_this.registryService.cancelEditMetadataSchema();
|
||||
_this.forceUpdateSchemas();
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Show notifications for an amount of deleted metadata schemas
|
||||
* @param success Whether or not the notification should be a success message (error message when false)
|
||||
* @param amount The amount of deleted metadata schemas
|
||||
*/
|
||||
MetadataRegistryComponent.prototype.showNotification = function (success, amount) {
|
||||
var _this = this;
|
||||
var prefix = 'admin.registries.schema.notification';
|
||||
var suffix = success ? 'success' : 'failure';
|
||||
var messages = observableCombineLatest(this.translateService.get(success ? prefix + "." + suffix : prefix + "." + suffix), this.translateService.get(prefix + ".deleted." + suffix, { amount: amount }));
|
||||
messages.subscribe(function (_a) {
|
||||
var head = _a[0], content = _a[1];
|
||||
if (success) {
|
||||
_this.notificationsService.success(head, content);
|
||||
}
|
||||
else {
|
||||
_this.notificationsService.error(head, content);
|
||||
}
|
||||
});
|
||||
};
|
||||
MetadataRegistryComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-metadata-registry',
|
||||
templateUrl: './metadata-registry.component.html',
|
||||
styleUrls: ['./metadata-registry.component.scss']
|
||||
})
|
||||
/**
|
||||
* A component used for managing all existing metadata schemas within the repository.
|
||||
* The admin can create, edit or delete metadata schemas here.
|
||||
*/
|
||||
,
|
||||
tslib_1.__metadata("design:paramtypes", [RegistryService,
|
||||
NotificationsService,
|
||||
Router,
|
||||
TranslateService])
|
||||
], MetadataRegistryComponent);
|
||||
return MetadataRegistryComponent;
|
||||
}());
|
||||
export { MetadataRegistryComponent };
|
||||
//# sourceMappingURL=metadata-registry.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metadata-registry.component.js","sourceRoot":"","sources":["metadata-registry.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAc,aAAa,IAAI,uBAAuB,EAAE,MAAM,MAAM,CAAC;AAI5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAC3G,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAS,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAWvD;IAeE,mCAAoB,eAAgC,EAChC,oBAA0C,EAC1C,MAAc,EACd,gBAAkC;QAHlC,oBAAe,GAAf,eAA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;QACF,QAAQ,CAAC,SAAS,CAAC,UAAC,EAAe;gBAAd,YAAI,EAAE,eAAO;YAChC,IAAI,OAAO,EAAE;gBACX,KAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;aACjD;iBAAM;gBACL,KAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;aAC/C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAnJU,yBAAyB;QATrC,SAAS,CAAC;YACT,QAAQ,EAAE,sBAAsB;YAChC,WAAW,EAAE,oCAAoC;YACjD,SAAS,EAAE,CAAC,oCAAoC,CAAC;SAClD,CAAC;QACF;;;WAGG;;iDAgBoC,eAAe;YACV,oBAAoB;YAClC,MAAM;YACI,gBAAgB;OAlB3C,yBAAyB,CAoJrC;IAAD,gCAAC;CAAA,AApJD,IAoJC;SApJY,yBAAyB"}
|
@@ -0,0 +1,73 @@
|
||||
import { MetadataRegistryActionTypes } from './metadata-registry.actions';
|
||||
/**
|
||||
* The initial state.
|
||||
*/
|
||||
var initialState = {
|
||||
editSchema: null,
|
||||
selectedSchemas: [],
|
||||
editField: null,
|
||||
selectedFields: []
|
||||
};
|
||||
/**
|
||||
* Reducer that handles MetadataRegistryActions to modify metadata schema and/or field states
|
||||
* @param state The current MetadataRegistryState
|
||||
* @param action The MetadataRegistryAction to perform on the state
|
||||
*/
|
||||
export function metadataRegistryReducer(state, action) {
|
||||
if (state === void 0) { state = initialState; }
|
||||
switch (action.type) {
|
||||
case MetadataRegistryActionTypes.EDIT_SCHEMA: {
|
||||
return Object.assign({}, state, {
|
||||
editSchema: action.schema
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.CANCEL_EDIT_SCHEMA: {
|
||||
return Object.assign({}, state, {
|
||||
editSchema: null
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.SELECT_SCHEMA: {
|
||||
return Object.assign({}, state, {
|
||||
selectedSchemas: state.selectedSchemas.concat([action.schema])
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.DESELECT_SCHEMA: {
|
||||
return Object.assign({}, state, {
|
||||
selectedSchemas: state.selectedSchemas.filter(function (selectedSchema) { return selectedSchema !== action.schema; })
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.DESELECT_ALL_SCHEMA: {
|
||||
return Object.assign({}, state, {
|
||||
selectedSchemas: []
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.EDIT_FIELD: {
|
||||
return Object.assign({}, state, {
|
||||
editField: action.field
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.CANCEL_EDIT_FIELD: {
|
||||
return Object.assign({}, state, {
|
||||
editField: null
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.SELECT_FIELD: {
|
||||
return Object.assign({}, state, {
|
||||
selectedFields: state.selectedFields.concat([action.field])
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.DESELECT_FIELD: {
|
||||
return Object.assign({}, state, {
|
||||
selectedFields: state.selectedFields.filter(function (selectedField) { return selectedField !== action.field; })
|
||||
});
|
||||
}
|
||||
case MetadataRegistryActionTypes.DESELECT_ALL_FIELD: {
|
||||
return Object.assign({}, state, {
|
||||
selectedFields: []
|
||||
});
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=metadata-registry.reducers.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metadata-registry.reducers.js","sourceRoot":"","sources":["metadata-registry.reducers.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,2BAA2B,EAO5B,MAAM,6BAA6B,CAAC;AAcrC;;GAEG;AACH,IAAM,YAAY,GAA0B;IAC1C,UAAU,EAAE,IAAI;IAChB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,EAAE;CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,kCAAkC,KAAoB,EAAE,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YAClD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE;gBAC9B,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;SACJ;QAED,KAAK,2BAA2B,CAAC,YAAY,CAAC,CAAC;YAC7C,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE;gBAC9B,cAAc,EAAM,KAAK,CAAC,cAAc,SAAG,MAA4C,CAAC,KAAK,EAAC;aAC/F,CAAC,CAAC;SACJ;QAED,KAAK,2BAA2B,CAAC,cAAc,CAAC,CAAC;YAC/C,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE;gBAC9B,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CACzC,UAAC,aAAa,IAAK,OAAA,aAAa,KAAM,MAA8C,CAAC,KAAK,EAAvE,CAAuE,CAC3F;aACF,CAAC,CAAC;SACJ;QAED,KAAK,2BAA2B,CAAC,kBAAkB,CAAC,CAAC;YACnD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE;gBAC9B,cAAc,EAAE,EAAE;aACnB,CAAC,CAAC;SACJ;QAED;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC"}
|
@@ -0,0 +1,148 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { DynamicInputModel } from '@ng-dynamic-forms/core';
|
||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { MetadataSchema } from '../../../../core/metadata/metadataschema.model';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { combineLatest } from 'rxjs/internal/observable/combineLatest';
|
||||
var MetadataSchemaFormComponent = /** @class */ (function () {
|
||||
function MetadataSchemaFormComponent(registryService, formBuilderService, translateService) {
|
||||
this.registryService = registryService;
|
||||
this.formBuilderService = formBuilderService;
|
||||
this.translateService = translateService;
|
||||
/**
|
||||
* A unique id used for ds-form
|
||||
*/
|
||||
this.formId = 'metadata-schema-form';
|
||||
/**
|
||||
* The prefix for all messages related to this form
|
||||
*/
|
||||
this.messagePrefix = 'admin.registries.metadata.form';
|
||||
/**
|
||||
* Layout used for structuring the form inputs
|
||||
*/
|
||||
this.formLayout = {
|
||||
name: {
|
||||
grid: {
|
||||
host: 'col col-sm-6 d-inline-block'
|
||||
}
|
||||
},
|
||||
namespace: {
|
||||
grid: {
|
||||
host: 'col col-sm-6 d-inline-block'
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* An EventEmitter that's fired whenever the form is being submitted
|
||||
*/
|
||||
this.submitForm = new EventEmitter();
|
||||
}
|
||||
MetadataSchemaFormComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
combineLatest(this.translateService.get(this.messagePrefix + ".name"), this.translateService.get(this.messagePrefix + ".namespace")).subscribe(function (_a) {
|
||||
var name = _a[0], namespace = _a[1];
|
||||
_this.name = new DynamicInputModel({
|
||||
id: 'name',
|
||||
label: name,
|
||||
name: 'name',
|
||||
validators: {
|
||||
required: null,
|
||||
pattern: '^[^ ,_]{1,32}$'
|
||||
},
|
||||
required: true,
|
||||
});
|
||||
_this.namespace = new DynamicInputModel({
|
||||
id: 'namespace',
|
||||
label: namespace,
|
||||
name: 'namespace',
|
||||
validators: {
|
||||
required: null,
|
||||
},
|
||||
required: true,
|
||||
});
|
||||
_this.formModel = [
|
||||
_this.namespace,
|
||||
_this.name
|
||||
];
|
||||
_this.formGroup = _this.formBuilderService.createFormGroup(_this.formModel);
|
||||
_this.registryService.getActiveMetadataSchema().subscribe(function (schema) {
|
||||
_this.formGroup.patchValue({
|
||||
name: schema != null ? schema.prefix : '',
|
||||
namespace: schema != null ? schema.namespace : ''
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Stop editing the currently selected metadata schema
|
||||
*/
|
||||
MetadataSchemaFormComponent.prototype.onCancel = function () {
|
||||
this.registryService.cancelEditMetadataSchema();
|
||||
};
|
||||
/**
|
||||
* Submit the form
|
||||
* When the schema has an id attached -> Edit the schema
|
||||
* When the schema has no id attached -> Create new schema
|
||||
* Emit the updated/created schema using the EventEmitter submitForm
|
||||
*/
|
||||
MetadataSchemaFormComponent.prototype.onSubmit = function () {
|
||||
var _this = this;
|
||||
this.registryService.getActiveMetadataSchema().pipe(take(1)).subscribe(function (schema) {
|
||||
var values = {
|
||||
prefix: _this.name.value,
|
||||
namespace: _this.namespace.value
|
||||
};
|
||||
if (schema == null) {
|
||||
_this.registryService.createOrUpdateMetadataSchema(Object.assign(new MetadataSchema(), values)).subscribe(function (newSchema) {
|
||||
_this.submitForm.emit(newSchema);
|
||||
});
|
||||
}
|
||||
else {
|
||||
_this.registryService.createOrUpdateMetadataSchema(Object.assign(new MetadataSchema(), {
|
||||
id: schema.id,
|
||||
prefix: (values.prefix ? values.prefix : schema.prefix),
|
||||
namespace: (values.namespace ? values.namespace : schema.namespace)
|
||||
})).subscribe(function (updatedSchema) {
|
||||
_this.submitForm.emit(updatedSchema);
|
||||
});
|
||||
}
|
||||
_this.clearFields();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Reset all input-fields to be empty
|
||||
*/
|
||||
MetadataSchemaFormComponent.prototype.clearFields = function () {
|
||||
this.formGroup.patchValue({
|
||||
prefix: '',
|
||||
namespace: ''
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Cancel the current edit when component is destroyed
|
||||
*/
|
||||
MetadataSchemaFormComponent.prototype.ngOnDestroy = function () {
|
||||
this.onCancel();
|
||||
};
|
||||
tslib_1.__decorate([
|
||||
Output(),
|
||||
tslib_1.__metadata("design:type", EventEmitter)
|
||||
], MetadataSchemaFormComponent.prototype, "submitForm", void 0);
|
||||
MetadataSchemaFormComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-metadata-schema-form',
|
||||
templateUrl: './metadata-schema-form.component.html'
|
||||
})
|
||||
/**
|
||||
* A form used for creating and editing metadata schemas
|
||||
*/
|
||||
,
|
||||
tslib_1.__metadata("design:paramtypes", [RegistryService, FormBuilderService, TranslateService])
|
||||
], MetadataSchemaFormComponent);
|
||||
return MetadataSchemaFormComponent;
|
||||
}());
|
||||
export { MetadataSchemaFormComponent };
|
||||
//# sourceMappingURL=metadata-schema-form.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metadata-schema-form.component.js","sourceRoot":"","sources":["metadata-schema-form.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAqB,MAAM,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAIL,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AASvE;IAqDE,qCAAmB,eAAgC,EAAU,kBAAsC,EAAU,gBAAkC;QAA5H,oBAAe,GAAf,eAAe,CAAiB;QAAU,uBAAkB,GAAlB,kBAAkB,CAAoB;QAAU,qBAAgB,GAAhB,gBAAgB,CAAkB;QAnD/I;;WAEG;QACH,WAAM,GAAG,sBAAsB,CAAC;QAEhC;;WAEG;QACH,kBAAa,GAAG,gCAAgC,CAAC;QAiBjD;;WAEG;QACH,eAAU,GAAsB;YAC9B,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ,IAAI,EAAE,6BAA6B;iBACpC;aACF;YACD,SAAS,EAAE;gBACT,IAAI,EAAE;oBACJ,IAAI,EAAE,6BAA6B;iBACpC;aACF;SACF,CAA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Aa;oBAC1B,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBACtC,CAAC,CAAC,CAAC;aACJ;YACD,KAAI,CAAC,WAAW,EAAE,CAAC;QACrB,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,iDAAW,GAAX;QACE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;YACxB,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,iDAAW,GAAX;QACE,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAhGS;QAAT,MAAM,EAAE;0CAAa,YAAY;mEAA2B;IAnDlD,2BAA2B;QAPvC,SAAS,CAAC;YACT,QAAQ,EAAE,yBAAyB;YACnC,WAAW,EAAE,uCAAuC;SACrD,CAAC;QACF;;WAEG;;iDAsDmC,eAAe,EAA8B,kBAAkB,EAA4B,gBAAgB;OArDpI,2BAA2B,CAoJvC;IAAD,kCAAC;CAAA,AApJD,IAoJC;SApJY,2BAA2B"}
|
@@ -0,0 +1,172 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { MetadataSchema } from '../../../../core/metadata/metadataschema.model';
|
||||
import { DynamicInputModel } from '@ng-dynamic-forms/core';
|
||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { MetadataField } from '../../../../core/metadata/metadatafield.model';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { combineLatest } from 'rxjs/internal/observable/combineLatest';
|
||||
var MetadataFieldFormComponent = /** @class */ (function () {
|
||||
function MetadataFieldFormComponent(registryService, formBuilderService, translateService) {
|
||||
this.registryService = registryService;
|
||||
this.formBuilderService = formBuilderService;
|
||||
this.translateService = translateService;
|
||||
/**
|
||||
* A unique id used for ds-form
|
||||
*/
|
||||
this.formId = 'metadata-field-form';
|
||||
/**
|
||||
* The prefix for all messages related to this form
|
||||
*/
|
||||
this.messagePrefix = 'admin.registries.schema.form';
|
||||
/**
|
||||
* Layout used for structuring the form inputs
|
||||
*/
|
||||
this.formLayout = {
|
||||
element: {
|
||||
grid: {
|
||||
host: 'col col-sm-6 d-inline-block'
|
||||
}
|
||||
},
|
||||
qualifier: {
|
||||
grid: {
|
||||
host: 'col col-sm-6 d-inline-block'
|
||||
}
|
||||
},
|
||||
scopeNote: {
|
||||
grid: {
|
||||
host: 'col col-sm-12 d-inline-block'
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* An EventEmitter that's fired whenever the form is being submitted
|
||||
*/
|
||||
this.submitForm = new EventEmitter();
|
||||
}
|
||||
/**
|
||||
* Initialize the component, setting up the necessary Models for the dynamic form
|
||||
*/
|
||||
MetadataFieldFormComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
combineLatest(this.translateService.get(this.messagePrefix + ".element"), this.translateService.get(this.messagePrefix + ".qualifier"), this.translateService.get(this.messagePrefix + ".scopenote")).subscribe(function (_a) {
|
||||
var element = _a[0], qualifier = _a[1], scopenote = _a[2];
|
||||
_this.element = new DynamicInputModel({
|
||||
id: 'element',
|
||||
label: element,
|
||||
name: 'element',
|
||||
validators: {
|
||||
required: null,
|
||||
},
|
||||
required: true,
|
||||
});
|
||||
_this.qualifier = new DynamicInputModel({
|
||||
id: 'qualifier',
|
||||
label: qualifier,
|
||||
name: 'qualifier',
|
||||
required: false,
|
||||
});
|
||||
_this.scopeNote = new DynamicInputModel({
|
||||
id: 'scopeNote',
|
||||
label: scopenote,
|
||||
name: 'scopeNote',
|
||||
required: false,
|
||||
});
|
||||
_this.formModel = [
|
||||
_this.element,
|
||||
_this.qualifier,
|
||||
_this.scopeNote
|
||||
];
|
||||
_this.formGroup = _this.formBuilderService.createFormGroup(_this.formModel);
|
||||
_this.registryService.getActiveMetadataField().subscribe(function (field) {
|
||||
_this.formGroup.patchValue({
|
||||
element: field != null ? field.element : '',
|
||||
qualifier: field != null ? field.qualifier : '',
|
||||
scopeNote: field != null ? field.scopeNote : ''
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Stop editing the currently selected metadata field
|
||||
*/
|
||||
MetadataFieldFormComponent.prototype.onCancel = function () {
|
||||
this.registryService.cancelEditMetadataField();
|
||||
};
|
||||
/**
|
||||
* Submit the form
|
||||
* When the field has an id attached -> Edit the field
|
||||
* When the field has no id attached -> Create new field
|
||||
* Emit the updated/created field using the EventEmitter submitForm
|
||||
*/
|
||||
MetadataFieldFormComponent.prototype.onSubmit = function () {
|
||||
var _this = this;
|
||||
this.registryService.getActiveMetadataField().pipe(take(1)).subscribe(function (field) {
|
||||
var values = {
|
||||
schema: _this.metadataSchema,
|
||||
element: _this.element.value,
|
||||
qualifier: _this.qualifier.value,
|
||||
scopeNote: _this.scopeNote.value
|
||||
};
|
||||
if (field == null) {
|
||||
_this.registryService.createOrUpdateMetadataField(Object.assign(new MetadataField(), values)).subscribe(function (newField) {
|
||||
_this.submitForm.emit(newField);
|
||||
});
|
||||
}
|
||||
else {
|
||||
_this.registryService.createOrUpdateMetadataField(Object.assign(new MetadataField(), {
|
||||
id: field.id,
|
||||
schema: _this.metadataSchema,
|
||||
element: (values.element ? values.element : field.element),
|
||||
qualifier: (values.qualifier ? values.qualifier : field.qualifier),
|
||||
scopeNote: (values.scopeNote ? values.scopeNote : field.scopeNote)
|
||||
})).subscribe(function (updatedField) {
|
||||
_this.submitForm.emit(updatedField);
|
||||
});
|
||||
}
|
||||
_this.clearFields();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Reset all input-fields to be empty
|
||||
*/
|
||||
MetadataFieldFormComponent.prototype.clearFields = function () {
|
||||
this.formGroup.patchValue({
|
||||
element: '',
|
||||
qualifier: '',
|
||||
scopeNote: ''
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Cancel the current edit when component is destroyed
|
||||
*/
|
||||
MetadataFieldFormComponent.prototype.ngOnDestroy = function () {
|
||||
this.onCancel();
|
||||
};
|
||||
tslib_1.__decorate([
|
||||
Input(),
|
||||
tslib_1.__metadata("design:type", MetadataSchema)
|
||||
], MetadataFieldFormComponent.prototype, "metadataSchema", void 0);
|
||||
tslib_1.__decorate([
|
||||
Output(),
|
||||
tslib_1.__metadata("design:type", EventEmitter)
|
||||
], MetadataFieldFormComponent.prototype, "submitForm", void 0);
|
||||
MetadataFieldFormComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-metadata-field-form',
|
||||
templateUrl: './metadata-field-form.component.html'
|
||||
})
|
||||
/**
|
||||
* A form used for creating and editing metadata fields
|
||||
*/
|
||||
,
|
||||
tslib_1.__metadata("design:paramtypes", [RegistryService,
|
||||
FormBuilderService,
|
||||
TranslateService])
|
||||
], MetadataFieldFormComponent);
|
||||
return MetadataFieldFormComponent;
|
||||
}());
|
||||
export { MetadataFieldFormComponent };
|
||||
//# sourceMappingURL=metadata-field-form.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metadata-field-form.component.js","sourceRoot":"","sources":["metadata-field-form.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAqB,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAGL,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wCA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EAAE,CAAC;QACrB,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,gDAAW,GAAX;QACE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;YACxB,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,EAAE;YACb,SAAS,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,gDAAW,GAAX;QACE,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAlKQ;QAAR,KAAK,EAAE;0CAAiB,cAAc;sEAAC;IAmD9B;QAAT,MAAM,EAAE;0CAAa,YAAY;kEAA2B;IAlElD,0BAA0B;QAPtC,SAAS,CAAC;YACT,QAAQ,EAAE,wBAAwB;YAClC,WAAW,EAAE,sCAAsC;SACpD,CAAC;QACF;;WAEG;;iDAqEmC,eAAe;YACX,kBAAkB;YACpB,gBAAgB;OAtE3C,0BAA0B,CAkLtC;IAAD,iCAAC;CAAA,AAlLD,IAkLC;SAlLY,0BAA0B"}
|
@@ -0,0 +1,182 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { RegistryService } from '../../../core/registry/registry.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import { map, take } from 'rxjs/operators';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { zip } from 'rxjs/internal/observable/zip';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
var MetadataSchemaComponent = /** @class */ (function () {
|
||||
function MetadataSchemaComponent(registryService, route, notificationsService, router, translateService) {
|
||||
this.registryService = registryService;
|
||||
this.route = route;
|
||||
this.notificationsService = notificationsService;
|
||||
this.router = router;
|
||||
this.translateService = translateService;
|
||||
/**
|
||||
* Pagination config used to display the list of metadata fields
|
||||
*/
|
||||
this.config = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'registry-metadatafields-pagination',
|
||||
pageSize: 25,
|
||||
pageSizeOptions: [25, 50, 100, 200]
|
||||
});
|
||||
}
|
||||
MetadataSchemaComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.route.params.subscribe(function (params) {
|
||||
_this.initialize(params);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Initialize the component using the params within the url (schemaName)
|
||||
* @param params
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.initialize = function (params) {
|
||||
this.metadataSchema = this.registryService.getMetadataSchemaByName(params.schemaName);
|
||||
this.updateFields();
|
||||
};
|
||||
/**
|
||||
* Event triggered when the user changes page
|
||||
* @param event
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.onPageChange = function (event) {
|
||||
this.config.currentPage = event;
|
||||
this.updateFields();
|
||||
};
|
||||
/**
|
||||
* Update the list of fields by fetching it from the rest api or cache
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.updateFields = function () {
|
||||
var _this = this;
|
||||
this.metadataSchema.subscribe(function (schemaData) {
|
||||
var schema = schemaData.payload;
|
||||
_this.metadataFields = _this.registryService.getMetadataFieldsBySchema(schema, _this.config);
|
||||
_this.namespace = { namespace: schemaData.payload.namespace };
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Force-update the list of fields by first clearing the cache related to metadata fields, then performing
|
||||
* a new REST call
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.forceUpdateFields = function () {
|
||||
this.registryService.clearMetadataFieldRequests().subscribe();
|
||||
this.updateFields();
|
||||
};
|
||||
/**
|
||||
* Start editing the selected metadata field
|
||||
* @param field
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.editField = function (field) {
|
||||
var _this = this;
|
||||
this.getActiveField().pipe(take(1)).subscribe(function (activeField) {
|
||||
if (field === activeField) {
|
||||
_this.registryService.cancelEditMetadataField();
|
||||
}
|
||||
else {
|
||||
_this.registryService.editMetadataField(field);
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Checks whether the given metadata field is active (being edited)
|
||||
* @param field
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.isActive = function (field) {
|
||||
return this.getActiveField().pipe(map(function (activeField) { return field === activeField; }));
|
||||
};
|
||||
/**
|
||||
* Gets the active metadata field (being edited)
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.getActiveField = function () {
|
||||
return this.registryService.getActiveMetadataField();
|
||||
};
|
||||
/**
|
||||
* Select a metadata field within the list (checkbox)
|
||||
* @param field
|
||||
* @param event
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.selectMetadataField = function (field, event) {
|
||||
event.target.checked ?
|
||||
this.registryService.selectMetadataField(field) :
|
||||
this.registryService.deselectMetadataField(field);
|
||||
};
|
||||
/**
|
||||
* Checks whether a given metadata field is selected in the list (checkbox)
|
||||
* @param field
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.isSelected = function (field) {
|
||||
return this.registryService.getSelectedMetadataFields().pipe(map(function (fields) { return fields.find(function (selectedField) { return selectedField === field; }) != null; }));
|
||||
};
|
||||
/**
|
||||
* Delete all the selected metadata fields
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.deleteFields = function () {
|
||||
var _this = this;
|
||||
this.registryService.getSelectedMetadataFields().pipe(take(1)).subscribe(function (fields) {
|
||||
var tasks$ = [];
|
||||
for (var _i = 0, fields_1 = fields; _i < fields_1.length; _i++) {
|
||||
var field = fields_1[_i];
|
||||
if (hasValue(field.id)) {
|
||||
tasks$.push(_this.registryService.deleteMetadataField(field.id));
|
||||
}
|
||||
}
|
||||
zip.apply(void 0, tasks$).subscribe(function (responses) {
|
||||
var successResponses = responses.filter(function (response) { return response.isSuccessful; });
|
||||
var failedResponses = responses.filter(function (response) { return !response.isSuccessful; });
|
||||
if (successResponses.length > 0) {
|
||||
_this.showNotification(true, successResponses.length);
|
||||
}
|
||||
if (failedResponses.length > 0) {
|
||||
_this.showNotification(false, failedResponses.length);
|
||||
}
|
||||
_this.registryService.deselectAllMetadataField();
|
||||
_this.registryService.cancelEditMetadataField();
|
||||
_this.forceUpdateFields();
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Show notifications for an amount of deleted metadata fields
|
||||
* @param success Whether or not the notification should be a success message (error message when false)
|
||||
* @param amount The amount of deleted metadata fields
|
||||
*/
|
||||
MetadataSchemaComponent.prototype.showNotification = function (success, amount) {
|
||||
var _this = this;
|
||||
var prefix = 'admin.registries.schema.notification';
|
||||
var suffix = success ? 'success' : 'failure';
|
||||
var messages = observableCombineLatest(this.translateService.get(success ? prefix + "." + suffix : prefix + "." + suffix), this.translateService.get(prefix + ".field.deleted." + suffix, { amount: amount }));
|
||||
messages.subscribe(function (_a) {
|
||||
var head = _a[0], content = _a[1];
|
||||
if (success) {
|
||||
_this.notificationsService.success(head, content);
|
||||
}
|
||||
else {
|
||||
_this.notificationsService.error(head, content);
|
||||
}
|
||||
});
|
||||
};
|
||||
MetadataSchemaComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-metadata-schema',
|
||||
templateUrl: './metadata-schema.component.html',
|
||||
styleUrls: ['./metadata-schema.component.scss']
|
||||
})
|
||||
/**
|
||||
* A component used for managing all existing metadata fields within the current metadata schema.
|
||||
* The admin can create, edit or delete metadata fields here.
|
||||
*/
|
||||
,
|
||||
tslib_1.__metadata("design:paramtypes", [RegistryService,
|
||||
ActivatedRoute,
|
||||
NotificationsService,
|
||||
Router,
|
||||
TranslateService])
|
||||
], MetadataSchemaComponent);
|
||||
return MetadataSchemaComponent;
|
||||
}());
|
||||
export { MetadataSchemaComponent };
|
||||
//# sourceMappingURL=metadata-schema.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"metadata-schema.component.js","sourceRoot":"","sources":["metadata-schema.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAA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E,CAAC,CACnF,CAAC;QACF,QAAQ,CAAC,SAAS,CAAC,UAAC,EAAe;gBAAd,YAAI,EAAE,eAAO;YAChC,IAAI,OAAO,EAAE;gBACX,KAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;aACjD;iBAAM;gBACL,KAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;aAC/C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAlLU,uBAAuB;QATnC,SAAS,CAAC;YACT,QAAQ,EAAE,oBAAoB;YAC9B,WAAW,EAAE,kCAAkC;YAC/C,SAAS,EAAE,CAAC,kCAAkC,CAAC;SAChD,CAAC;QACF;;;WAGG;;iDA2BoC,eAAe;YACzB,cAAc;YACC,oBAAoB;YAClC,MAAM;YACI,gBAAgB;OA9B3C,uBAAuB,CAmLnC;IAAD,8BAAC;CAAA,AAnLD,IAmLC;SAnLY,uBAAuB"}
|
22
src/app/+admin/admin-routing.module.js
Normal file
22
src/app/+admin/admin-routing.module.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
var AdminRoutingModule = /** @class */ (function () {
|
||||
function AdminRoutingModule() {
|
||||
}
|
||||
AdminRoutingModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{
|
||||
path: 'registries',
|
||||
loadChildren: './admin-registries/admin-registries.module#AdminRegistriesModule'
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
], AdminRoutingModule);
|
||||
return AdminRoutingModule;
|
||||
}());
|
||||
export { AdminRoutingModule };
|
||||
//# sourceMappingURL=admin-routing.module.js.map
|
1
src/app/+admin/admin-routing.module.js.map
Normal file
1
src/app/+admin/admin-routing.module.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"admin-routing.module.js","sourceRoot":"","sources":["admin-routing.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAYzC;IAAA;IAEA,CAAC;IAFY,kBAAkB;QAV9B,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,YAAY,CAAC,QAAQ,CAAC;oBACpB;wBACE,IAAI,EAAE,YAAY;wBAClB,YAAY,EAAE,kEAAkE;qBACjF;iBACF,CAAC;aACH;SACF,CAAC;OACW,kBAAkB,CAE9B;IAAD,yBAAC;CAAA,AAFD,IAEC;SAFY,kBAAkB"}
|
@@ -0,0 +1,40 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, Inject, Injector } from '@angular/core';
|
||||
import { MenuSectionComponent } from '../../../shared/menu/menu-section/menu-section.component';
|
||||
import { MenuID } from '../../../shared/menu/initial-menus-state';
|
||||
import { MenuService } from '../../../shared/menu/menu.service';
|
||||
import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator';
|
||||
import { MenuSection } from '../../../shared/menu/menu.reducer';
|
||||
/**
|
||||
* Represents a non-expandable section in the admin sidebar
|
||||
*/
|
||||
var AdminSidebarSectionComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(AdminSidebarSectionComponent, _super);
|
||||
function AdminSidebarSectionComponent(menuSection, menuService, injector) {
|
||||
var _this = _super.call(this, menuSection, menuService, injector) || this;
|
||||
_this.menuService = menuService;
|
||||
_this.injector = injector;
|
||||
/**
|
||||
* This section resides in the Admin Sidebar
|
||||
*/
|
||||
_this.menuID = MenuID.ADMIN;
|
||||
_this.itemModel = menuSection.model;
|
||||
return _this;
|
||||
}
|
||||
AdminSidebarSectionComponent.prototype.ngOnInit = function () {
|
||||
_super.prototype.ngOnInit.call(this);
|
||||
};
|
||||
AdminSidebarSectionComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-admin-sidebar-section',
|
||||
templateUrl: './admin-sidebar-section.component.html',
|
||||
styleUrls: ['./admin-sidebar-section.component.scss'],
|
||||
}),
|
||||
rendersSectionForMenu(MenuID.ADMIN, false),
|
||||
tslib_1.__param(0, Inject('sectionDataProvider')),
|
||||
tslib_1.__metadata("design:paramtypes", [MenuSection, MenuService, Injector])
|
||||
], AdminSidebarSectionComponent);
|
||||
return AdminSidebarSectionComponent;
|
||||
}(MenuSectionComponent));
|
||||
export { AdminSidebarSectionComponent };
|
||||
//# sourceMappingURL=admin-sidebar-section.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"admin-sidebar-section.component.js","sourceRoot":"","sources":["admin-sidebar-section.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAU,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE;;GAEG;AAQH;IAAkD,wDAAoB;IAOpE,sCAA2C,WAAwB,EAAY,WAAwB,EAAY,QAAkB;QAArI,YACE,kBAAM,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,SAE1C;QAH8E,iBAAW,GAAX,WAAW,CAAa;QAAY,cAAQ,GAAR,QAAQ,CAAU;QALrI;;WAEG;QACH,YAAM,GAAW,MAAM,CAAC,KAAK,CAAC;QAI5B,KAAI,CAAC,SAAS,GAAG,WAAW,CAAC,KAA0B,CAAC;;IAC1D,CAAC;IAED,+CAAQ,GAAR;QACE,iBAAM,QAAQ,WAAE,CAAC;IACnB,CAAC;IAdU,4BAA4B;QAPxC,SAAS,CAAC;YACT,QAAQ,EAAE,0BAA0B;YACpC,WAAW,EAAE,wCAAwC;YACrD,SAAS,EAAE,CAAC,wCAAwC,CAAC;SAEtD,CAAC;QACD,qBAAqB,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;QAQ5B,mBAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;iDAAc,WAAW,EAAyB,WAAW,EAAsB,QAAQ;OAP1H,4BAA4B,CAexC;IAAD,mCAAC;CAAA,AAfD,CAAkD,oBAAoB,GAerE;SAfY,4BAA4B"}
|
490
src/app/+admin/admin-sidebar/admin-sidebar.component.js
Normal file
490
src/app/+admin/admin-sidebar/admin-sidebar.component.js
Normal file
@@ -0,0 +1,490 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, Injector } from '@angular/core';
|
||||
import { slideHorizontal, slideSidebar } from '../../shared/animations/slide';
|
||||
import { CSSVariableService } from '../../shared/sass-helper/sass-helper.service';
|
||||
import { MenuService } from '../../shared/menu/menu.service';
|
||||
import { MenuID, MenuItemType } from '../../shared/menu/initial-menus-state';
|
||||
import { MenuComponent } from '../../shared/menu/menu.component';
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { first, map } from 'rxjs/operators';
|
||||
import { combineLatest as combineLatestObservable } from 'rxjs';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { CreateCommunityParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component';
|
||||
import { CreateCollectionParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component';
|
||||
import { EditItemSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component';
|
||||
import { EditCommunitySelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component';
|
||||
import { EditCollectionSelectorComponent } from '../../shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component';
|
||||
/**
|
||||
* Component representing the admin sidebar
|
||||
*/
|
||||
var AdminSidebarComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(AdminSidebarComponent, _super);
|
||||
function AdminSidebarComponent(menuService, injector, variableService, authService, modalService) {
|
||||
var _this = _super.call(this, menuService, injector) || this;
|
||||
_this.menuService = menuService;
|
||||
_this.injector = injector;
|
||||
_this.variableService = variableService;
|
||||
_this.authService = authService;
|
||||
_this.modalService = modalService;
|
||||
/**
|
||||
* The menu ID of the Navbar is PUBLIC
|
||||
* @type {MenuID.ADMIN}
|
||||
*/
|
||||
_this.menuID = MenuID.ADMIN;
|
||||
/**
|
||||
* Is true when the sidebar is open, is false when the sidebar is animating or closed
|
||||
* @type {boolean}
|
||||
*/
|
||||
_this.sidebarOpen = true; // Open in UI, animation finished
|
||||
/**
|
||||
* Is true when the sidebar is closed, is false when the sidebar is animating or open
|
||||
* @type {boolean}
|
||||
*/
|
||||
_this.sidebarClosed = !_this.sidebarOpen; // Closed in UI, animation finished
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* Set and calculate all initial values of the instance variables
|
||||
*/
|
||||
AdminSidebarComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.createMenu();
|
||||
_super.prototype.ngOnInit.call(this);
|
||||
this.sidebarWidth = this.variableService.getVariable('sidebarItemsWidth');
|
||||
this.authService.isAuthenticated()
|
||||
.subscribe(function (loggedIn) {
|
||||
if (loggedIn) {
|
||||
_this.menuService.showMenu(_this.menuID);
|
||||
}
|
||||
});
|
||||
this.menuCollapsed.pipe(first())
|
||||
.subscribe(function (collapsed) {
|
||||
_this.sidebarOpen = !collapsed;
|
||||
_this.sidebarClosed = collapsed;
|
||||
});
|
||||
this.sidebarExpanded = combineLatestObservable(this.menuCollapsed, this.menuPreviewCollapsed)
|
||||
.pipe(map(function (_a) {
|
||||
var collapsed = _a[0], previewCollapsed = _a[1];
|
||||
return (!collapsed || !previewCollapsed);
|
||||
}));
|
||||
};
|
||||
/**
|
||||
* Initialize all menu sections and items for this menu
|
||||
*/
|
||||
AdminSidebarComponent.prototype.createMenu = function () {
|
||||
var _this = this;
|
||||
var menuList = [
|
||||
/* News */
|
||||
{
|
||||
id: 'new',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.new'
|
||||
},
|
||||
icon: 'plus-circle',
|
||||
index: 0
|
||||
},
|
||||
{
|
||||
id: 'new_community',
|
||||
parentID: 'new',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.ONCLICK,
|
||||
text: 'menu.section.new_community',
|
||||
function: function () {
|
||||
_this.modalService.open(CreateCommunityParentSelectorComponent);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'new_collection',
|
||||
parentID: 'new',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.ONCLICK,
|
||||
text: 'menu.section.new_collection',
|
||||
function: function () {
|
||||
_this.modalService.open(CreateCollectionParentSelectorComponent);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'new_item',
|
||||
parentID: 'new',
|
||||
active: false,
|
||||
visible: true,
|
||||
// model: {
|
||||
// type: MenuItemType.ONCLICK,
|
||||
// text: 'menu.section.new_item',
|
||||
// function: () => {
|
||||
// this.modalService.open(CreateItemParentSelectorComponent);
|
||||
// }
|
||||
// } as OnClickMenuItemModel,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.new_item',
|
||||
link: '/submit'
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'new_item_version',
|
||||
parentID: 'new',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.new_item_version',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
/* Edit */
|
||||
{
|
||||
id: 'edit',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.edit'
|
||||
},
|
||||
icon: 'pencil-alt',
|
||||
index: 1
|
||||
},
|
||||
{
|
||||
id: 'edit_community',
|
||||
parentID: 'edit',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.ONCLICK,
|
||||
text: 'menu.section.edit_community',
|
||||
function: function () {
|
||||
_this.modalService.open(EditCommunitySelectorComponent);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'edit_collection',
|
||||
parentID: 'edit',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.ONCLICK,
|
||||
text: 'menu.section.edit_collection',
|
||||
function: function () {
|
||||
_this.modalService.open(EditCollectionSelectorComponent);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'edit_item',
|
||||
parentID: 'edit',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.ONCLICK,
|
||||
text: 'menu.section.edit_item',
|
||||
function: function () {
|
||||
_this.modalService.open(EditItemSelectorComponent);
|
||||
}
|
||||
},
|
||||
},
|
||||
/* Import */
|
||||
{
|
||||
id: 'import',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.import'
|
||||
},
|
||||
icon: 'sign-in-alt',
|
||||
index: 2
|
||||
},
|
||||
{
|
||||
id: 'import_metadata',
|
||||
parentID: 'import',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.import_metadata',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'import_batch',
|
||||
parentID: 'import',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.import_batch',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
/* Export */
|
||||
{
|
||||
id: 'export',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.export'
|
||||
},
|
||||
icon: 'sign-out-alt',
|
||||
index: 3
|
||||
},
|
||||
{
|
||||
id: 'export_community',
|
||||
parentID: 'export',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.export_community',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'export_collection',
|
||||
parentID: 'export',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.export_collection',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'export_item',
|
||||
parentID: 'export',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.export_item',
|
||||
link: ''
|
||||
},
|
||||
}, {
|
||||
id: 'export_metadata',
|
||||
parentID: 'export',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.export_metadata',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
/* Access Control */
|
||||
{
|
||||
id: 'access_control',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.access_control'
|
||||
},
|
||||
icon: 'key',
|
||||
index: 4
|
||||
},
|
||||
{
|
||||
id: 'access_control_people',
|
||||
parentID: 'access_control',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.access_control_people',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'access_control_groups',
|
||||
parentID: 'access_control',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.access_control_groups',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'access_control_authorizations',
|
||||
parentID: 'access_control',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.access_control_authorizations',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
/* Search */
|
||||
{
|
||||
id: 'find',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.find'
|
||||
},
|
||||
icon: 'search',
|
||||
index: 5
|
||||
},
|
||||
{
|
||||
id: 'find_items',
|
||||
parentID: 'find',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.find_items',
|
||||
link: '/search'
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'find_withdrawn_items',
|
||||
parentID: 'find',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.find_withdrawn_items',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'find_private_items',
|
||||
parentID: 'find',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.find_private_items',
|
||||
link: ''
|
||||
},
|
||||
},
|
||||
/* Registries */
|
||||
{
|
||||
id: 'registries',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.registries'
|
||||
},
|
||||
icon: 'list',
|
||||
index: 6
|
||||
},
|
||||
{
|
||||
id: 'registries_metadata',
|
||||
parentID: 'registries',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.registries_metadata',
|
||||
link: 'admin/registries/metadata'
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'registries_format',
|
||||
parentID: 'registries',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.registries_format',
|
||||
link: 'admin/registries/bitstream-formats'
|
||||
},
|
||||
},
|
||||
/* Curation tasks */
|
||||
{
|
||||
id: 'curation_tasks',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.curation_task',
|
||||
link: ''
|
||||
},
|
||||
icon: 'filter',
|
||||
index: 7
|
||||
},
|
||||
/* Statistics */
|
||||
{
|
||||
id: 'statistics_task',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.statistics_task',
|
||||
link: ''
|
||||
},
|
||||
icon: 'chart-bar',
|
||||
index: 8
|
||||
},
|
||||
/* Control Panel */
|
||||
{
|
||||
id: 'control_panel',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.control_panel',
|
||||
link: ''
|
||||
},
|
||||
icon: 'cogs',
|
||||
index: 9
|
||||
},
|
||||
];
|
||||
menuList.forEach(function (menuSection) { return _this.menuService.addSection(_this.menuID, menuSection); });
|
||||
};
|
||||
/**
|
||||
* Method to change this.collapsed to false when the slide animation ends and is sliding open
|
||||
* @param event The animation event
|
||||
*/
|
||||
AdminSidebarComponent.prototype.startSlide = function (event) {
|
||||
if (event.toState === 'expanded') {
|
||||
this.sidebarClosed = false;
|
||||
}
|
||||
else if (event.toState === 'collapsed') {
|
||||
this.sidebarOpen = false;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Method to change this.collapsed to false when the slide animation ends and is sliding open
|
||||
* @param event The animation event
|
||||
*/
|
||||
AdminSidebarComponent.prototype.finishSlide = function (event) {
|
||||
if (event.fromState === 'expanded') {
|
||||
this.sidebarClosed = true;
|
||||
}
|
||||
else if (event.fromState === 'collapsed') {
|
||||
this.sidebarOpen = true;
|
||||
}
|
||||
};
|
||||
AdminSidebarComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-admin-sidebar',
|
||||
templateUrl: './admin-sidebar.component.html',
|
||||
styleUrls: ['./admin-sidebar.component.scss'],
|
||||
animations: [slideHorizontal, slideSidebar]
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [MenuService,
|
||||
Injector,
|
||||
CSSVariableService,
|
||||
AuthService,
|
||||
NgbModal])
|
||||
], AdminSidebarComponent);
|
||||
return AdminSidebarComponent;
|
||||
}(MenuComponent));
|
||||
export { AdminSidebarComponent };
|
||||
//# sourceMappingURL=admin-sidebar.component.js.map
|
File diff suppressed because one or more lines are too long
@@ -0,0 +1,58 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, Inject, Injector } from '@angular/core';
|
||||
import { rotate } from '../../../shared/animations/rotate';
|
||||
import { AdminSidebarSectionComponent } from '../admin-sidebar-section/admin-sidebar-section.component';
|
||||
import { slide } from '../../../shared/animations/slide';
|
||||
import { CSSVariableService } from '../../../shared/sass-helper/sass-helper.service';
|
||||
import { bgColor } from '../../../shared/animations/bgColor';
|
||||
import { MenuID } from '../../../shared/menu/initial-menus-state';
|
||||
import { MenuService } from '../../../shared/menu/menu.service';
|
||||
import { combineLatest as combineLatestObservable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator';
|
||||
/**
|
||||
* Represents a expandable section in the sidebar
|
||||
*/
|
||||
var ExpandableAdminSidebarSectionComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(ExpandableAdminSidebarSectionComponent, _super);
|
||||
function ExpandableAdminSidebarSectionComponent(menuSection, menuService, variableService, injector) {
|
||||
var _this = _super.call(this, menuSection, menuService, injector) || this;
|
||||
_this.menuService = menuService;
|
||||
_this.variableService = variableService;
|
||||
_this.injector = injector;
|
||||
/**
|
||||
* This section resides in the Admin Sidebar
|
||||
*/
|
||||
_this.menuID = MenuID.ADMIN;
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* Set initial values for instance variables
|
||||
*/
|
||||
ExpandableAdminSidebarSectionComponent.prototype.ngOnInit = function () {
|
||||
_super.prototype.ngOnInit.call(this);
|
||||
this.sidebarActiveBg = this.variableService.getVariable('adminSidebarActiveBg');
|
||||
this.sidebarCollapsed = this.menuService.isMenuCollapsed(this.menuID);
|
||||
this.sidebarPreviewCollapsed = this.menuService.isMenuPreviewCollapsed(this.menuID);
|
||||
this.expanded = combineLatestObservable(this.active, this.sidebarCollapsed, this.sidebarPreviewCollapsed)
|
||||
.pipe(map(function (_a) {
|
||||
var active = _a[0], sidebarCollapsed = _a[1], sidebarPreviewCollapsed = _a[2];
|
||||
return (active && (!sidebarCollapsed || !sidebarPreviewCollapsed));
|
||||
}));
|
||||
};
|
||||
ExpandableAdminSidebarSectionComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-expandable-admin-sidebar-section',
|
||||
templateUrl: './expandable-admin-sidebar-section.component.html',
|
||||
styleUrls: ['./expandable-admin-sidebar-section.component.scss'],
|
||||
animations: [rotate, slide, bgColor]
|
||||
}),
|
||||
rendersSectionForMenu(MenuID.ADMIN, true),
|
||||
tslib_1.__param(0, Inject('sectionDataProvider')),
|
||||
tslib_1.__metadata("design:paramtypes", [Object, MenuService,
|
||||
CSSVariableService, Injector])
|
||||
], ExpandableAdminSidebarSectionComponent);
|
||||
return ExpandableAdminSidebarSectionComponent;
|
||||
}(AdminSidebarSectionComponent));
|
||||
export { ExpandableAdminSidebarSectionComponent };
|
||||
//# sourceMappingURL=expandable-admin-sidebar-section.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"expandable-admin-sidebar-section.component.js","sourceRoot":"","sources":["expandable-admin-sidebar-section.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAU,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AACxG,OAAO,EAAE,KAAK,EAAE,M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AmD;gBAAlD,cAAM,EAAE,wBAAgB,EAAE,+BAAuB;YAAM,OAAA,CAAC,MAAM,IAAI,CAAC,CAAC,gBAAgB,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAA3D,CAA2D,CAAC,CAC1H,CAAC;IACN,CAAC;IA5CU,sCAAsC;QARlD,SAAS,CAAC;YACT,QAAQ,EAAE,qCAAqC;YAC/C,WAAW,EAAE,mDAAmD;YAChE,SAAS,EAAE,CAAC,mDAAmD,CAAC;YAChE,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;SACrC,CAAC;QAED,qBAAqB,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC;QA4B3B,mBAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;yDAAqC,WAAW;YACrD,kBAAkB,EAAsB,QAAQ;OA5B1E,sCAAsC,CA6ClD;IAAD,6CAAC;CAAA,AA7CD,CAA4D,4BAA4B,GA6CvF;SA7CY,sCAAsC"}
|
21
src/app/+admin/admin.module.js
Normal file
21
src/app/+admin/admin.module.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AdminRegistriesModule } from './admin-registries/admin-registries.module';
|
||||
import { AdminRoutingModule } from './admin-routing.module';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
var AdminModule = /** @class */ (function () {
|
||||
function AdminModule() {
|
||||
}
|
||||
AdminModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
AdminRegistriesModule,
|
||||
AdminRoutingModule,
|
||||
SharedModule,
|
||||
],
|
||||
})
|
||||
], AdminModule);
|
||||
return AdminModule;
|
||||
}());
|
||||
export { AdminModule };
|
||||
//# sourceMappingURL=admin.module.js.map
|
1
src/app/+admin/admin.module.js.map
Normal file
1
src/app/+admin/admin.module.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"admin.module.js","sourceRoot":"","sources":["admin.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AASvD;IAAA;IAEA,CAAC;IAFY,WAAW;QAPvB,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,qBAAqB;gBACrB,kBAAkB;gBAClB,YAAY;aACb;SACF,CAAC;OACW,WAAW,CAEvB;IAAD,kBAAC;CAAA,AAFD,IAEC;SAFY,WAAW"}
|
@@ -0,0 +1,119 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { ChangeDetectorRef, Component, Inject } from '@angular/core';
|
||||
import { BrowseByMetadataPageComponent, browseParamsToOptions } from '../+browse-by-metadata-page/browse-by-metadata-page.component';
|
||||
import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model';
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs/internal/observable/combineLatest';
|
||||
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { BrowseService } from '../../core/browse/browse.service';
|
||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||
import { GLOBAL_CONFIG } from '../../../config';
|
||||
import { StartsWithType } from '../../shared/starts-with/starts-with-decorator';
|
||||
var BrowseByDatePageComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(BrowseByDatePageComponent, _super);
|
||||
function BrowseByDatePageComponent(config, route, browseService, dsoService, router, cdRef) {
|
||||
var _this = _super.call(this, route, browseService, dsoService, router) || this;
|
||||
_this.config = config;
|
||||
_this.route = route;
|
||||
_this.browseService = browseService;
|
||||
_this.dsoService = dsoService;
|
||||
_this.router = router;
|
||||
_this.cdRef = cdRef;
|
||||
/**
|
||||
* The default metadata-field to use for determining the lower limit of the StartsWith dropdown options
|
||||
*/
|
||||
_this.defaultMetadataField = 'dc.date.issued';
|
||||
return _this;
|
||||
}
|
||||
BrowseByDatePageComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.startsWithType = StartsWithType.date;
|
||||
this.updatePage(new BrowseEntrySearchOptions(null, this.paginationConfig, this.sortConfig));
|
||||
this.subs.push(observableCombineLatest(this.route.params, this.route.queryParams, this.route.data, function (params, queryParams, data) {
|
||||
return Object.assign({}, params, queryParams, data);
|
||||
})
|
||||
.subscribe(function (params) {
|
||||
var metadataField = params.metadataField || _this.defaultMetadataField;
|
||||
_this.metadata = params.metadata || _this.defaultMetadata;
|
||||
_this.startsWith = +params.startsWith || params.startsWith;
|
||||
var searchOptions = browseParamsToOptions(params, Object.assign({}), _this.sortConfig, _this.metadata);
|
||||
_this.updatePageWithItems(searchOptions, _this.value);
|
||||
_this.updateParent(params.scope);
|
||||
_this.updateStartsWithOptions(_this.metadata, metadataField, params.scope);
|
||||
}));
|
||||
};
|
||||
/**
|
||||
* Update the StartsWith options
|
||||
* In this implementation, it creates a list of years starting from now, going all the way back to the earliest
|
||||
* date found on an item within this scope. The further back in time, the bigger the change in years become to avoid
|
||||
* extremely long lists with a one-year difference.
|
||||
* To determine the change in years, the config found under GlobalConfig.BrowseBy is used for this.
|
||||
* @param definition The metadata definition to fetch the first item for
|
||||
* @param metadataField The metadata field to fetch the earliest date from (expects a date field)
|
||||
* @param scope The scope under which to fetch the earliest item for
|
||||
*/
|
||||
BrowseByDatePageComponent.prototype.updateStartsWithOptions = function (definition, metadataField, scope) {
|
||||
var _this = this;
|
||||
this.subs.push(this.browseService.getFirstItemFor(definition, scope).subscribe(function (firstItemRD) {
|
||||
var lowerLimit = _this.config.browseBy.defaultLowerLimit;
|
||||
if (hasValue(firstItemRD.payload)) {
|
||||
var date = firstItemRD.payload.firstMetadataValue(metadataField);
|
||||
if (hasValue(date) && hasValue(+date.split('-')[0])) {
|
||||
lowerLimit = +date.split('-')[0];
|
||||
}
|
||||
}
|
||||
var options = [];
|
||||
var currentYear = new Date().getFullYear();
|
||||
var oneYearBreak = Math.floor((currentYear - _this.config.browseBy.oneYearLimit) / 5) * 5;
|
||||
var fiveYearBreak = Math.floor((currentYear - _this.config.browseBy.fiveYearLimit) / 10) * 10;
|
||||
if (lowerLimit <= fiveYearBreak) {
|
||||
lowerLimit -= 10;
|
||||
}
|
||||
else if (lowerLimit <= oneYearBreak) {
|
||||
lowerLimit -= 5;
|
||||
}
|
||||
else {
|
||||
lowerLimit -= 1;
|
||||
}
|
||||
var i = currentYear;
|
||||
while (i > lowerLimit) {
|
||||
options.push(i);
|
||||
if (i <= fiveYearBreak) {
|
||||
i -= 10;
|
||||
}
|
||||
else if (i <= oneYearBreak) {
|
||||
i -= 5;
|
||||
}
|
||||
else {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
if (isNotEmpty(options)) {
|
||||
_this.startsWithOptions = options;
|
||||
_this.cdRef.detectChanges();
|
||||
}
|
||||
}));
|
||||
};
|
||||
BrowseByDatePageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-browse-by-date-page',
|
||||
styleUrls: ['../+browse-by-metadata-page/browse-by-metadata-page.component.scss'],
|
||||
templateUrl: '../+browse-by-metadata-page/browse-by-metadata-page.component.html'
|
||||
})
|
||||
/**
|
||||
* Component for browsing items by metadata definition of type 'date'
|
||||
* A metadata definition is a short term used to describe one or multiple metadata fields.
|
||||
* An example would be 'dateissued' for 'dc.date.issued'
|
||||
*/
|
||||
,
|
||||
tslib_1.__param(0, Inject(GLOBAL_CONFIG)),
|
||||
tslib_1.__metadata("design:paramtypes", [Object, ActivatedRoute,
|
||||
BrowseService,
|
||||
DSpaceObjectDataService,
|
||||
Router,
|
||||
ChangeDetectorRef])
|
||||
], BrowseByDatePageComponent);
|
||||
return BrowseByDatePageComponent;
|
||||
}(BrowseByMetadataPageComponent));
|
||||
export { BrowseByDatePageComponent };
|
||||
//# sourceMappingURL=browse-by-date-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"browse-by-date-page.component.js","sourceRoot":"","sources":["browse-by-date-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,+DAA+D,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,EAAE,aAAa,IAAI,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGlG,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAYhF;IAA+C,qDAA6B;IAO1E,mCAAiD,MAAoB,EACxC,KAAqB,EACrB,aAA4B,EAC5B,UAAmC,EACnC,MAAc,EACd,KAAwB;QALrD,YAME,kBAAM,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,CAAC,SAChD;QAPgD,YAAM,GAAN,MAAM,CAAc;QACxC,WAAK,GAAL,KAAK,CAAgB;QACrB,mBAAa,GAAb,aAAa,CAAe;QAC5B,gBAAU,GAAV,UAAU,CAAyB;QACnC,YAAM,GAAN,MAAM,CAAQ;QACd,WAAK,GAAL,KAAK,CAAmB;QAVrD;;WAEG;QACH,0BAAoB,GAAG,gBAAgB,CAAC;;IASxC,CAAC;IAED,4CAAQ,GAAR;QAAA,iBAoBC;QAnBC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,IAAI,CAA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AU,EAAE;gBACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAChB,IAAI,CAAC,IAAI,aAAa,EAAE;oBACtB,CAAC,IAAI,EAAE,CAAC;iBACT;qBAAM,IAAI,CAAC,IAAI,YAAY,EAAE;oBAC5B,CAAC,IAAI,CAAC,CAAC;iBACR;qBAAM;oBACL,CAAC,EAAE,CAAC;iBACL;aACF;YACD,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE;gBACvB,KAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC;gBACjC,KAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;aAC5B;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAtFU,yBAAyB;QAVrC,SAAS,CAAC;YACT,QAAQ,EAAE,wBAAwB;YAClC,SAAS,EAAE,CAAC,oEAAoE,CAAC;YACjF,WAAW,EAAE,oEAAoE;SAClF,CAAC;QACF;;;;WAIG;;QAQmB,mBAAA,MAAM,CAAC,aAAa,CAAC,CAAA;yDACL,cAAc;YACN,aAAa;YAChB,uBAAuB;YAC3B,MAAM;YACP,iBAAiB;OAZ1C,yBAAyB,CAwFrC;IAAD,gCAAC;CAAA,AAxFD,CAA+C,6BAA6B,GAwF3E;SAxFY,yBAAyB"}
|
@@ -0,0 +1,208 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs';
|
||||
import { Component } from '@angular/core';
|
||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
||||
import { BrowseService } from '../../core/browse/browse.service';
|
||||
import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model';
|
||||
import { getSucceededRemoteData } from '../../core/shared/operators';
|
||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { StartsWithType } from '../../shared/starts-with/starts-with-decorator';
|
||||
var BrowseByMetadataPageComponent = /** @class */ (function () {
|
||||
function BrowseByMetadataPageComponent(route, browseService, dsoService, router) {
|
||||
this.route = route;
|
||||
this.browseService = browseService;
|
||||
this.dsoService = dsoService;
|
||||
this.router = router;
|
||||
/**
|
||||
* The pagination config used to display the values
|
||||
*/
|
||||
this.paginationConfig = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'browse-by-metadata-pagination',
|
||||
currentPage: 1,
|
||||
pageSize: 20
|
||||
});
|
||||
/**
|
||||
* The sorting config used to sort the values (defaults to Ascending)
|
||||
*/
|
||||
this.sortConfig = new SortOptions('default', SortDirection.ASC);
|
||||
/**
|
||||
* List of subscriptions
|
||||
*/
|
||||
this.subs = [];
|
||||
/**
|
||||
* The default metadata definition to resort to when none is provided
|
||||
*/
|
||||
this.defaultMetadata = 'author';
|
||||
/**
|
||||
* The current metadata definition
|
||||
*/
|
||||
this.metadata = this.defaultMetadata;
|
||||
/**
|
||||
* The type of StartsWith options to render
|
||||
* Defaults to text
|
||||
*/
|
||||
this.startsWithType = StartsWithType.text;
|
||||
/**
|
||||
* The value we're browing items for
|
||||
* - When the value is not empty, we're browsing items
|
||||
* - When the value is empty, we're browsing browse-entries (values for the given metadata definition)
|
||||
*/
|
||||
this.value = '';
|
||||
}
|
||||
BrowseByMetadataPageComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.updatePage(new BrowseEntrySearchOptions(null, this.paginationConfig, this.sortConfig));
|
||||
this.subs.push(observableCombineLatest(this.route.params, this.route.queryParams, function (params, queryParams) {
|
||||
return Object.assign({}, params, queryParams);
|
||||
})
|
||||
.subscribe(function (params) {
|
||||
_this.metadata = params.metadata || _this.defaultMetadata;
|
||||
_this.value = +params.value || params.value || '';
|
||||
_this.startsWith = +params.startsWith || params.startsWith;
|
||||
var searchOptions = browseParamsToOptions(params, _this.paginationConfig, _this.sortConfig, _this.metadata);
|
||||
if (isNotEmpty(_this.value)) {
|
||||
_this.updatePageWithItems(searchOptions, _this.value);
|
||||
}
|
||||
else {
|
||||
_this.updatePage(searchOptions);
|
||||
}
|
||||
_this.updateParent(params.scope);
|
||||
}));
|
||||
this.updateStartsWithTextOptions();
|
||||
};
|
||||
/**
|
||||
* Update the StartsWith options with text values
|
||||
* It adds the value "0-9" as well as all letters from A to Z
|
||||
*/
|
||||
BrowseByMetadataPageComponent.prototype.updateStartsWithTextOptions = function () {
|
||||
this.startsWithOptions = ['0-9'].concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''));
|
||||
};
|
||||
/**
|
||||
* Updates the current page with searchOptions
|
||||
* @param searchOptions Options to narrow down your search:
|
||||
* { metadata: string
|
||||
* pagination: PaginationComponentOptions,
|
||||
* sort: SortOptions,
|
||||
* scope: string }
|
||||
*/
|
||||
BrowseByMetadataPageComponent.prototype.updatePage = function (searchOptions) {
|
||||
this.browseEntries$ = this.browseService.getBrowseEntriesFor(searchOptions);
|
||||
this.items$ = undefined;
|
||||
};
|
||||
/**
|
||||
* Updates the current page with searchOptions and display items linked to the given value
|
||||
* @param searchOptions Options to narrow down your search:
|
||||
* { metadata: string
|
||||
* pagination: PaginationComponentOptions,
|
||||
* sort: SortOptions,
|
||||
* scope: string }
|
||||
* @param value The value of the browse-entry to display items for
|
||||
*/
|
||||
BrowseByMetadataPageComponent.prototype.updatePageWithItems = function (searchOptions, value) {
|
||||
this.items$ = this.browseService.getBrowseItemsFor(value, searchOptions);
|
||||
};
|
||||
/**
|
||||
* Update the parent Community or Collection using their scope
|
||||
* @param scope The UUID of the Community or Collection to fetch
|
||||
*/
|
||||
BrowseByMetadataPageComponent.prototype.updateParent = function (scope) {
|
||||
if (hasValue(scope)) {
|
||||
this.parent$ = this.dsoService.findById(scope).pipe(getSucceededRemoteData());
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Navigate to the previous page
|
||||
*/
|
||||
BrowseByMetadataPageComponent.prototype.goPrev = function () {
|
||||
var _this = this;
|
||||
if (this.items$) {
|
||||
this.items$.pipe(take(1)).subscribe(function (items) {
|
||||
_this.items$ = _this.browseService.getPrevBrowseItems(items);
|
||||
});
|
||||
}
|
||||
else if (this.browseEntries$) {
|
||||
this.browseEntries$.pipe(take(1)).subscribe(function (entries) {
|
||||
_this.browseEntries$ = _this.browseService.getPrevBrowseEntries(entries);
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Navigate to the next page
|
||||
*/
|
||||
BrowseByMetadataPageComponent.prototype.goNext = function () {
|
||||
var _this = this;
|
||||
if (this.items$) {
|
||||
this.items$.pipe(take(1)).subscribe(function (items) {
|
||||
_this.items$ = _this.browseService.getNextBrowseItems(items);
|
||||
});
|
||||
}
|
||||
else if (this.browseEntries$) {
|
||||
this.browseEntries$.pipe(take(1)).subscribe(function (entries) {
|
||||
_this.browseEntries$ = _this.browseService.getNextBrowseEntries(entries);
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Change the page size
|
||||
* @param size
|
||||
*/
|
||||
BrowseByMetadataPageComponent.prototype.pageSizeChange = function (size) {
|
||||
this.router.navigate([], {
|
||||
queryParams: Object.assign({ pageSize: size }),
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Change the sorting direction
|
||||
* @param direction
|
||||
*/
|
||||
BrowseByMetadataPageComponent.prototype.sortDirectionChange = function (direction) {
|
||||
this.router.navigate([], {
|
||||
queryParams: Object.assign({ sortDirection: direction }),
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
};
|
||||
BrowseByMetadataPageComponent.prototype.ngOnDestroy = function () {
|
||||
this.subs.filter(function (sub) { return hasValue(sub); }).forEach(function (sub) { return sub.unsubscribe(); });
|
||||
};
|
||||
BrowseByMetadataPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-browse-by-metadata-page',
|
||||
styleUrls: ['./browse-by-metadata-page.component.scss'],
|
||||
templateUrl: './browse-by-metadata-page.component.html'
|
||||
})
|
||||
/**
|
||||
* Component for browsing (items) by metadata definition
|
||||
* A metadata definition is a short term used to describe one or multiple metadata fields.
|
||||
* An example would be 'author' for 'dc.contributor.*'
|
||||
*/
|
||||
,
|
||||
tslib_1.__metadata("design:paramtypes", [ActivatedRoute,
|
||||
BrowseService,
|
||||
DSpaceObjectDataService,
|
||||
Router])
|
||||
], BrowseByMetadataPageComponent);
|
||||
return BrowseByMetadataPageComponent;
|
||||
}());
|
||||
export { BrowseByMetadataPageComponent };
|
||||
/**
|
||||
* Function to transform query and url parameters into searchOptions used to fetch browse entries or items
|
||||
* @param params URL and query parameters
|
||||
* @param paginationConfig Pagination configuration
|
||||
* @param sortConfig Sorting configuration
|
||||
* @param metadata Optional metadata definition to fetch browse entries/items for
|
||||
*/
|
||||
export function browseParamsToOptions(params, paginationConfig, sortConfig, metadata) {
|
||||
return new BrowseEntrySearchOptions(metadata, Object.assign({}, paginationConfig, {
|
||||
currentPage: +params.page || paginationConfig.currentPage,
|
||||
pageSize: +params.pageSize || paginationConfig.pageSize
|
||||
}), Object.assign({}, sortConfig, {
|
||||
direction: params.sortDirection || sortConfig.direction,
|
||||
field: params.sortField || sortConfig.field
|
||||
}), +params.startsWith || params.startsWith, params.scope);
|
||||
}
|
||||
//# sourceMappingURL=browse-by-metadata-page.component.js.map
|
File diff suppressed because one or more lines are too long
@@ -0,0 +1,56 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs';
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { BrowseByMetadataPageComponent, browseParamsToOptions } from '../+browse-by-metadata-page/browse-by-metadata-page.component';
|
||||
import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model';
|
||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||
import { BrowseService } from '../../core/browse/browse.service';
|
||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||
var BrowseByTitlePageComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(BrowseByTitlePageComponent, _super);
|
||||
function BrowseByTitlePageComponent(route, browseService, dsoService, router) {
|
||||
var _this = _super.call(this, route, browseService, dsoService, router) || this;
|
||||
_this.route = route;
|
||||
_this.browseService = browseService;
|
||||
_this.dsoService = dsoService;
|
||||
_this.router = router;
|
||||
return _this;
|
||||
}
|
||||
BrowseByTitlePageComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.sortConfig = new SortOptions('dc.title', SortDirection.ASC);
|
||||
this.updatePage(new BrowseEntrySearchOptions(null, this.paginationConfig, this.sortConfig));
|
||||
this.subs.push(observableCombineLatest(this.route.params, this.route.queryParams, this.route.data, function (params, queryParams, data) {
|
||||
return Object.assign({}, params, queryParams, data);
|
||||
})
|
||||
.subscribe(function (params) {
|
||||
_this.metadata = params.metadata || _this.defaultMetadata;
|
||||
_this.updatePageWithItems(browseParamsToOptions(params, _this.paginationConfig, _this.sortConfig, _this.metadata), undefined);
|
||||
_this.updateParent(params.scope);
|
||||
}));
|
||||
this.updateStartsWithTextOptions();
|
||||
};
|
||||
BrowseByTitlePageComponent.prototype.ngOnDestroy = function () {
|
||||
this.subs.filter(function (sub) { return hasValue(sub); }).forEach(function (sub) { return sub.unsubscribe(); });
|
||||
};
|
||||
BrowseByTitlePageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-browse-by-title-page',
|
||||
styleUrls: ['../+browse-by-metadata-page/browse-by-metadata-page.component.scss'],
|
||||
templateUrl: '../+browse-by-metadata-page/browse-by-metadata-page.component.html'
|
||||
})
|
||||
/**
|
||||
* Component for browsing items by title (dc.title)
|
||||
*/
|
||||
,
|
||||
tslib_1.__metadata("design:paramtypes", [ActivatedRoute,
|
||||
BrowseService,
|
||||
DSpaceObjectDataService,
|
||||
Router])
|
||||
], BrowseByTitlePageComponent);
|
||||
return BrowseByTitlePageComponent;
|
||||
}(BrowseByMetadataPageComponent));
|
||||
export { BrowseByTitlePageComponent };
|
||||
//# sourceMappingURL=browse-by-title-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"browse-by-title-page.component.js","sourceRoot":"","sources":["browse-by-title-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,IAAI,uBAAuB,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,+DAA+D,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAUxF;IAAgD,sDAA6B;IAE3E,oCAA6B,KAAqB,EACrB,aAA4B,EAC5B,UAAmC,EACnC,MAAc;QAH3C,YAIE,kBAAM,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,CAAC,SAChD;QAL4B,WAAK,GAAL,KAAK,CAAgB;QACrB,mBAAa,GAAb,aAAa,CAAe;QAC5B,gBAAU,GAAV,UAAU,CAAyB;QACnC,YAAM,GAAN,MAAM,CAAQ;;IAE3C,CAAC;IAED,6CAAQ,GAAR;QAAA,iBAiBC;QAhBC,IAAI,CAAC,UAAU,GAAG,IAAI,WAAW,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,CAAC,IAAI,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAA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AD,iCAAC;CAAA,AAhCD,CAAgD,6BAA6B,GAgC5E;SAhCY,0BAA0B"}
|
57
src/app/+browse-by/browse-by-guard.js
Normal file
57
src/app/+browse-by/browse-by-guard.js
Normal file
@@ -0,0 +1,57 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DSpaceObjectDataService } from '../core/data/dspace-object-data.service';
|
||||
import { hasValue } from '../shared/empty.util';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { getSucceededRemoteData } from '../core/shared/operators';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
var BrowseByGuard = /** @class */ (function () {
|
||||
function BrowseByGuard(dsoService, translate) {
|
||||
this.dsoService = dsoService;
|
||||
this.translate = translate;
|
||||
}
|
||||
BrowseByGuard.prototype.canActivate = function (route, state) {
|
||||
var _this = this;
|
||||
var title = route.data.title;
|
||||
var metadata = route.params.metadata || route.queryParams.metadata || route.data.metadata;
|
||||
var metadataField = route.data.metadataField;
|
||||
var scope = route.queryParams.scope;
|
||||
var value = route.queryParams.value;
|
||||
var metadataTranslated = this.translate.instant('browse.metadata.' + metadata);
|
||||
if (hasValue(scope)) {
|
||||
var dsoAndMetadata$ = this.dsoService.findById(scope).pipe(getSucceededRemoteData());
|
||||
return dsoAndMetadata$.pipe(map(function (dsoRD) {
|
||||
var name = dsoRD.payload.name;
|
||||
route.data = _this.createData(title, metadata, metadataField, name, metadataTranslated, value);
|
||||
return true;
|
||||
}));
|
||||
}
|
||||
else {
|
||||
route.data = this.createData(title, metadata, metadataField, '', metadataTranslated, value);
|
||||
return observableOf(true);
|
||||
}
|
||||
};
|
||||
BrowseByGuard.prototype.createData = function (title, metadata, metadataField, collection, field, value) {
|
||||
return {
|
||||
title: title,
|
||||
metadata: metadata,
|
||||
metadataField: metadataField,
|
||||
collection: collection,
|
||||
field: field,
|
||||
value: hasValue(value) ? "\"" + value + "\"" : ''
|
||||
};
|
||||
};
|
||||
BrowseByGuard = tslib_1.__decorate([
|
||||
Injectable()
|
||||
/**
|
||||
* A guard taking care of the correct route.data being set for the Browse-By components
|
||||
*/
|
||||
,
|
||||
tslib_1.__metadata("design:paramtypes", [DSpaceObjectDataService,
|
||||
TranslateService])
|
||||
], BrowseByGuard);
|
||||
return BrowseByGuard;
|
||||
}());
|
||||
export { BrowseByGuard };
|
||||
//# sourceMappingURL=browse-by-guard.js.map
|
1
src/app/+browse-by/browse-by-guard.js.map
Normal file
1
src/app/+browse-by/browse-by-guard.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"browse-by-guard.js","sourceRoot":"","sources":["browse-by-guard.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,EAAE,IAAI,YAAY,EAAE,MAAM,MAAM,CAAC;AAM1C;IAEE,uBAAsB,UAAmC,EACnC,SAA2B;QAD3B,eAAU,GAAV,UAAU,CAAyB;QACnC,cAAS,GAAT,SAAS,CAAkB;IACjD,CAAC;IAED,mCAAW,GAAX,UAAY,KAA6B,EAAE,KAA0B;QAArE,iBAoBC;QAnBC,IAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/B,IAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC5F,IAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,aAA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,EAAE;SAC3C,CAAA;IACH,CAAC;IArCU,aAAa;QAJzB,UAAU,EAAE;QACb;;WAEG;;iDAGiC,uBAAuB;YACxB,gBAAgB;OAHtC,aAAa,CAsCzB;IAAD,oBAAC;CAAA,AAtCD,IAsCC;SAtCY,aAAa"}
|
25
src/app/+browse-by/browse-by-routing.module.js
Normal file
25
src/app/+browse-by/browse-by-routing.module.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowseByTitlePageComponent } from './+browse-by-title-page/browse-by-title-page.component';
|
||||
import { BrowseByMetadataPageComponent } from './+browse-by-metadata-page/browse-by-metadata-page.component';
|
||||
import { BrowseByDatePageComponent } from './+browse-by-date-page/browse-by-date-page.component';
|
||||
import { BrowseByGuard } from './browse-by-guard';
|
||||
var BrowseByRoutingModule = /** @class */ (function () {
|
||||
function BrowseByRoutingModule() {
|
||||
}
|
||||
BrowseByRoutingModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: 'title', component: BrowseByTitlePageComponent, canActivate: [BrowseByGuard], data: { metadata: 'title', title: 'browse.title' } },
|
||||
{ path: 'dateissued', component: BrowseByDatePageComponent, canActivate: [BrowseByGuard], data: { metadata: 'dateissued', metadataField: 'dc.date.issued', title: 'browse.title' } },
|
||||
{ path: ':metadata', component: BrowseByMetadataPageComponent, canActivate: [BrowseByGuard], data: { title: 'browse.title' } }
|
||||
])
|
||||
]
|
||||
})
|
||||
], BrowseByRoutingModule);
|
||||
return BrowseByRoutingModule;
|
||||
}());
|
||||
export { BrowseByRoutingModule };
|
||||
//# sourceMappingURL=browse-by-routing.module.js.map
|
1
src/app/+browse-by/browse-by-routing.module.js.map
Normal file
1
src/app/+browse-by/browse-by-routing.module.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"browse-by-routing.module.js","sourceRoot":"","sources":["browse-by-routing.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,6BAA6B,EAAE,MAAM,8DAA8D,CAAC;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAWlD;IAAA;IAEA,CAAC;IAFY,qBAAqB;QATjC,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,YAAY,CAAC,QAAQ,CAAC;oBACpB,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,WAAW,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;oBAC1I,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,yBAAyB,EAAE,WAAW,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;oBACpL,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,6BAA6B,EAAE,WAAW,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;iBAC/H,CAAC;aACH;SACF,CAAC;OACW,qBAAqB,CAEjC;IAAD,4BAAC;CAAA,AAFD,IAEC;SAFY,qBAAqB"}
|
37
src/app/+browse-by/browse-by.module.js
Normal file
37
src/app/+browse-by/browse-by.module.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { BrowseByTitlePageComponent } from './+browse-by-title-page/browse-by-title-page.component';
|
||||
import { ItemDataService } from '../core/data/item-data.service';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { BrowseByRoutingModule } from './browse-by-routing.module';
|
||||
import { BrowseService } from '../core/browse/browse.service';
|
||||
import { BrowseByMetadataPageComponent } from './+browse-by-metadata-page/browse-by-metadata-page.component';
|
||||
import { BrowseByDatePageComponent } from './+browse-by-date-page/browse-by-date-page.component';
|
||||
import { BrowseByGuard } from './browse-by-guard';
|
||||
var BrowseByModule = /** @class */ (function () {
|
||||
function BrowseByModule() {
|
||||
}
|
||||
BrowseByModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
BrowseByRoutingModule,
|
||||
CommonModule,
|
||||
SharedModule
|
||||
],
|
||||
declarations: [
|
||||
BrowseByTitlePageComponent,
|
||||
BrowseByMetadataPageComponent,
|
||||
BrowseByDatePageComponent
|
||||
],
|
||||
providers: [
|
||||
ItemDataService,
|
||||
BrowseService,
|
||||
BrowseByGuard
|
||||
]
|
||||
})
|
||||
], BrowseByModule);
|
||||
return BrowseByModule;
|
||||
}());
|
||||
export { BrowseByModule };
|
||||
//# sourceMappingURL=browse-by.module.js.map
|
1
src/app/+browse-by/browse-by.module.js.map
Normal file
1
src/app/+browse-by/browse-by.module.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"browse-by.module.js","sourceRoot":"","sources":["browse-by.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8DAA8D,CAAC;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAmBlD;IAAA;IAEA,CAAC;IAFY,cAAc;QAjB1B,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,qBAAqB;gBACrB,YAAY;gBACZ,YAAY;aACb;YACD,YAAY,EAAE;gBACZ,0BAA0B;gBAC1B,6BAA6B;gBAC7B,yBAAyB;aAC1B;YACD,SAAS,EAAE;gBACT,eAAe;gBACf,aAAa;gBACb,aAAa;aACd;SACF,CAAC;OACW,cAAc,CAE1B;IAAD,qBAAC;CAAA,AAFD,IAEC;SAFY,cAAc"}
|
@@ -0,0 +1,79 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { DynamicInputModel, DynamicTextAreaModel } from '@ng-dynamic-forms/core';
|
||||
import { ResourceType } from '../../core/shared/resource-type';
|
||||
import { Collection } from '../../core/shared/collection.model';
|
||||
import { ComColFormComponent } from '../../shared/comcol-forms/comcol-form/comcol-form.component';
|
||||
/**
|
||||
* Form used for creating and editing collections
|
||||
*/
|
||||
var CollectionFormComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(CollectionFormComponent, _super);
|
||||
function CollectionFormComponent() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
/**
|
||||
* @type {Collection} A new collection when a collection is being created, an existing Input collection when a collection is being edited
|
||||
*/
|
||||
_this.dso = new Collection();
|
||||
/**
|
||||
* @type {ResourceType.Collection} This is a collection-type form
|
||||
*/
|
||||
_this.type = ResourceType.Collection;
|
||||
/**
|
||||
* The dynamic form fields used for creating/editing a collection
|
||||
* @type {(DynamicInputModel | DynamicTextAreaModel)[]}
|
||||
*/
|
||||
_this.formModel = [
|
||||
new DynamicInputModel({
|
||||
id: 'title',
|
||||
name: 'dc.title',
|
||||
required: true,
|
||||
validators: {
|
||||
required: null
|
||||
},
|
||||
errorMessages: {
|
||||
required: 'Please enter a name for this title'
|
||||
},
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'description',
|
||||
name: 'dc.description',
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'abstract',
|
||||
name: 'dc.description.abstract',
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'rights',
|
||||
name: 'dc.rights',
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'tableofcontents',
|
||||
name: 'dc.description.tableofcontents',
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'license',
|
||||
name: 'dc.rights.license',
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'provenance',
|
||||
name: 'dc.description.provenance',
|
||||
}),
|
||||
];
|
||||
return _this;
|
||||
}
|
||||
tslib_1.__decorate([
|
||||
Input(),
|
||||
tslib_1.__metadata("design:type", Collection)
|
||||
], CollectionFormComponent.prototype, "dso", void 0);
|
||||
CollectionFormComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-collection-form',
|
||||
styleUrls: ['../../shared/comcol-forms/comcol-form/comcol-form.component.scss'],
|
||||
templateUrl: '../../shared/comcol-forms/comcol-form/comcol-form.component.html'
|
||||
})
|
||||
], CollectionFormComponent);
|
||||
return CollectionFormComponent;
|
||||
}(ComColFormComponent));
|
||||
export { CollectionFormComponent };
|
||||
//# sourceMappingURL=collection-form.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"collection-form.component.js","sourceRoot":"","sources":["collection-form.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,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;YAC9B,SAAS,EAAE,CAAC,kEAAkE,CAAC;YAC/E,WAAW,EAAE,kEAAkE;SAChF,CAAC;OACW,uBAAuB,CAoDnC;IAAD,8BAAC;CAAA,AApDD,CAA6C,mBAAmB,GAoD/D;SApDY,uBAAuB"}
|
74
src/app/+collection-page/collection-page-routing.module.js
Normal file
74
src/app/+collection-page/collection-page-routing.module.js
Normal file
@@ -0,0 +1,74 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { CollectionPageComponent } from './collection-page.component';
|
||||
import { CollectionPageResolver } from './collection-page.resolver';
|
||||
import { CreateCollectionPageComponent } from './create-collection-page/create-collection-page.component';
|
||||
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
||||
import { EditCollectionPageComponent } from './edit-collection-page/edit-collection-page.component';
|
||||
import { CreateCollectionPageGuard } from './create-collection-page/create-collection-page.guard';
|
||||
import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component';
|
||||
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||
import { getCollectionModulePath } from '../app-routing.module';
|
||||
export var COLLECTION_PARENT_PARAMETER = 'parent';
|
||||
export function getCollectionPageRoute(collectionId) {
|
||||
return new URLCombiner(getCollectionModulePath(), collectionId).toString();
|
||||
}
|
||||
export function getCollectionEditPath(id) {
|
||||
return new URLCombiner(getCollectionModulePath(), COLLECTION_EDIT_PATH.replace(/:id/, id)).toString();
|
||||
}
|
||||
export function getCollectionCreatePath() {
|
||||
return new URLCombiner(getCollectionModulePath(), COLLECTION_CREATE_PATH).toString();
|
||||
}
|
||||
var COLLECTION_CREATE_PATH = 'create';
|
||||
var COLLECTION_EDIT_PATH = ':id/edit';
|
||||
var CollectionPageRoutingModule = /** @class */ (function () {
|
||||
function CollectionPageRoutingModule() {
|
||||
}
|
||||
CollectionPageRoutingModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{
|
||||
path: COLLECTION_CREATE_PATH,
|
||||
component: CreateCollectionPageComponent,
|
||||
canActivate: [AuthenticatedGuard, CreateCollectionPageGuard]
|
||||
},
|
||||
{
|
||||
path: COLLECTION_EDIT_PATH,
|
||||
pathMatch: 'full',
|
||||
component: EditCollectionPageComponent,
|
||||
canActivate: [AuthenticatedGuard],
|
||||
resolve: {
|
||||
dso: CollectionPageResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':id/delete',
|
||||
pathMatch: 'full',
|
||||
component: DeleteCollectionPageComponent,
|
||||
canActivate: [AuthenticatedGuard],
|
||||
resolve: {
|
||||
dso: CollectionPageResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: CollectionPageComponent,
|
||||
pathMatch: 'full',
|
||||
resolve: {
|
||||
collection: CollectionPageResolver
|
||||
}
|
||||
}
|
||||
])
|
||||
],
|
||||
providers: [
|
||||
CollectionPageResolver,
|
||||
CreateCollectionPageGuard
|
||||
]
|
||||
})
|
||||
], CollectionPageRoutingModule);
|
||||
return CollectionPageRoutingModule;
|
||||
}());
|
||||
export { CollectionPageRoutingModule };
|
||||
//# sourceMappingURL=collection-page-routing.module.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"collection-page-routing.module.js","sourceRoot":"","sources":["collection-page-routing.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAA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AE,6BAA6B;wBACxC,WAAW,EAAE,CAAC,kBAAkB,CAAC;wBACjC,OAAO,EAAE;4BACP,GAAG,EAAE,sBAAsB;yBAC5B;qBACF;oBACD;wBACE,IAAI,EAAE,KAAK;wBACX,SAAS,EAAE,uBAAuB;wBAClC,SAAS,EAAE,MAAM;wBACjB,OAAO,EAAE;4BACP,UAAU,EAAE,sBAAsB;yBACnC;qBACF;iBACF,CAAC;aACH;YACD,SAAS,EAAE;gBACT,sBAAsB;gBACtB,yBAAyB;aAC1B;SACF,CAAC;OACW,2BAA2B,CAEvC;IAAD,kCAAC;CAAA,AAFD,IAEC;SAFY,2BAA2B"}
|
84
src/app/+collection-page/collection-page.component.js
Normal file
84
src/app/+collection-page/collection-page.component.js
Normal file
@@ -0,0 +1,84 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { filter, flatMap, map, startWith, switchMap, take } from 'rxjs/operators';
|
||||
import { PaginatedSearchOptions } from '../+search-page/paginated-search-options.model';
|
||||
import { SearchService } from '../+search-page/search-service/search.service';
|
||||
import { SortDirection, SortOptions } from '../core/cache/models/sort-options.model';
|
||||
import { CollectionDataService } from '../core/data/collection-data.service';
|
||||
import { MetadataService } from '../core/metadata/metadata.service';
|
||||
import { DSpaceObjectType } from '../core/shared/dspace-object-type.model';
|
||||
import { getSucceededRemoteData, redirectToPageNotFoundOn404, toDSpaceObjectListRD } from '../core/shared/operators';
|
||||
import { fadeIn, fadeInOut } from '../shared/animations/fade';
|
||||
import { hasValue, isNotEmpty } from '../shared/empty.util';
|
||||
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
|
||||
var CollectionPageComponent = /** @class */ (function () {
|
||||
function CollectionPageComponent(collectionDataService, searchService, metadata, route, router) {
|
||||
this.collectionDataService = collectionDataService;
|
||||
this.searchService = searchService;
|
||||
this.metadata = metadata;
|
||||
this.route = route;
|
||||
this.router = router;
|
||||
this.paginationConfig = new PaginationComponentOptions();
|
||||
this.paginationConfig.id = 'collection-page-pagination';
|
||||
this.paginationConfig.pageSize = 5;
|
||||
this.paginationConfig.currentPage = 1;
|
||||
this.sortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC);
|
||||
}
|
||||
CollectionPageComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.collectionRD$ = this.route.data.pipe(map(function (data) { return data.collection; }), redirectToPageNotFoundOn404(this.router), take(1));
|
||||
this.logoRD$ = this.collectionRD$.pipe(map(function (rd) { return rd.payload; }), filter(function (collection) { return hasValue(collection); }), flatMap(function (collection) { return collection.logo; }));
|
||||
this.paginationChanges$ = new BehaviorSubject({
|
||||
paginationConfig: this.paginationConfig,
|
||||
sortConfig: this.sortConfig
|
||||
});
|
||||
this.itemRD$ = this.paginationChanges$.pipe(switchMap(function (dto) { return _this.collectionRD$.pipe(getSucceededRemoteData(), map(function (rd) { return rd.payload.id; }), switchMap(function (id) {
|
||||
return _this.searchService.search(new PaginatedSearchOptions({
|
||||
scope: id,
|
||||
pagination: dto.paginationConfig,
|
||||
sort: dto.sortConfig,
|
||||
dsoType: DSpaceObjectType.ITEM
|
||||
})).pipe(toDSpaceObjectListRD());
|
||||
}), startWith(undefined) // Make sure switching pages shows loading component
|
||||
); }));
|
||||
this.route.queryParams.pipe(take(1)).subscribe(function (params) {
|
||||
_this.metadata.processRemoteData(_this.collectionRD$);
|
||||
_this.onPaginationChange(params);
|
||||
});
|
||||
};
|
||||
CollectionPageComponent.prototype.isNotEmpty = function (object) {
|
||||
return isNotEmpty(object);
|
||||
};
|
||||
CollectionPageComponent.prototype.onPaginationChange = function (event) {
|
||||
this.paginationConfig.currentPage = +event.page || this.paginationConfig.currentPage;
|
||||
this.paginationConfig.pageSize = +event.pageSize || this.paginationConfig.pageSize;
|
||||
this.sortConfig.direction = event.sortDirection || this.sortConfig.direction;
|
||||
this.sortConfig.field = event.sortField || this.sortConfig.field;
|
||||
this.paginationChanges$.next({
|
||||
paginationConfig: this.paginationConfig,
|
||||
sortConfig: this.sortConfig
|
||||
});
|
||||
};
|
||||
CollectionPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-collection-page',
|
||||
styleUrls: ['./collection-page.component.scss'],
|
||||
templateUrl: './collection-page.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: [
|
||||
fadeIn,
|
||||
fadeInOut
|
||||
]
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [CollectionDataService,
|
||||
SearchService,
|
||||
MetadataService,
|
||||
ActivatedRoute,
|
||||
Router])
|
||||
], CollectionPageComponent);
|
||||
return CollectionPageComponent;
|
||||
}());
|
||||
export { CollectionPageComponent };
|
||||
//# sourceMappingURL=collection-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"collection-page.component.js","sourceRoot":"","sources":["collection-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAA2C,MAAM,MAAM,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAO,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAI7E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAIpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CA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C,MAAM,CAAC,CAAC;QAClC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,4CAAU,GAAV,UAAW,MAAW;QACpB,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,oDAAkB,GAAlB,UAAmB,KAAK;QACtB,IAAI,CAAC,gBAAgB,CAAC,WAAW,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC;QACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QACnF,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAC7E,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QAEjE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAC3B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC;IACL,CAAC;IAhFU,uBAAuB;QAVnC,SAAS,CAAC;YACT,QAAQ,EAAE,oBAAoB;YAC9B,SAAS,EAAE,CAAC,kCAAkC,CAAC;YAC/C,WAAW,EAAE,kCAAkC;YAC/C,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,UAAU,EAAE;gBACV,MAAM;gBACN,SAAS;aACV;SACF,CAAC;iDAaiC,qBAAqB;YAC7B,aAAa;YAClB,eAAe;YAClB,cAAc;YACb,MAAM;OAhBb,uBAAuB,CAiFnC;IAAD,8BAAC;CAAA,AAjFD,IAiFC;SAjFY,uBAAuB"}
|
37
src/app/+collection-page/collection-page.module.js
Normal file
37
src/app/+collection-page/collection-page.module.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { CollectionPageComponent } from './collection-page.component';
|
||||
import { CollectionPageRoutingModule } from './collection-page-routing.module';
|
||||
import { CreateCollectionPageComponent } from './create-collection-page/create-collection-page.component';
|
||||
import { CollectionFormComponent } from './collection-form/collection-form.component';
|
||||
import { EditCollectionPageComponent } from './edit-collection-page/edit-collection-page.component';
|
||||
import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component';
|
||||
import { SearchService } from '../+search-page/search-service/search.service';
|
||||
var CollectionPageModule = /** @class */ (function () {
|
||||
function CollectionPageModule() {
|
||||
}
|
||||
CollectionPageModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
CollectionPageRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
CollectionPageComponent,
|
||||
CreateCollectionPageComponent,
|
||||
EditCollectionPageComponent,
|
||||
DeleteCollectionPageComponent,
|
||||
CollectionFormComponent
|
||||
],
|
||||
providers: [
|
||||
SearchService
|
||||
]
|
||||
})
|
||||
], CollectionPageModule);
|
||||
return CollectionPageModule;
|
||||
}());
|
||||
export { CollectionPageModule };
|
||||
//# sourceMappingURL=collection-page.module.js.map
|
1
src/app/+collection-page/collection-page.module.js.map
Normal file
1
src/app/+collection-page/collection-page.module.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"collection-page.module.js","sourceRoot":"","sources":["collection-page.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAC1G,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAC1G,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAmB9E;IAAA;IAEA,CAAC;IAFY,oBAAoB;QAjBhC,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,YAAY;gBACZ,YAAY;gBACZ,2BAA2B;aAC5B;YACD,YAAY,EAAE;gBACZ,uBAAuB;gBACvB,6BAA6B;gBAC7B,2BAA2B;gBAC3B,6BAA6B;gBAC7B,uBAAuB;aACxB;YACD,SAAS,EAAE;gBACT,aAAa;aACd;SACF,CAAC;OACW,oBAAoB,CAEhC;IAAD,2BAAC;CAAA,AAFD,IAEC;SAFY,oBAAoB"}
|
30
src/app/+collection-page/collection-page.resolver.js
Normal file
30
src/app/+collection-page/collection-page.resolver.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CollectionDataService } from '../core/data/collection-data.service';
|
||||
import { find } from 'rxjs/operators';
|
||||
import { hasValue } from '../shared/empty.util';
|
||||
/**
|
||||
* This class represents a resolver that requests a specific collection before the route is activated
|
||||
*/
|
||||
var CollectionPageResolver = /** @class */ (function () {
|
||||
function CollectionPageResolver(collectionService) {
|
||||
this.collectionService = collectionService;
|
||||
}
|
||||
/**
|
||||
* Method for resolving a collection based on the parameters in the current route
|
||||
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot
|
||||
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
||||
* @returns Observable<<RemoteData<Collection>> Emits the found collection based on the parameters in the current route,
|
||||
* or an error if something went wrong
|
||||
*/
|
||||
CollectionPageResolver.prototype.resolve = function (route, state) {
|
||||
return this.collectionService.findById(route.params.id).pipe(find(function (RD) { return hasValue(RD.error) || RD.hasSucceeded; }));
|
||||
};
|
||||
CollectionPageResolver = tslib_1.__decorate([
|
||||
Injectable(),
|
||||
tslib_1.__metadata("design:paramtypes", [CollectionDataService])
|
||||
], CollectionPageResolver);
|
||||
return CollectionPageResolver;
|
||||
}());
|
||||
export { CollectionPageResolver };
|
||||
//# sourceMappingURL=collection-page.resolver.js.map
|
1
src/app/+collection-page/collection-page.resolver.js.map
Normal file
1
src/app/+collection-page/collection-page.resolver.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"collection-page.resolver.js","sourceRoot":"","sources":["collection-page.resolver.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;GAEG;AAEH;IACE,gCAAoB,iBAAwC;QAAxC,sBAAiB,GAAjB,iBAAiB,CAAuB;IAC5D,CAAC;IAED;;;;;;OAMG;IACH,wCAAO,GAAP,UAAQ,KAA6B,EAAE,KAA0B;QAC/D,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1D,IAAI,CAAC,UAAC,EAAE,IAAK,OAAA,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,YAAY,EAArC,CAAqC,CAAC,CACpD,CAAC;IACJ,CAAC;IAfU,sBAAsB;QADlC,UAAU,EAAE;iDAE4B,qBAAqB;OADjD,sBAAsB,CAgBlC;IAAD,6BAAC;CAAA,AAhBD,IAgBC;SAhBY,sBAAsB"}
|
@@ -0,0 +1,36 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||
import { RouteService } from '../../shared/services/route.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { CreateComColPageComponent } from '../../shared/comcol-forms/create-comcol-page/create-comcol-page.component';
|
||||
import { CollectionDataService } from '../../core/data/collection-data.service';
|
||||
/**
|
||||
* Component that represents the page where a user can create a new Collection
|
||||
*/
|
||||
var CreateCollectionPageComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(CreateCollectionPageComponent, _super);
|
||||
function CreateCollectionPageComponent(communityDataService, collectionDataService, routeService, router) {
|
||||
var _this = _super.call(this, collectionDataService, communityDataService, routeService, router) || this;
|
||||
_this.communityDataService = communityDataService;
|
||||
_this.collectionDataService = collectionDataService;
|
||||
_this.routeService = routeService;
|
||||
_this.router = router;
|
||||
_this.frontendURL = '/collections/';
|
||||
return _this;
|
||||
}
|
||||
CreateCollectionPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-create-collection',
|
||||
styleUrls: ['./create-collection-page.component.scss'],
|
||||
templateUrl: './create-collection-page.component.html'
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [CommunityDataService,
|
||||
CollectionDataService,
|
||||
RouteService,
|
||||
Router])
|
||||
], CreateCollectionPageComponent);
|
||||
return CreateCollectionPageComponent;
|
||||
}(CreateComColPageComponent));
|
||||
export { CreateCollectionPageComponent };
|
||||
//# sourceMappingURL=create-collection-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-collection-page.component.js","sourceRoot":"","sources":["create-collection-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2EAA2E,CAAC;AAEtH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF;;GAEG;AAMH;IAAmD,yDAAqC;IAGtF,uCACY,oBAA0C,EAC1C,qBAA4C,EAC5C,YAA0B,EAC1B,MAAc;QAJ1B,YAME,kBAAM,qBAAqB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,CAAC,SACzE;QANW,0BAAoB,GAApB,oBAAoB,CAAsB;QAC1C,2BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,kBAAY,GAAZ,YAAY,CAAc;QAC1B,YAAM,GAAN,MAAM,CAAQ;QANhB,iBAAW,GAAG,eAAe,CAAC;;IASxC,CAAC;IAVU,6BAA6B;QALzC,SAAS,CAAC;YACT,QAAQ,EAAE,sBAAsB;YAChC,SAAS,EAAE,CAAC,yCAAyC,CAAC;YACtD,WAAW,EAAE,yCAAyC;SACvD,CAAC;iDAKkC,oBAAoB;YACnB,qBAAqB;YAC9B,YAAY;YAClB,MAAM;OAPf,6BAA6B,CAWzC;IAAD,oCAAC;CAAA,AAXD,CAAmD,yBAAyB,GAW3E;SAXY,6BAA6B"}
|
@@ -0,0 +1,45 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { hasNoValue, hasValue } from '../../shared/empty.util';
|
||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||
import { getFinishedRemoteData } from '../../core/shared/operators';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
/**
|
||||
* Prevent creation of a collection without a parent community provided
|
||||
* @class CreateCollectionPageGuard
|
||||
*/
|
||||
var CreateCollectionPageGuard = /** @class */ (function () {
|
||||
function CreateCollectionPageGuard(router, communityService) {
|
||||
this.router = router;
|
||||
this.communityService = communityService;
|
||||
}
|
||||
/**
|
||||
* True when either a parent ID query parameter has been provided and the parent ID resolves to a valid parent community
|
||||
* Reroutes to a 404 page when the page cannot be activated
|
||||
* @method canActivate
|
||||
*/
|
||||
CreateCollectionPageGuard.prototype.canActivate = function (route, state) {
|
||||
var _this = this;
|
||||
var parentID = route.queryParams.parent;
|
||||
if (hasNoValue(parentID)) {
|
||||
this.router.navigate(['/404']);
|
||||
return observableOf(false);
|
||||
}
|
||||
var parent = this.communityService.findById(parentID)
|
||||
.pipe(getFinishedRemoteData());
|
||||
return parent.pipe(map(function (communityRD) { return hasValue(communityRD) && communityRD.hasSucceeded && hasValue(communityRD.payload); }), tap(function (isValid) {
|
||||
if (!isValid) {
|
||||
_this.router.navigate(['/404']);
|
||||
}
|
||||
}));
|
||||
};
|
||||
CreateCollectionPageGuard = tslib_1.__decorate([
|
||||
Injectable(),
|
||||
tslib_1.__metadata("design:paramtypes", [Router, CommunityDataService])
|
||||
], CreateCollectionPageGuard);
|
||||
return CreateCollectionPageGuard;
|
||||
}());
|
||||
export { CreateCollectionPageGuard };
|
||||
//# sourceMappingURL=create-collection-page.guard.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-collection-page.guard.js","sourceRoot":"","sources":["create-collection-page.guard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAuC,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAG9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAc,EAAE,IAAI,YAAY,EAAE,MAAM,MAAM,CAAC;AAEtD;;;GAGG;AAEH;IACE,mCAA2B,MAAc,EAAU,gBAAsC;QAA9D,WAAM,GAAN,MAAM,CAAQ;QAAU,qBAAgB,GAAhB,gBAAgB,CAAsB;IACzF,CAAC;IAED;;;;OAIG;IACH,+CAAW,GAAX,UAAY,KAA6B,EAAE,KAA0B;QAArE,iBAmBC;QAlBC,IAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;QAC1C,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;YACxB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YAC/B,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;SAC5B;QACD,IAAM,MAAM,GAAsC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC;aACvF,IAAI,CACH,qBAAqB,EAAE,CACxB,CAAC;QAEJ,OAAO,MAAM,CAAC,IAAI,CAChB,GAAG,CAAC,UAAC,WAAkC,IAAK,OAAA,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,YAAY,IAAI,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,EAAlF,CAAkF,CAAC,EAC/H,GAAG,CAAC,UAAC,OAAgB;YACnB,IAAI,CAAC,OAAO,EAAE;gBACZ,KAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;aAChC;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IA5BU,yBAAyB;QADrC,UAAU,EAAE;iDAEwB,MAAM,EAA4B,oBAAoB;OAD9E,yBAAyB,CA6BrC;IAAD,gCAAC;CAAA,AA7BD,IA6BC;SA7BY,yBAAyB"}
|
@@ -0,0 +1,38 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DeleteComColPageComponent } from '../../shared/comcol-forms/delete-comcol-page/delete-comcol-page.component';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { CollectionDataService } from '../../core/data/collection-data.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
/**
|
||||
* Component that represents the page where a user can delete an existing Collection
|
||||
*/
|
||||
var DeleteCollectionPageComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(DeleteCollectionPageComponent, _super);
|
||||
function DeleteCollectionPageComponent(dsoDataService, router, route, notifications, translate) {
|
||||
var _this = _super.call(this, dsoDataService, router, route, notifications, translate) || this;
|
||||
_this.dsoDataService = dsoDataService;
|
||||
_this.router = router;
|
||||
_this.route = route;
|
||||
_this.notifications = notifications;
|
||||
_this.translate = translate;
|
||||
_this.frontendURL = '/collections/';
|
||||
return _this;
|
||||
}
|
||||
DeleteCollectionPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-delete-collection',
|
||||
styleUrls: ['./delete-collection-page.component.scss'],
|
||||
templateUrl: './delete-collection-page.component.html'
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [CollectionDataService,
|
||||
Router,
|
||||
ActivatedRoute,
|
||||
NotificationsService,
|
||||
TranslateService])
|
||||
], DeleteCollectionPageComponent);
|
||||
return DeleteCollectionPageComponent;
|
||||
}(DeleteComColPageComponent));
|
||||
export { DeleteCollectionPageComponent };
|
||||
//# sourceMappingURL=delete-collection-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"delete-collection-page.component.js","sourceRoot":"","sources":["delete-collection-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2EAA2E,CAAC;AACtH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;GAEG;AAMH;IAAmD,yDAAqC;IAGtF,uCACY,cAAqC,EACrC,MAAc,EACd,KAAqB,EACrB,aAAmC,EACnC,SAA2B;QALvC,YAOE,kBAAM,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,CAAC,SAC/D;QAPW,oBAAc,GAAd,cAAc,CAAuB;QACrC,YAAM,GAAN,MAAM,CAAQ;QACd,WAAK,GAAL,KAAK,CAAgB;QACrB,mBAAa,GAAb,aAAa,CAAsB;QACnC,eAAS,GAAT,SAAS,CAAkB;QAP7B,iBAAW,GAAG,eAAe,CAAC;;IAUxC,CAAC;IAXU,6BAA6B;QALzC,SAAS,CAAC;YACT,QAAQ,EAAE,sBAAsB;YAChC,SAAS,EAAE,CAAC,yCAAyC,CAAC;YACtD,WAAW,EAAE,yCAAyC;SACvD,CAAC;iDAK4B,qBAAqB;YAC7B,MAAM;YACP,cAAc;YACN,oBAAoB;YACxB,gBAAgB;OAR5B,6BAA6B,CAYzC;IAAD,oCAAC;CAAA,AAZD,CAAmD,yBAAyB,GAY3E;SAZY,6BAA6B"}
|
@@ -0,0 +1,32 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { EditComColPageComponent } from '../../shared/comcol-forms/edit-comcol-page/edit-comcol-page.component';
|
||||
import { CollectionDataService } from '../../core/data/collection-data.service';
|
||||
/**
|
||||
* Component that represents the page where a user can edit an existing Collection
|
||||
*/
|
||||
var EditCollectionPageComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(EditCollectionPageComponent, _super);
|
||||
function EditCollectionPageComponent(collectionDataService, router, route) {
|
||||
var _this = _super.call(this, collectionDataService, router, route) || this;
|
||||
_this.collectionDataService = collectionDataService;
|
||||
_this.router = router;
|
||||
_this.route = route;
|
||||
_this.frontendURL = '/collections/';
|
||||
return _this;
|
||||
}
|
||||
EditCollectionPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-edit-collection',
|
||||
styleUrls: ['./edit-collection-page.component.scss'],
|
||||
templateUrl: './edit-collection-page.component.html'
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [CollectionDataService,
|
||||
Router,
|
||||
ActivatedRoute])
|
||||
], EditCollectionPageComponent);
|
||||
return EditCollectionPageComponent;
|
||||
}(EditComColPageComponent));
|
||||
export { EditCollectionPageComponent };
|
||||
//# sourceMappingURL=edit-collection-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edit-collection-page.component.js","sourceRoot":"","sources":["edit-collection-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uEAAuE,CAAC;AAEhH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF;;GAEG;AAMH;IAAiD,uDAAmC;IAGlF,qCACY,qBAA4C,EAC5C,MAAc,EACd,KAAqB;QAHjC,YAKE,kBAAM,qBAAqB,EAAE,MAAM,EAAE,KAAK,CAAC,SAC5C;QALW,2BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,YAAM,GAAN,MAAM,CAAQ;QACd,WAAK,GAAL,KAAK,CAAgB;QALvB,iBAAW,GAAG,eAAe,CAAC;;IAQxC,CAAC;IATU,2BAA2B;QALvC,SAAS,CAAC;YACT,QAAQ,EAAE,oBAAoB;YAC9B,SAAS,EAAE,CAAC,uCAAuC,CAAC;YACpD,WAAW,EAAE,uCAAuC;SACrD,CAAC;iDAKmC,qBAAqB;YACpC,MAAM;YACP,cAAc;OANtB,2BAA2B,CAUvC;IAAD,kCAAC;CAAA,AAVD,CAAiD,uBAAuB,GAUvE;SAVY,2BAA2B"}
|
@@ -0,0 +1,71 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { DynamicInputModel, DynamicTextAreaModel } from '@ng-dynamic-forms/core';
|
||||
import { Community } from '../../core/shared/community.model';
|
||||
import { ResourceType } from '../../core/shared/resource-type';
|
||||
import { ComColFormComponent } from '../../shared/comcol-forms/comcol-form/comcol-form.component';
|
||||
/**
|
||||
* Form used for creating and editing communities
|
||||
*/
|
||||
var CommunityFormComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(CommunityFormComponent, _super);
|
||||
function CommunityFormComponent() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
/**
|
||||
* @type {Community} A new community when a community is being created, an existing Input community when a community is being edited
|
||||
*/
|
||||
_this.dso = new Community();
|
||||
/**
|
||||
* @type {ResourceType.Community} This is a community-type form
|
||||
*/
|
||||
_this.type = ResourceType.Community;
|
||||
/**
|
||||
* The dynamic form fields used for creating/editing a community
|
||||
* @type {(DynamicInputModel | DynamicTextAreaModel)[]}
|
||||
*/
|
||||
_this.formModel = [
|
||||
new DynamicInputModel({
|
||||
id: 'title',
|
||||
name: 'dc.title',
|
||||
required: true,
|
||||
validators: {
|
||||
required: null
|
||||
},
|
||||
errorMessages: {
|
||||
required: 'Please enter a name for this title'
|
||||
},
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'description',
|
||||
name: 'dc.description',
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'abstract',
|
||||
name: 'dc.description.abstract',
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'rights',
|
||||
name: 'dc.rights',
|
||||
}),
|
||||
new DynamicTextAreaModel({
|
||||
id: 'tableofcontents',
|
||||
name: 'dc.description.tableofcontents',
|
||||
}),
|
||||
];
|
||||
return _this;
|
||||
}
|
||||
tslib_1.__decorate([
|
||||
Input(),
|
||||
tslib_1.__metadata("design:type", Community)
|
||||
], CommunityFormComponent.prototype, "dso", void 0);
|
||||
CommunityFormComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-community-form',
|
||||
styleUrls: ['../../shared/comcol-forms/comcol-form/comcol-form.component.scss'],
|
||||
templateUrl: '../../shared/comcol-forms/comcol-form/comcol-form.component.html'
|
||||
})
|
||||
], CommunityFormComponent);
|
||||
return CommunityFormComponent;
|
||||
}(ComColFormComponent));
|
||||
export { CommunityFormComponent };
|
||||
//# sourceMappingURL=community-form.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"community-form.component.js","sourceRoot":"","sources":["community-form.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAElG;;GAEG;AAMH;IAA4C,kDAA8B;IAL1E;QAAA,qEAiDC;QA3CC;;WAEG;QACM,SAAG,GAAc,IAAI,SAAS,EAAE,CAAC;QAE1C;;WAEG;QACO,UAAI,GAAG,YAAY,CAAC,SAAS,CAAC;QAExC;;;WAGG;QACH,eAAS,GAA8B;YACrC,IAAI,iBAAiB,CAAC;gBACpB,EAAE,EAAE,OAAO;gBACX,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE;oBACV,QAAQ,EAAE,IAAI;iBACf;gBACD,aAAa,EAAE;oBACb,QAAQ,EAAE,oCAAoC;iBAC/C;aACF,CAAC;YACF,IAAI,oBAAoB,CAAC;gBACvB,EAAE,EAAE,aAAa;gBACjB,IAAI,EAAE,gBAAgB;aACvB,CAAC;YACF,IAAI,oBAAoB,CAAC;gBACvB,EAAE,EAAE,UAAU;gBACd,IAAI,EAAE,yBAAyB;aAChC,CAAC;YACF,IAAI,oBAAoB,CAAC;gBACvB,EAAE,EAAE,QAAQ;gBACZ,IAAI,EAAE,WAAW;aAClB,CAAC;YACF,IAAI,oBAAoB,CAAC;gBACvB,EAAE,EAAE,iBAAiB;gBACrB,IAAI,EAAE,gCAAgC;aACvC,CAAC;SACH,CAAC;;IACJ,CAAC;IAxCU;QAAR,KAAK,EAAE;0CAAM,SAAS;uDAAmB;IAJ/B,sBAAsB;QALlC,SAAS,CAAC;YACT,QAAQ,EAAE,mBAAmB;YAC7B,SAAS,EAAE,CAAC,kEAAkE,CAAC;YAC/E,WAAW,EAAE,kEAAkE;SAChF,CAAC;OACW,sBAAsB,CA4ClC;IAAD,6BAAC;CAAA,AA5CD,CAA4C,mBAAmB,GA4C9D;SA5CY,sBAAsB"}
|
74
src/app/+community-page/community-page-routing.module.js
Normal file
74
src/app/+community-page/community-page-routing.module.js
Normal file
@@ -0,0 +1,74 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { CommunityPageComponent } from './community-page.component';
|
||||
import { CommunityPageResolver } from './community-page.resolver';
|
||||
import { CreateCommunityPageComponent } from './create-community-page/create-community-page.component';
|
||||
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
||||
import { EditCommunityPageComponent } from './edit-community-page/edit-community-page.component';
|
||||
import { CreateCommunityPageGuard } from './create-community-page/create-community-page.guard';
|
||||
import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component';
|
||||
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||
import { getCommunityModulePath } from '../app-routing.module';
|
||||
export var COMMUNITY_PARENT_PARAMETER = 'parent';
|
||||
export function getCommunityPageRoute(communityId) {
|
||||
return new URLCombiner(getCommunityModulePath(), communityId).toString();
|
||||
}
|
||||
export function getCommunityEditPath(id) {
|
||||
return new URLCombiner(getCommunityModulePath(), COMMUNITY_EDIT_PATH.replace(/:id/, id)).toString();
|
||||
}
|
||||
export function getCommunityCreatePath() {
|
||||
return new URLCombiner(getCommunityModulePath(), COMMUNITY_CREATE_PATH).toString();
|
||||
}
|
||||
var COMMUNITY_CREATE_PATH = 'create';
|
||||
var COMMUNITY_EDIT_PATH = ':id/edit';
|
||||
var CommunityPageRoutingModule = /** @class */ (function () {
|
||||
function CommunityPageRoutingModule() {
|
||||
}
|
||||
CommunityPageRoutingModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{
|
||||
path: COMMUNITY_CREATE_PATH,
|
||||
component: CreateCommunityPageComponent,
|
||||
canActivate: [AuthenticatedGuard, CreateCommunityPageGuard]
|
||||
},
|
||||
{
|
||||
path: COMMUNITY_EDIT_PATH,
|
||||
pathMatch: 'full',
|
||||
component: EditCommunityPageComponent,
|
||||
canActivate: [AuthenticatedGuard],
|
||||
resolve: {
|
||||
dso: CommunityPageResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':id/delete',
|
||||
pathMatch: 'full',
|
||||
component: DeleteCommunityPageComponent,
|
||||
canActivate: [AuthenticatedGuard],
|
||||
resolve: {
|
||||
dso: CommunityPageResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: CommunityPageComponent,
|
||||
pathMatch: 'full',
|
||||
resolve: {
|
||||
community: CommunityPageResolver
|
||||
}
|
||||
}
|
||||
])
|
||||
],
|
||||
providers: [
|
||||
CommunityPageResolver,
|
||||
CreateCommunityPageGuard
|
||||
]
|
||||
})
|
||||
], CommunityPageRoutingModule);
|
||||
return CommunityPageRoutingModule;
|
||||
}());
|
||||
export { CommunityPageRoutingModule };
|
||||
//# sourceMappingURL=community-page-routing.module.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"community-page-routing.module.js","sourceRoot":"","sources":["community-page-routing.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,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C5D;oBACD;wBACE,IAAI,EAAE,mBAAmB;wBACzB,SAAS,EAAE,MAAM;wBACjB,SAAS,EAAE,0BAA0B;wBACrC,WAAW,EAAE,CAAC,kBAAkB,CAAC;wBACjC,OAAO,EAAE;4BACP,GAAG,EAAE,qBAAqB;yBAC3B;qBACF;oBACD;wBACE,IAAI,EAAE,YAAY;wBAClB,SAAS,EAAE,MAAM;wBACjB,SAAS,EAAE,4BAA4B;wBACvC,WAAW,EAAE,CAAC,kBAAkB,CAAC;wBACjC,OAAO,EAAE;4BACP,GAAG,EAAE,qBAAqB;yBAC3B;qBACF;oBACD;wBACE,IAAI,EAAE,KAAK;wBACX,SAAS,EAAE,sBAAsB;wBACjC,SAAS,EAAE,MAAM;wBACjB,OAAO,EAAE;4BACP,SAAS,EAAE,qBAAqB;yBACjC;qBACF;iBACF,CAAC;aACH;YACD,SAAS,EAAE;gBACT,qBAAqB;gBACrB,wBAAwB;aACzB;SACF,CAAC;OACW,0BAA0B,CAEtC;IAAD,iCAAC;CAAA,AAFD,IAEC;SAFY,0BAA0B"}
|
41
src/app/+community-page/community-page.component.js
Normal file
41
src/app/+community-page/community-page.component.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { mergeMap, filter, map } from 'rxjs/operators';
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CommunityDataService } from '../core/data/community-data.service';
|
||||
import { MetadataService } from '../core/metadata/metadata.service';
|
||||
import { fadeInOut } from '../shared/animations/fade';
|
||||
import { hasValue } from '../shared/empty.util';
|
||||
import { redirectToPageNotFoundOn404 } from '../core/shared/operators';
|
||||
var CommunityPageComponent = /** @class */ (function () {
|
||||
function CommunityPageComponent(communityDataService, metadata, route, router) {
|
||||
this.communityDataService = communityDataService;
|
||||
this.metadata = metadata;
|
||||
this.route = route;
|
||||
this.router = router;
|
||||
}
|
||||
CommunityPageComponent.prototype.ngOnInit = function () {
|
||||
this.communityRD$ = this.route.data.pipe(map(function (data) { return data.community; }), redirectToPageNotFoundOn404(this.router));
|
||||
this.logoRD$ = this.communityRD$.pipe(map(function (rd) { return rd.payload; }), filter(function (community) { return hasValue(community); }), mergeMap(function (community) { return community.logo; }));
|
||||
};
|
||||
CommunityPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-community-page',
|
||||
styleUrls: ['./community-page.component.scss'],
|
||||
templateUrl: './community-page.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: [fadeInOut]
|
||||
})
|
||||
/**
|
||||
* This component represents a detail page for a single community
|
||||
*/
|
||||
,
|
||||
tslib_1.__metadata("design:paramtypes", [CommunityDataService,
|
||||
MetadataService,
|
||||
ActivatedRoute,
|
||||
Router])
|
||||
], CommunityPageComponent);
|
||||
return CommunityPageComponent;
|
||||
}());
|
||||
export { CommunityPageComponent };
|
||||
//# sourceMappingURL=community-page.component.js.map
|
1
src/app/+community-page/community-page.component.js.map
Normal file
1
src/app/+community-page/community-page.component.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"community-page.component.js","sourceRoot":"","sources":["community-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAM3E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAYvE;IAUE,gCACU,oBAA0C,EAC1C,QAAyB,EACzB,KAAqB,EACrB,MAAc;QAHd,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,aAAQ,GAAR,QAAQ,CAAiB;QACzB,UAAK,GAAL,KAAK,CAAgB;QACrB,WAAM,GAAN,MAAM,CAAQ;IAGxB,CAAC;IAED,yCAAQ,GAAR;QACE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CACtC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,SAAkC,EAAvC,CAAuC,CAAC,EACtD,2BAA2B,CAAC,IAAI,CAAC,MAAM,CAAC,CACzC,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CACnC,GAAG,CAAC,UAAC,EAAyB,IAAK,OAAA,EAAE,CAAC,OAAO,EAAV,CAAU,CAAC,EAC9C,MAAM,CAAC,UAAC,SAAoB,IAAK,OAAA,QAAQ,CAAC,SAAS,CAAC,EAAnB,CAAmB,CAAC,EACrD,QAAQ,CAAC,UAAC,SAAoB,IAAK,OAAA,SAAS,CAAC,IAAI,EAAd,CAAc,CAAC,CAAC,CAAC;IACxD,CAAC;IA5BU,sBAAsB;QAVlC,SAAS,CAAC;YACT,QAAQ,EAAE,mBAAmB;YAC7B,SAAS,EAAE,CAAC,iCAAiC,CAAC;YAC9C,WAAW,EAAE,iCAAiC;YAC9C,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,UAAU,EAAE,CAAC,SAAS,CAAC;SACxB,CAAC;QACF;;WAEG;;iDAY+B,oBAAoB;YAChC,eAAe;YAClB,cAAc;YACb,MAAM;OAdb,sBAAsB,CA8BlC;IAAD,6BAAC;CAAA,AA9BD,IA8BC;SA9BY,sBAAsB"}
|
37
src/app/+community-page/community-page.module.js
Normal file
37
src/app/+community-page/community-page.module.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { CommunityPageComponent } from './community-page.component';
|
||||
import { CommunityPageSubCollectionListComponent } from './sub-collection-list/community-page-sub-collection-list.component';
|
||||
import { CommunityPageRoutingModule } from './community-page-routing.module';
|
||||
import { CommunityPageSubCommunityListComponent } from './sub-community-list/community-page-sub-community-list.component';
|
||||
import { CreateCommunityPageComponent } from './create-community-page/create-community-page.component';
|
||||
import { CommunityFormComponent } from './community-form/community-form.component';
|
||||
import { EditCommunityPageComponent } from './edit-community-page/edit-community-page.component';
|
||||
import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component';
|
||||
var CommunityPageModule = /** @class */ (function () {
|
||||
function CommunityPageModule() {
|
||||
}
|
||||
CommunityPageModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
CommunityPageRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
CommunityPageComponent,
|
||||
CommunityPageSubCollectionListComponent,
|
||||
CommunityPageSubCommunityListComponent,
|
||||
CreateCommunityPageComponent,
|
||||
EditCommunityPageComponent,
|
||||
DeleteCommunityPageComponent,
|
||||
CommunityFormComponent
|
||||
]
|
||||
})
|
||||
], CommunityPageModule);
|
||||
return CommunityPageModule;
|
||||
}());
|
||||
export { CommunityPageModule };
|
||||
//# sourceMappingURL=community-page.module.js.map
|
1
src/app/+community-page/community-page.module.js.map
Normal file
1
src/app/+community-page/community-page.module.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"community-page.module.js","sourceRoot":"","sources":["community-page.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oEAAoE,CAAC;AAC7H,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAC,sCAAsC,EAAC,MAAM,kEAAkE,CAAC;AACxH,OAAO,EAAE,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AAmBvG;IAAA;IAEA,CAAC;IAFY,mBAAmB;QAjB/B,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,YAAY;gBACZ,YAAY;gBACZ,0BAA0B;aAC3B;YACD,YAAY,EAAE;gBACZ,sBAAsB;gBACtB,uCAAuC;gBACvC,sCAAsC;gBACtC,4BAA4B;gBAC5B,0BAA0B;gBAC1B,4BAA4B;gBAC5B,sBAAsB;aACvB;SACF,CAAC;OAEW,mBAAmB,CAE/B;IAAD,0BAAC;CAAA,AAFD,IAEC;SAFY,mBAAmB"}
|
30
src/app/+community-page/community-page.resolver.js
Normal file
30
src/app/+community-page/community-page.resolver.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CommunityDataService } from '../core/data/community-data.service';
|
||||
import { find } from 'rxjs/operators';
|
||||
import { hasValue } from '../shared/empty.util';
|
||||
/**
|
||||
* This class represents a resolver that requests a specific community before the route is activated
|
||||
*/
|
||||
var CommunityPageResolver = /** @class */ (function () {
|
||||
function CommunityPageResolver(communityService) {
|
||||
this.communityService = communityService;
|
||||
}
|
||||
/**
|
||||
* Method for resolving a community based on the parameters in the current route
|
||||
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot
|
||||
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
||||
* @returns Observable<<RemoteData<Community>> Emits the found community based on the parameters in the current route,
|
||||
* or an error if something went wrong
|
||||
*/
|
||||
CommunityPageResolver.prototype.resolve = function (route, state) {
|
||||
return this.communityService.findById(route.params.id).pipe(find(function (RD) { return hasValue(RD.error) || RD.hasSucceeded; }));
|
||||
};
|
||||
CommunityPageResolver = tslib_1.__decorate([
|
||||
Injectable(),
|
||||
tslib_1.__metadata("design:paramtypes", [CommunityDataService])
|
||||
], CommunityPageResolver);
|
||||
return CommunityPageResolver;
|
||||
}());
|
||||
export { CommunityPageResolver };
|
||||
//# sourceMappingURL=community-page.resolver.js.map
|
1
src/app/+community-page/community-page.resolver.js.map
Normal file
1
src/app/+community-page/community-page.resolver.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"community-page.resolver.js","sourceRoot":"","sources":["community-page.resolver.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;GAEG;AAEH;IACE,+BAAoB,gBAAsC;QAAtC,qBAAgB,GAAhB,gBAAgB,CAAsB;IAC1D,CAAC;IAED;;;;;;OAMG;IACH,uCAAO,GAAP,UAAQ,KAA6B,EAAE,KAA0B;QAC/D,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CACzD,IAAI,CAAC,UAAC,EAAE,IAAK,OAAA,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,YAAY,EAArC,CAAqC,CAAC,CACpD,CAAC;IACJ,CAAC;IAfU,qBAAqB;QADjC,UAAU,EAAE;iDAE2B,oBAAoB;OAD/C,qBAAqB,CAgBjC;IAAD,4BAAC;CAAA,AAhBD,IAgBC;SAhBY,qBAAqB"}
|
@@ -0,0 +1,33 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||
import { RouteService } from '../../shared/services/route.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { CreateComColPageComponent } from '../../shared/comcol-forms/create-comcol-page/create-comcol-page.component';
|
||||
/**
|
||||
* Component that represents the page where a user can create a new Community
|
||||
*/
|
||||
var CreateCommunityPageComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(CreateCommunityPageComponent, _super);
|
||||
function CreateCommunityPageComponent(communityDataService, routeService, router) {
|
||||
var _this = _super.call(this, communityDataService, communityDataService, routeService, router) || this;
|
||||
_this.communityDataService = communityDataService;
|
||||
_this.routeService = routeService;
|
||||
_this.router = router;
|
||||
_this.frontendURL = '/communities/';
|
||||
return _this;
|
||||
}
|
||||
CreateCommunityPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-create-community',
|
||||
styleUrls: ['./create-community-page.component.scss'],
|
||||
templateUrl: './create-community-page.component.html'
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [CommunityDataService,
|
||||
RouteService,
|
||||
Router])
|
||||
], CreateCommunityPageComponent);
|
||||
return CreateCommunityPageComponent;
|
||||
}(CreateComColPageComponent));
|
||||
export { CreateCommunityPageComponent };
|
||||
//# sourceMappingURL=create-community-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-community-page.component.js","sourceRoot":"","sources":["create-community-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2EAA2E,CAAC;AAEtH;;GAEG;AAMH;IAAkD,wDAAoC;IAGpF,sCACY,oBAA0C,EAC1C,YAA0B,EAC1B,MAAc;QAH1B,YAKE,kBAAM,oBAAoB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,CAAC,SACxE;QALW,0BAAoB,GAApB,oBAAoB,CAAsB;QAC1C,kBAAY,GAAZ,YAAY,CAAc;QAC1B,YAAM,GAAN,MAAM,CAAQ;QALhB,iBAAW,GAAG,eAAe,CAAC;;IAQxC,CAAC;IATU,4BAA4B;QALxC,SAAS,CAAC;YACT,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE,CAAC,wCAAwC,CAAC;YACrD,WAAW,EAAE,wCAAwC;SACtD,CAAC;iDAKkC,oBAAoB;YAC5B,YAAY;YAClB,MAAM;OANf,4BAA4B,CAUxC;IAAD,mCAAC;CAAA,AAVD,CAAkD,yBAAyB,GAU1E;SAVY,4BAA4B"}
|
@@ -0,0 +1,44 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { hasNoValue, hasValue } from '../../shared/empty.util';
|
||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||
import { getFinishedRemoteData } from '../../core/shared/operators';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
/**
|
||||
* Prevent creation of a community with an invalid parent community provided
|
||||
* @class CreateCommunityPageGuard
|
||||
*/
|
||||
var CreateCommunityPageGuard = /** @class */ (function () {
|
||||
function CreateCommunityPageGuard(router, communityService) {
|
||||
this.router = router;
|
||||
this.communityService = communityService;
|
||||
}
|
||||
/**
|
||||
* True when either NO parent ID query parameter has been provided, or the parent ID resolves to a valid parent community
|
||||
* Reroutes to a 404 page when the page cannot be activated
|
||||
* @method canActivate
|
||||
*/
|
||||
CreateCommunityPageGuard.prototype.canActivate = function (route, state) {
|
||||
var _this = this;
|
||||
var parentID = route.queryParams.parent;
|
||||
if (hasNoValue(parentID)) {
|
||||
return observableOf(true);
|
||||
}
|
||||
var parent = this.communityService.findById(parentID)
|
||||
.pipe(getFinishedRemoteData());
|
||||
return parent.pipe(map(function (communityRD) { return hasValue(communityRD) && communityRD.hasSucceeded && hasValue(communityRD.payload); }), tap(function (isValid) {
|
||||
if (!isValid) {
|
||||
_this.router.navigate(['/404']);
|
||||
}
|
||||
}));
|
||||
};
|
||||
CreateCommunityPageGuard = tslib_1.__decorate([
|
||||
Injectable(),
|
||||
tslib_1.__metadata("design:paramtypes", [Router, CommunityDataService])
|
||||
], CreateCommunityPageGuard);
|
||||
return CreateCommunityPageGuard;
|
||||
}());
|
||||
export { CreateCommunityPageGuard };
|
||||
//# sourceMappingURL=create-community-page.guard.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-community-page.guard.js","sourceRoot":"","sources":["create-community-page.guard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAuC,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAG9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAc,EAAE,IAAI,YAAY,EAAE,MAAM,MAAM,CAAC;AAEtD;;;GAGG;AAEH;IACE,kCAA2B,MAAc,EAAU,gBAAsC;QAA9D,WAAM,GAAN,MAAM,CAAQ;QAAU,qBAAgB,GAAhB,gBAAgB,CAAsB;IACzF,CAAC;IAED;;;;OAIG;IACH,8CAAW,GAAX,UAAY,KAA6B,EAAE,KAA0B;QAArE,iBAmBC;QAlBC,IAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;QAC1C,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;YACxB,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;SAC3B;QAED,IAAM,MAAM,GAAsC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC;aACvF,IAAI,CACH,qBAAqB,EAAE,CACxB,CAAC;QAEJ,OAAO,MAAM,CAAC,IAAI,CAChB,GAAG,CAAC,UAAC,WAAkC,IAAK,OAAA,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,YAAY,IAAI,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,EAAlF,CAAkF,CAAC,EAC/H,GAAG,CAAC,UAAC,OAAgB;YACnB,IAAI,CAAC,OAAO,EAAE;gBACZ,KAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;aAChC;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IA5BU,wBAAwB;QADpC,UAAU,EAAE;iDAEwB,MAAM,EAA4B,oBAAoB;OAD9E,wBAAwB,CA6BpC;IAAD,+BAAC;CAAA,AA7BD,IA6BC;SA7BY,wBAAwB"}
|
@@ -0,0 +1,38 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DeleteComColPageComponent } from '../../shared/comcol-forms/delete-comcol-page/delete-comcol-page.component';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
/**
|
||||
* Component that represents the page where a user can delete an existing Community
|
||||
*/
|
||||
var DeleteCommunityPageComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(DeleteCommunityPageComponent, _super);
|
||||
function DeleteCommunityPageComponent(dsoDataService, router, route, notifications, translate) {
|
||||
var _this = _super.call(this, dsoDataService, router, route, notifications, translate) || this;
|
||||
_this.dsoDataService = dsoDataService;
|
||||
_this.router = router;
|
||||
_this.route = route;
|
||||
_this.notifications = notifications;
|
||||
_this.translate = translate;
|
||||
_this.frontendURL = '/communities/';
|
||||
return _this;
|
||||
}
|
||||
DeleteCommunityPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-delete-community',
|
||||
styleUrls: ['./delete-community-page.component.scss'],
|
||||
templateUrl: './delete-community-page.component.html'
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [CommunityDataService,
|
||||
Router,
|
||||
ActivatedRoute,
|
||||
NotificationsService,
|
||||
TranslateService])
|
||||
], DeleteCommunityPageComponent);
|
||||
return DeleteCommunityPageComponent;
|
||||
}(DeleteComColPageComponent));
|
||||
export { DeleteCommunityPageComponent };
|
||||
//# sourceMappingURL=delete-community-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"delete-community-page.component.js","sourceRoot":"","sources":["delete-community-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2EAA2E,CAAC;AACtH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;GAEG;AAMH;IAAkD,wDAAoC;IAGpF,sCACY,cAAoC,EACpC,MAAc,EACd,KAAqB,EACrB,aAAmC,EACnC,SAA2B;QALvC,YAOE,kBAAM,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,CAAC,SAC/D;QAPW,oBAAc,GAAd,cAAc,CAAsB;QACpC,YAAM,GAAN,MAAM,CAAQ;QACd,WAAK,GAAL,KAAK,CAAgB;QACrB,mBAAa,GAAb,aAAa,CAAsB;QACnC,eAAS,GAAT,SAAS,CAAkB;QAP7B,iBAAW,GAAG,eAAe,CAAC;;IAUxC,CAAC;IAXU,4BAA4B;QALxC,SAAS,CAAC;YACT,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE,CAAC,wCAAwC,CAAC;YACrD,WAAW,EAAE,wCAAwC;SACtD,CAAC;iDAK4B,oBAAoB;YAC5B,MAAM;YACP,cAAc;YACN,oBAAoB;YACxB,gBAAgB;OAR5B,4BAA4B,CAYxC;IAAD,mCAAC;CAAA,AAZD,CAAkD,yBAAyB,GAY1E;SAZY,4BAA4B"}
|
@@ -0,0 +1,32 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { EditComColPageComponent } from '../../shared/comcol-forms/edit-comcol-page/edit-comcol-page.component';
|
||||
/**
|
||||
* Component that represents the page where a user can edit an existing Community
|
||||
*/
|
||||
var EditCommunityPageComponent = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(EditCommunityPageComponent, _super);
|
||||
function EditCommunityPageComponent(communityDataService, router, route) {
|
||||
var _this = _super.call(this, communityDataService, router, route) || this;
|
||||
_this.communityDataService = communityDataService;
|
||||
_this.router = router;
|
||||
_this.route = route;
|
||||
_this.frontendURL = '/communities/';
|
||||
return _this;
|
||||
}
|
||||
EditCommunityPageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-edit-community',
|
||||
styleUrls: ['./edit-community-page.component.scss'],
|
||||
templateUrl: './edit-community-page.component.html'
|
||||
}),
|
||||
tslib_1.__metadata("design:paramtypes", [CommunityDataService,
|
||||
Router,
|
||||
ActivatedRoute])
|
||||
], EditCommunityPageComponent);
|
||||
return EditCommunityPageComponent;
|
||||
}(EditComColPageComponent));
|
||||
export { EditCommunityPageComponent };
|
||||
//# sourceMappingURL=edit-community-page.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edit-community-page.component.js","sourceRoot":"","sources":["edit-community-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uEAAuE,CAAC;AAEhH;;GAEG;AAMH;IAAgD,sDAAkC;IAGhF,oCACY,oBAA0C,EAC1C,MAAc,EACd,KAAqB;QAHjC,YAKE,kBAAM,oBAAoB,EAAE,MAAM,EAAE,KAAK,CAAC,SAC3C;QALW,0BAAoB,GAApB,oBAAoB,CAAsB;QAC1C,YAAM,GAAN,MAAM,CAAQ;QACd,WAAK,GAAL,KAAK,CAAgB;QALvB,iBAAW,GAAG,eAAe,CAAC;;IAQxC,CAAC;IATU,0BAA0B;QALtC,SAAS,CAAC;YACT,QAAQ,EAAE,mBAAmB;YAC7B,SAAS,EAAE,CAAC,sCAAsC,CAAC;YACnD,WAAW,EAAE,sCAAsC;SACpD,CAAC;iDAKkC,oBAAoB;YAClC,MAAM;YACP,cAAc;OANtB,0BAA0B,CAUtC;IAAD,iCAAC;CAAA,AAVD,CAAgD,uBAAuB,GAUtE;SAVY,0BAA0B"}
|
@@ -0,0 +1,26 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Community } from '../../core/shared/community.model';
|
||||
import { fadeIn } from '../../shared/animations/fade';
|
||||
var CommunityPageSubCollectionListComponent = /** @class */ (function () {
|
||||
function CommunityPageSubCollectionListComponent() {
|
||||
}
|
||||
CommunityPageSubCollectionListComponent.prototype.ngOnInit = function () {
|
||||
this.subCollectionsRDObs = this.community.collections;
|
||||
};
|
||||
tslib_1.__decorate([
|
||||
Input(),
|
||||
tslib_1.__metadata("design:type", Community)
|
||||
], CommunityPageSubCollectionListComponent.prototype, "community", void 0);
|
||||
CommunityPageSubCollectionListComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-community-page-sub-collection-list',
|
||||
styleUrls: ['./community-page-sub-collection-list.component.scss'],
|
||||
templateUrl: './community-page-sub-collection-list.component.html',
|
||||
animations: [fadeIn]
|
||||
})
|
||||
], CommunityPageSubCollectionListComponent);
|
||||
return CommunityPageSubCollectionListComponent;
|
||||
}());
|
||||
export { CommunityPageSubCollectionListComponent };
|
||||
//# sourceMappingURL=community-page-sub-collection-list.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"community-page-sub-collection-list.component.js","sourceRoot":"","sources":["community-page-sub-collection-list.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AAKzD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAStD;IAAA;IAOA,CAAC;IAHC,0DAAQ,GAAR;QACE,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;IACxD,CAAC;IALQ;QAAR,KAAK,EAAE;0CAAY,SAAS;8EAAC;IADnB,uCAAuC;QANnD,SAAS,CAAC;YACT,QAAQ,EAAE,uCAAuC;YACjD,SAAS,EAAE,CAAC,qDAAqD,CAAC;YAClE,WAAW,EAAE,qDAAqD;YAClE,UAAU,EAAC,CAAC,MAAM,CAAC;SACpB,CAAC;OACW,uCAAuC,CAOnD;IAAD,8CAAC;CAAA,AAPD,IAOC;SAPY,uCAAuC"}
|
@@ -0,0 +1,32 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Community } from '../../core/shared/community.model';
|
||||
import { fadeIn } from '../../shared/animations/fade';
|
||||
var CommunityPageSubCommunityListComponent = /** @class */ (function () {
|
||||
/**
|
||||
* Component to render the sub-communities of a Community
|
||||
*/
|
||||
function CommunityPageSubCommunityListComponent() {
|
||||
}
|
||||
CommunityPageSubCommunityListComponent.prototype.ngOnInit = function () {
|
||||
this.subCommunitiesRDObs = this.community.subcommunities;
|
||||
};
|
||||
tslib_1.__decorate([
|
||||
Input(),
|
||||
tslib_1.__metadata("design:type", Community)
|
||||
], CommunityPageSubCommunityListComponent.prototype, "community", void 0);
|
||||
CommunityPageSubCommunityListComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-community-page-sub-community-list',
|
||||
styleUrls: ['./community-page-sub-community-list.component.scss'],
|
||||
templateUrl: './community-page-sub-community-list.component.html',
|
||||
animations: [fadeIn]
|
||||
})
|
||||
/**
|
||||
* Component to render the sub-communities of a Community
|
||||
*/
|
||||
], CommunityPageSubCommunityListComponent);
|
||||
return CommunityPageSubCommunityListComponent;
|
||||
}());
|
||||
export { CommunityPageSubCommunityListComponent };
|
||||
//# sourceMappingURL=community-page-sub-community-list.component.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"community-page-sub-community-list.component.js","sourceRoot":"","sources":["community-page-sub-community-list.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AAGzD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAatD;IAHA;;OAEG;IACH;IAOA,CAAC;IAHC,yDAAQ,GAAR;QACE,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;IAC3D,CAAC;IALQ;QAAR,KAAK,EAAE;0CAAY,SAAS;6EAAC;IADnB,sCAAsC;QATlD,SAAS,CAAC;YACT,QAAQ,EAAE,sCAAsC;YAChD,SAAS,EAAE,CAAC,oDAAoD,CAAC;YACjE,WAAW,EAAE,oDAAoD;YACjE,UAAU,EAAC,CAAC,MAAM,CAAC;SACpB,CAAC;QACF;;WAEG;OACU,sCAAsC,CAOlD;IAAD,6CAAC;CAAA,AAPD,IAOC;SAPY,sCAAsC"}
|
22
src/app/+home-page/home-news/home-news.component.js
Normal file
22
src/app/+home-page/home-news/home-news.component.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
var HomeNewsComponent = /** @class */ (function () {
|
||||
/**
|
||||
* Component to render the news section on the home page
|
||||
*/
|
||||
function HomeNewsComponent() {
|
||||
}
|
||||
HomeNewsComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-home-news',
|
||||
styleUrls: ['./home-news.component.scss'],
|
||||
templateUrl: './home-news.component.html'
|
||||
})
|
||||
/**
|
||||
* Component to render the news section on the home page
|
||||
*/
|
||||
], HomeNewsComponent);
|
||||
return HomeNewsComponent;
|
||||
}());
|
||||
export { HomeNewsComponent };
|
||||
//# sourceMappingURL=home-news.component.js.map
|
1
src/app/+home-page/home-news/home-news.component.js.map
Normal file
1
src/app/+home-page/home-news/home-news.component.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"home-news.component.js","sourceRoot":"","sources":["home-news.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAW1C;IAHA;;OAEG;IACH;IAEA,CAAC;IAFY,iBAAiB;QAT7B,SAAS,CAAC;YACT,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE,CAAC,4BAA4B,CAAC;YACzC,WAAW,EAAE,4BAA4B;SAC1C,CAAC;QAEF;;WAEG;OACU,iBAAiB,CAE7B;IAAD,wBAAC;CAAA,AAFD,IAEC;SAFY,iBAAiB"}
|
20
src/app/+home-page/home-page-routing.module.js
Normal file
20
src/app/+home-page/home-page-routing.module.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { HomePageComponent } from './home-page.component';
|
||||
var HomePageRoutingModule = /** @class */ (function () {
|
||||
function HomePageRoutingModule() {
|
||||
}
|
||||
HomePageRoutingModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: HomePageComponent, pathMatch: 'full', data: { title: 'home.title' } }
|
||||
])
|
||||
]
|
||||
})
|
||||
], HomePageRoutingModule);
|
||||
return HomePageRoutingModule;
|
||||
}());
|
||||
export { HomePageRoutingModule };
|
||||
//# sourceMappingURL=home-page-routing.module.js.map
|
1
src/app/+home-page/home-page-routing.module.js.map
Normal file
1
src/app/+home-page/home-page-routing.module.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"home-page-routing.module.js","sourceRoot":"","sources":["home-page-routing.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAS1D;IAAA;IAAqC,CAAC;IAAzB,qBAAqB;QAPjC,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,YAAY,CAAC,QAAQ,CAAC;oBACpB,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;iBAC7F,CAAC;aACH;SACF,CAAC;OACW,qBAAqB,CAAI;IAAD,4BAAC;CAAA,AAAtC,IAAsC;SAAzB,qBAAqB"}
|
16
src/app/+home-page/home-page.component.js
Normal file
16
src/app/+home-page/home-page.component.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Component } from '@angular/core';
|
||||
var HomePageComponent = /** @class */ (function () {
|
||||
function HomePageComponent() {
|
||||
}
|
||||
HomePageComponent = tslib_1.__decorate([
|
||||
Component({
|
||||
selector: 'ds-home-page',
|
||||
styleUrls: ['./home-page.component.scss'],
|
||||
templateUrl: './home-page.component.html'
|
||||
})
|
||||
], HomePageComponent);
|
||||
return HomePageComponent;
|
||||
}());
|
||||
export { HomePageComponent };
|
||||
//# sourceMappingURL=home-page.component.js.map
|
1
src/app/+home-page/home-page.component.js.map
Normal file
1
src/app/+home-page/home-page.component.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"home-page.component.js","sourceRoot":"","sources":["home-page.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAO1C;IAAA;IACA,CAAC;IADY,iBAAiB;QAL7B,SAAS,CAAC;YACT,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE,CAAC,4BAA4B,CAAC;YACzC,WAAW,EAAE,4BAA4B;SAC1C,CAAC;OACW,iBAAiB,CAC7B;IAAD,wBAAC;CAAA,AADD,IACC;SADY,iBAAiB"}
|
29
src/app/+home-page/home-page.module.js
Normal file
29
src/app/+home-page/home-page.module.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as tslib_1 from "tslib";
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { HomeNewsComponent } from './home-news/home-news.component';
|
||||
import { HomePageRoutingModule } from './home-page-routing.module';
|
||||
import { HomePageComponent } from './home-page.component';
|
||||
import { TopLevelCommunityListComponent } from './top-level-community-list/top-level-community-list.component';
|
||||
var HomePageModule = /** @class */ (function () {
|
||||
function HomePageModule() {
|
||||
}
|
||||
HomePageModule = tslib_1.__decorate([
|
||||
NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
HomePageRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
HomePageComponent,
|
||||
TopLevelCommunityListComponent,
|
||||
HomeNewsComponent,
|
||||
]
|
||||
})
|
||||
], HomePageModule);
|
||||
return HomePageModule;
|
||||
}());
|
||||
export { HomePageModule };
|
||||
//# sourceMappingURL=home-page.module.js.map
|
1
src/app/+home-page/home-page.module.js.map
Normal file
1
src/app/+home-page/home-page.module.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"home-page.module.js","sourceRoot":"","sources":["home-page.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,+DAA+D,CAAC;AAc/G;IAAA;IAEA,CAAC;IAFY,cAAc;QAZ1B,QAAQ,CAAC;YACR,OAAO,EAAE;gBACP,YAAY;gBACZ,YAAY;gBACZ,qBAAqB;aACtB;YACD,YAAY,EAAE;gBACZ,iBAAiB;gBACjB,8BAA8B;gBAC9B,iBAAiB;aAClB;SACF,CAAC;OACW,cAAc,CAE1B;IAAD,qBAAC;CAAA,AAFD,IAEC;SAFY,cAAc"}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user